8000 [RFC] `hit go` for branch switching · Issue #117 · kowainik/hit-on · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[RFC] hit go for branch switching #117
Open
@vrom911

Description

@vrom911

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

Metadata

Metadata

Labels

CLIcommand-line interfaceGitGit commandsquestionFurther information is requested

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0