Git Product home page Git Product logo

git-branch-select's People

Contributors

acharlop avatar errorx666 avatar jhermsmeier avatar maco03 avatar ot-tony-archer avatar thepacketgeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

git-branch-select's Issues

Error handling

Hi @jhermsmeier

I put incorrect name of branch and I that error ocured:

g branch-select
✔ Select a branch: › q
/Users/piecioshka/.nvm/versions/node/v8.9.4/lib/node_modules/git-branch-select/node_modules/command-join/command-join.js:24
    for (let char of command) {
                     ^

TypeError: command is not iterable

Maybe you can handle this and display error message without quiting interactive mode?

Sorting option: committerdate

It would have been nice to have the option to sort by committerdate instead of alphabetically, so that you get your most recently used branches first, like in:

git branch --sort=-committerdate

Cursor disappears when ctrl+c

image

When cancelling the script instead of choosing a branch, the cursor disappears.

Resourcing the terminal doesn't work. I have to close and reopen it.

Sort by last commit date desc

I love the git branch-select feature (and actually I find it odd that such a useful usage isn't built in git, alongside git checkout -p and git add -p !)

Most often, I want to checkout a branch that has been freshly modified by a colleague, after a git fetch. Would it be possible and sensible to :

  • include in list the branches origin/xxx that I've never checkouted yet, and
  • sort them by date (not alphabetically) ?

Branches not showing

Hello,

when I run branch-select I get

$ git branch-select
? Select a branch: ›
❯   [object Object]

git branch works fine so I am really not understanding what is going on here:

$ git branch
  feature/***
  feature/$$$
  feature/###
* master

Running node v12.7 and git v2.11 on Debian 9.

Thanks!

Unexpected token

First try didn't work for me :

$ sudo npm install --global git-branch-select
$ git branch-select
/usr/local/lib/node_modules/git-branch-select/node_modules/prompt-base/index.js:819
  var prompt = new this(...args);
                        ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/git-branch-select/node_modules/prompt-checkbox/index.js:4:14)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

SyntaxError: Unexpected token =

When running: git branch-select

`
/usr/local/lib/node_modules/git-branch-select/node_modules/prompts/dist/index.js:11
var _ref = _asyncToGenerator(function* (questions = [], { onSubmit = noop, onCancel = noop } = {}) {
^

SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/git-branch-select/node_modules/prompts/index.js:3:7)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
'

Interactive filter

When list shows up alphabetically, it would be extra-super-nice to type 2 or 3 letters of desired branch, to filter the list and display only the branches that contain this exact substring in their name (case-insensitive).

? Select branch (Use arrow keys)
> Assemblyman
  Amusingness
  Antitruster
  Antielitist
  Autoclaving

pha

? Select branch (Use arrow keys)
> Elephant
  Pharmacy

[bug] [linux] Filtering shows `[Object object]` in results

Noticed this when switching back to Linux from Mac for some dev work.

Viewing the list of branches works on both devices...

$ g bs
? Select a branch: › 
❯   master
    roller
    t/linear-release
    t/tx-view-iterate-0
    origin / ja/gh-issue-template
    origin / t/spawn-point-ux

... but filtering now shows [Object object] in the results on Linux:

? Select a branch: › li
❯   [object Object]
    [object Object]
    [object Object]
    [object Object]
    [object Object]

git-branch-select: 4.0.4
Node: 14.17.0
OS: macOS 12.0.1, Ubuntu 21.04.

Quick access by first letter

When list shows up alphabetically, it would be nice to type the first letter of desired branch, to quick jump to the first entry starting by that letter.

It wouldn't help in all cases (e.g. when all the branches have the same prefix!) but would still be a delight in normal usage.

First argument as name filter

How about leveraging a (optional) command-line argument to prefilter the interactive list?

$ git branch-select
? Select branch (Use arrow keys)
> Assemblyman
  Amusingness
  Antitruster
  Antielitist
  Autoclaving
$ git branch-select pha
? Select branch (Use arrow keys)
> Elephant
  Pharmacy

"fatal: missing branch name; try -b"

First of all, love this tool, have been using it for years and promoting it to other developers. Thanks for your hard work!

So, the list of branches is still rendered:
image

But selecting fails with the aforementioned error:
image

Just upgraded to 3.2.2 to see if that might do the trick, but no luck.

Here is some metadata that might help, LMK if there are any other diagnostics that would be useful:

Linux computer 4.15.0-91-generic #92-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
git version 2.26.2
node v14.1.0

edit:

Adding one more diagnostic based on the other issue:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.