Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] hit go for branch switching #117

Open
vrom911 opened this issue Oct 4, 2019 · 1 comment
Open

[RFC] hit go for branch switching #117

vrom911 opened this issue Oct 4, 2019 · 1 comment
Assignees
Labels
CLI command-line interface Git Git commands question Further information is requested

Comments

@vrom911
Copy link
Member

vrom911 commented Oct 4, 2019

I see how it could be used in several situations.

Let's say you have the following branches locally:

  1. user/42-branch
  2. user/100-branch
  3. user/branch

Existing branch with the corresponding issue

The hit go command should have an optional int value, which should represent the issue number. And when you say:

$ hit go 42

it should checkout to the branch user/42-branch.

Non-existing issue branch

If there is no such branch which applies to the given issue then it should interactively ask you you would like to create the corresponding branch. If the answer is yes then it should behave as hit new NUM command.

$ hit go 1
There is no branch related to issue 1.
Would you like to create a new one branching from master? [y]/n
> Y
* hit new 1
> N
Aborting go

Branch without issue

If you want to switch to the branch which doesn't belong o the issue you can run just hit go and it should give you options of the branches you can switch to. And you'll just pick one:

$ hit go
[1]:  user/42-branch
[2]: user/100-branch
[3]: user/branch
> 3
* git checkout user/branch
@vrom911 vrom911 added question Further information is requested Git Git commands CLI command-line interface labels Oct 4, 2019
@chshersh
Copy link
Contributor

chshersh commented Oct 4, 2019

@vrom911 This is a super cool idea! Would love to see this feature 🙂

@chshersh chshersh added this to the v0.2.0.0: Refinement milestone Dec 8, 2019
@chshersh chshersh self-assigned this Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI command-line interface Git Git commands question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants