git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: minor interactive rebase regression: HEAD points to wrong commit while rewording
Date: Mon, 12 Aug 2019 20:56:18 +0200	[thread overview]
Message-ID: <20190812185618.GN20404@szeder.dev> (raw)
In-Reply-To: <xmqqsgq69rky.fsf@gitster-ct.c.googlers.com>

On Mon, Aug 12, 2019 at 11:17:01AM -0700, Junio C Hamano wrote:
> SZEDER Gábor <szeder.dev@gmail.com> writes:
> 
> > ...
> > So far so good.
> > Save the updated commit message, and after the editor opens up the
> > third commit's log message, check again where HEAD is pointing to now:
> >
> >   ~/tmp/reword (master +|REBASE-i 2/3)$ head -n1 .git/COMMIT_EDITMSG 
> >   third
> >   ~/tmp/reword (master +|REBASE-i 2/3)$ git log --oneline -1
> >   c3db735 (HEAD) second - updated
> >
> > As you can see, HEAD still points to the (now rewritten) second
> > commit.
> >
> > It's only HEAD,...
> 
> Yuck.
> 
> That would still be annoying to some people and outright buggy to
> others, if their workflow relies on HEAD (e.g. compare with HEAD
> while reviewing the log messsage) and then now they instead need to
> adjust (e.g. compare with the index instead).

Well, it's caused by a 2.5 year old commit, so either all those people
have been lucky so far (or just don't do subsequent rewords?), or
those who stumbled upon it already adjusted without complaining to us.

> Perhaps you are one of them

No; during the second reword I ran 'git log -2' in the other terminal
(wanted to copy a sentence from the previous, just reworded commit),
and noticed that the two listed commits were "off by one".


BTW, rewriting the first commit appears to be important.  When doing
an edit-reword of two subsequent commits, then this issue only happens
if the edit actually rewrites the commit.  However, when, instead of
editing anything, I do a 'git rebase --continue' right away, then HEAD
points to where it should during the subsequent reword.

Anyway, Cc:-ing Dscho for his rebase expertise.


  reply	other threads:[~2019-08-12 18:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 17:50 minor interactive rebase regression: HEAD points to wrong commit while rewording SZEDER Gábor
2019-08-12 18:17 ` Junio C Hamano
2019-08-12 18:56   ` SZEDER Gábor [this message]
2019-08-12 20:28 ` Phillip Wood
2019-08-14 20:45   ` Johannes Schindelin
2019-08-14 21:40     ` SZEDER Gábor
2019-08-14 21:20   ` SZEDER Gábor
2019-08-15 13:47     ` Phillip Wood
2019-08-15 16:36       ` Junio C Hamano
2019-08-15 16:54         ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190812185618.GN20404@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).