From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Schindelin Subject: Re: [PATCH] git-commit --amend: respect grafted parents. Date: Wed, 26 Sep 2007 15:03:40 +0100 (BST) Message-ID: References: <11908086961933-git-send-email-johannes.sixt@telecom.at> <46FA5604.101@viscovery.net> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Johannes Sixt , gitster@pobox.com, git@vger.kernel.org To: Johannes Sixt X-From: git-owner@vger.kernel.org Wed Sep 26 16:05:03 2007 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1IaXVX-0007Fa-BD for gcvg-git-2@gmane.org; Wed, 26 Sep 2007 16:04:55 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754066AbXIZOEr (ORCPT ); Wed, 26 Sep 2007 10:04:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753705AbXIZOEr (ORCPT ); Wed, 26 Sep 2007 10:04:47 -0400 Received: from mail.gmx.net ([213.165.64.20]:59692 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753453AbXIZOEq (ORCPT ); Wed, 26 Sep 2007 10:04:46 -0400 Received: (qmail invoked by alias); 26 Sep 2007 14:04:44 -0000 Received: from unknown (EHLO [138.251.11.74]) [138.251.11.74] by mail.gmx.net (mp056) with SMTP; 26 Sep 2007 16:04:44 +0200 X-Authenticated: #1490710 X-Provags-ID: V01U2FsdGVkX1+87mduCwi8AoKcrcYMW7IjBYEdB0AQgaow5/kwPw BgSRQL8wdUk7n/ X-X-Sender: gene099@racer.site In-Reply-To: <46FA5604.101@viscovery.net> X-Y-GMX-Trusted: 0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: 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 . > > (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