On Thu, Jan 5, 2017 at 8:26 AM, Kyle Meyer <[email protected]> wrote:
> > Is there a way to create a spinoff branch containing one commit?

To clarify for other readers: I mean resetting the original
branch back one commit.  The spinoff branch will likely contain
more than one commit, but it "takes" only one commit off of the
original branch.

> > I'm aware that you can use the region to select a number of commits
> > for the spinoff branch, but I haven't found a way to select just one
> > commit (HEAD).  I often make a single commit on a feature branch
> > before realizing I should make a separate branch, but I couldn't get
> > spinoff to work for me here.
>
> While I use magit-branch-spinoff often, I've never made use of the
> region behavior.  Looking into it a bit, it seems that the documentation
> and the actual behavior don't match.  The docstring says that the
> current branch is reset to the commit selected by the endpoint, but the
> code uses commit^.  If the behavior matched the docstring, you should be
> able to get the behavior you're after because the current branch would
> be reset to the last commit of the selection.

That was my interpretation of the docstring as well, I'm glad my
reading isn't at fault.  I can't think of a situation where the
commit^ behavior is more desirable, but we can have a more
in-depth discussion on the issue/PR.

> I'll open an issue or PR within the next couple days to discuss this.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"magit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to