Re: [PATCH] git-commit --amend: respect grafted parents.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 26, 2007, 12:24 UTC
- Message-ID
- <Pine.LNX.4.64.0709261322150.28395@racer.site>
- In-Reply-To
- <11908086961933-git-send-email-johannes.sixt@telecom.at>
Hi,
On Wed, 26 Sep 2007, Johannes Sixt wrote:
Show 18 quoted lines
> 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.)
Ciao, Dscho