From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] rebase -i: only automatically amend commit if HEAD did not change
Date: Fri, 25 Jul 2008 12:35:42 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.1.00.0807251231560.11976@eeepc-johanness> (raw)
In-Reply-To: <7vod4muzck.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, 25 Jul 2008, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> >> At what point in what valid workflow sequence does HEAD become
> >> different from dotest/amend?
> >
> > $ rebase -i HEAD~5
> >
> > <mark one commit as edit>
> >
> > <Whoa! While editing, I realize that this contains an unrelated
> > bugfix>
> >
> > $ git reset HEAD^
> > $ git add -p
> > $ git commit
> >
> > <Edit a bit here, a bit there>
> >
> > $ git rebase --continue
> >
> > Sure it is a pilot error. It hit this pilot, too.
> > ...
> > In the way that the user certainly did not mean to amend _this_ HEAD.
> > Another HEAD was marked with "edit".
>
> Ok; after this "refraining from incorrectly squashing them", how would the
> user edit the one the user originally intended to edit (I am not
> complaining, but asking for information)?
In this case, the two commits are two commits, the editor popped up with
rebase --continue contains the original commit message, and all is fine.
> So in your workflow example, when there is no pilot error, is this the
> "ideal" sequence?
>
> $ git rebase -i HEAD~5
> .. mark one as edit
> .. ah, the one I wanted to just "edit" actually need to be
> .. split into two because it has some other thing I need to change
> $ git reset HEAD^
> $ git add -p
> $ git stash --keep-index
> .. test to verify the initial part
> $ git commit ;# first part of split commit
> $ git stash pop
> .. test test
> $ git add -p
Without pilot error, here has to come a "git commit -c HEAD@{1}".
> $ git rebase --continue ;# gives you the editor to edit
>
> I wonder if we can make the transcript of the "pilot error" case look like
> this:
>
> $ git rebase -i HEAD~5
> ...
> $ git reset HEAD^
> .. same as above up to...
> .. test to verify the initial part
> $ git rebase --continue ;# oops
> .. gives you the editor to edit the message.
> .. makes a commit, and says:
> committed initial part of the change, stopping.
> .. ah, the command noticed it and did not escape, thanks!
> $ git stash pop
> .. test test
> $ git add -p
> $ git rebase --continue ;# gives you the editor to edit
> .. and goes on this time.
Possible.
The first hunk (IIRC) of my patch would stay the same, but the second hunk
would not fall through to the interactive commit, instead testing if amend
exists, _and_ is different from HEAD, and if both are the case, say
something helpful and exit.
Ciao,
Dscho
prev parent reply other threads:[~2008-07-25 10:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-22 21:36 [PATCH] rebase -i: only automatically amend commit if HEAD did not change Johannes Schindelin
2008-07-22 21:48 ` Stephan Beyer
2008-07-22 22:22 ` Avery Pennarun
2008-07-22 23:55 ` Junio C Hamano
2008-07-23 15:55 ` Avery Pennarun
2008-07-23 12:01 ` Dmitry Potapov
2008-07-23 15:53 ` Avery Pennarun
2008-07-23 16:09 ` Johannes Schindelin
2008-07-23 16:19 ` Avery Pennarun
2008-07-23 23:41 ` Junio C Hamano
2008-07-24 12:20 ` Johannes Schindelin
2008-07-24 12:35 ` Stephan Beyer
2008-07-25 8:44 ` Junio C Hamano
2008-07-25 10:35 ` Johannes Schindelin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.1.00.0807251231560.11976@eeepc-johanness \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox