From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Johannes Sixt <johannes.sixt@telecom.at>,
gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] git-commit --amend: respect grafted parents.
Date: Wed, 26 Sep 2007 15:03:40 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0709261501190.28395@racer.site> (raw)
In-Reply-To: <46FA5604.101@viscovery.net>
Hi,
On Wed, 26 Sep 2007, Johannes Sixt wrote:
> Johannes Schindelin schrieb:
>
> > On Wed, 26 Sep 2007, Johannes Sixt wrote:
> >
> > > This allows a poor-mans-filter-branch of the top-most commit.
> > >
> > > Specifically, I had this history:
> > >
> > > --o--o--A' <-- amended version of A
> > > \
> > > A
> > > \
> > > --o--B--M
> > >
> > > I now wanted to "amend" M to pull in A' instead of A as its second
> > > parent. For various reasons I didn't want to redo the merge M again,
> > > in particular, it already contained the changes that were amended
> > > into A'. So I figured I would just install a graft that lists B and
> > > A' as parents of M and then do a simple git commit --amend. Alas,
> > > git commit looks at the real parents instead of the grafted ones, so
> > > the amended M' would still have A as its second parent. Here is the
> > > fix that picks the grafted parents instead.
> >
> > I do not think that this is a "fix".
> >
> > I'd really suggest that you fix it up (before the amend!) by
> > installing the graft, and running git-filter-branch -1 <branch>.
> > (Note: I did not test this, but it _should_ work. If it does not,
> > please let me know.)
>
> The problem with filter-branch is that it leaves a committer date in M
> that is before A', and for this reason is not the right tool for this
> task. So I do think that this fix is necessary.
But that's easily fixed with "--env-filter 'export
GIT_COMMITTER_DATE=$(date +%s)'" or something similar.
The reason why I insist on not putting this into --amend is that I think
this is not really an amend, but actively a rewrite of the merge commit.
Ciao,
Dscho
next prev parent reply other threads:[~2007-09-26 14:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 12:11 [PATCH] git-commit --amend: respect grafted parents Johannes Sixt
2007-09-26 12:24 ` Johannes Schindelin
2007-09-26 12:52 ` Johannes Sixt
2007-09-26 14:03 ` Johannes Schindelin [this message]
2007-09-26 14:29 ` Johannes Sixt
2007-09-26 18:50 ` Junio C Hamano
2007-09-26 19:47 ` Johannes Schindelin
2007-09-27 8:39 ` David Kastrup
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=Pine.LNX.4.64.0709261501190.28395@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=johannes.sixt@telecom.at \
/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).