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

Feature Request: create and/or checkout branch #141

Open
fpnick opened this issue Aug 3, 2017 · 5 comments
Open

Feature Request: create and/or checkout branch #141

fpnick opened this issue Aug 3, 2017 · 5 comments
Labels
backlog This issue will be done later new feature

Comments

@fpnick
Copy link

fpnick commented Aug 3, 2017

Hi Jerome,

I just came across the following: I staged a couple of changes and thought: "Hey, I should open a new feature branch for this". However, that didn't seem to be possible in the Magit buffer, am I correct? So something like "Make this commit to a new branch (instead of the one I'm currently on) and change to that new branch."

That would be a nice feature, I think...

@jreybert
Copy link
Owner

jreybert commented Aug 3, 2017

You're right, it would make a nice feature.

But I disagree the UI you describe. Create a new new branch is not correlated with a commit. It is correlated with checkout.

I think since a long time the best UI to checkout a branch, with completion of existing branches, and a prompt if the requested branch does not exists, asking the user if he wants to create a new branch.

What do you think of such UI?

@fpnick
Copy link
Author

fpnick commented Aug 3, 2017

That sounds good to me as well. The key point for me would be that I don't have to leave the Magit buffer in order to create the new branch.

What you describe regarding auto completion of existing branches would be a nice add-on, too.

@jreybert
Copy link
Owner

jreybert commented Aug 7, 2017

Current state of thought. Thanks to comment on:

  • default mappings
  • behaviors
  • missing commands

There may be several commands:

  • CBB: prompt the user, asking for branch name. the prompt provides completion. when user types enter, if the branch does not exists, propose to create it (with git checkout -b)
  • CBF: prompt the user, asking for branch name. create this branch at HEAD, even if branch already exists (git checkout -B)
  • CB-: checkout previous branch (like git checkout -)

@fpnick
Copy link
Author

fpnick commented Aug 8, 2017

Agreed!

What just came to my mind: being able to initiate a merge (e.g. from a hotfix branch back to develop) from Magit would then also come in handy. This should probably be a 'follow-up' issue though.

@jreybert
Copy link
Owner

jreybert commented Aug 8, 2017

Great. I would like a broader audience for the 3 new features (see also #142 and #24 ). If you want to participate, feel free to update the issues, and also discuss it on gitter.

For the merge feature, this is a nice thought. It will be a new feature, but not right now. Handle nicely merge conflict is not that easy.

@jreybert jreybert added this to To do in vimagit dev board Nov 6, 2017
@jreybert jreybert changed the title Feature Request: Create new Branch Feature Request: create and/or checkout branch Nov 6, 2017
@jreybert jreybert added the backlog This issue will be done later label Oct 9, 2018
nikewall added a commit to nikewall/vimagit that referenced this issue Jun 21, 2020
There are three bindings: <CBB>, <CBF>, and <CB->. <CBB> is the
equivalent of 'git checkout -b'; <CBF> is the equivalent of 'git
checkout -B', and <CB-> is the equivalent of 'git checkout -'.

I adapted the UI based off of the proposed UI in the issue by changing
from autocompletion(?) of typed branch names to listed branches (remote
and local alike) which can be selected with <CBB>/<CBF>, along with the
option to Close the section as well as create a new local branch.

Inline help and vimagit.txt are updated with details.
nikewall added a commit to nikewall/vimagit that referenced this issue Jun 21, 2020
There are three bindings: <CBB>, <CBF>, and <CB->. <CBB> is the
equivalent of 'git checkout -b'; <CBF> is the equivalent of 'git
checkout -B', and <CB-> is the equivalent of 'git checkout -'.

I adapted the UI based off of the proposed UI in the issue by changing
from autocompletion(?) of typed branch names to listed branches (remote
and local alike) which can be selected with <CBB>/<CBF>, along with the
option to Close the section as well as create a new local branch.

Inline help and vimagit.txt are updated with details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog This issue will be done later new feature
Projects
Development

No branches or pull requests

2 participants