git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood@talktalk.net>
To: Eric Sunshine <sunshine@sunshineco.com>, git@vger.kernel.org
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Akinori MUSHA <knu@iDaemons.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 0/2] fix "rebase -i --root" corrupting root commit
Date: Mon, 30 Jul 2018 13:14:27 +0100	[thread overview]
Message-ID: <1f172fc1-4b51-cdf7-e841-5ca41e209be4@talktalk.net> (raw)
In-Reply-To: <20180730092929.71114-1-sunshine@sunshineco.com>

On 30/07/18 10:29, Eric Sunshine wrote:
> This series fixes bugs causing corruption of the root commit when
> "rebase -i --root" is used to swap in a new root commit. In particular,
> the "author" header has trailing garbage. Some tools handle the
> corruption somewhat gracefully by showing a bogus date, but others barf
> on it (gitk, for instance). git-fsck correctly identifies the
> corruption. I discovered this after git-rebase corrupted one of my own
> projects.
> 
> Unfortunately, these bugs (from js/sequencer-and-root-commits) made it
> into the v2.18.0 release. It's worrying that a released Git can be
> creating corrupt commits, but fortunately "rebase -i --root" is not
> likely used often (especially on well-established projects).
> Nevertheless, it may be 'maint' worthy and applies cleanly there.
> 
> It was only after I diagnosed and fixed these bugs that I thought to
> check 'pu' and discovered that Akinori MUSHA already made a stab[1] at
> fixing one of the three bugs which this series fixes. Akinori's fix has
> the somewhat undesirable property that it adds an extra blank line to
> the end of the script, as Phillip correctly pointed out in review[2].
> Patch 2/2 of this series has the more "correct" fix, in addition to
> fixing another bug.
> 
> Moreover, patch 2/2 of this series provides a more thorough fix overall
> than Akinori, so it may make sense to replace his patch with this
> series, though perhaps keep the test his patch adds to augment the
> strict test of the "author" header added by this series.

Johannes and I have some fixups for Akinori's patch on the branch
fix-t3403-author-script-test at https://github.com/phillipwood/git

That branch also contains a fix for the bad quoting of names with "'" in
them. I think it would be good to somehow try and combine this series
with those patches.

I'd really like to see a single function to read and another to write
the author script that is shared by 'git am' and 'git rebase -i', rather
than the two writers and three readers we have at the moment. I was
thinking of doing that in the longer term, but given the extra bug
you've found in read_author_script() maybe we should do that sooner
rather than later.

> [1]: https://public-inbox.org/git/86a7qwpt9g.knu@iDaemons.org/
> [2]: https://public-inbox.org/git/f5b56540-d26a-044e-5f46-1d975f889d06@talktalk.net/
> 
> Eric Sunshine (2):
>   sequencer: fix "rebase -i --root" corrupting author header
>   sequencer: fix "rebase -i --root" corrupting author header timezone
> 
>  sequencer.c                   |  9 +++++++--
>  t/t3404-rebase-interactive.sh | 10 +++++++++-
>  2 files changed, 16 insertions(+), 3 deletions(-)
> 


  parent reply	other threads:[~2018-07-30 12:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30  9:29 [PATCH 0/2] fix "rebase -i --root" corrupting root commit Eric Sunshine
2018-07-30  9:29 ` [PATCH 1/2] sequencer: fix "rebase -i --root" corrupting author header Eric Sunshine
2018-07-30 15:44   ` Johannes Schindelin
2018-07-30  9:29 ` [PATCH 2/2] sequencer: fix "rebase -i --root" corrupting author header timezone Eric Sunshine
2018-07-30 12:20   ` Phillip Wood
2018-07-30 18:45     ` Eric Sunshine
2018-07-30 10:06 ` [PATCH 0/2] fix "rebase -i --root" corrupting root commit Eric Sunshine
2018-07-30 15:47   ` Johannes Schindelin
2018-07-30 19:19     ` Eric Sunshine
2018-07-30 12:14 ` Phillip Wood [this message]
2018-07-30 15:29   ` Junio C Hamano
2018-07-30 15:49   ` Johannes Schindelin
2018-07-30 19:15   ` Eric Sunshine

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=1f172fc1-4b51-cdf7-e841-5ca41e209be4@talktalk.net \
    --to=phillip.wood@talktalk.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=knu@iDaemons.org \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=sunshine@sunshineco.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;
as well as URLs for NNTP newsgroup(s).