From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: Re: Edit log message after commit Date: Fri, 30 Sep 2005 01:05:54 +0900 Message-ID: <87br2bq2ot.wl@mail2.atmark-techno.com> References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Thu Sep 29 18:07:17 2005 Return-path: Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EL0vE-0006vz-8H for gcvg-git@gmane.org; Thu, 29 Sep 2005 18:06:12 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932224AbVI2QGE (ORCPT ); Thu, 29 Sep 2005 12:06:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932222AbVI2QGE (ORCPT ); Thu, 29 Sep 2005 12:06:04 -0400 Received: from shop.atmark-techno.com ([210.191.215.173]:54996 "EHLO mail2.atmark-techno.com") by vger.kernel.org with ESMTP id S932220AbVI2QGC (ORCPT ); Thu, 29 Sep 2005 12:06:02 -0400 Received: from smtp.local-network (dns1.atmark-techno.com [210.191.215.170]) by mail2.atmark-techno.com (Postfix) with ESMTP id DA9502E55; Fri, 30 Sep 2005 01:06:00 +0900 (JST) Received: from wat.atmark-techno.com (unknown [192.168.10.81]) by smtp.local-network (Postfix) with ESMTP id 97030B61F; Fri, 30 Sep 2005 01:07:17 +0900 (JST) To: Kevin Leung In-Reply-To: User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: At Thu, 29 Sep 2005 15:45:49 +0800, Kevin Leung wrote: > > But as Tony has pointed out. I would have needed to redo all the > subsequent commits if I was to change non-HEAD commit message. What > is the proper way of doing that? Is it the same as > Documentation/howto/revert-branch-rebase.txt ? as pointed out by others, if the tree is already public, do revert. otherwise, use git-cherry-pick and git-rebase might help. but it might not be a good idea. (don't know) to illustrate this, create the following tree c | b | a | initial git-init-db echo hello > hello.c git-update-index --add hello.c git-commit -v -m 'initial' echo a >> hello.c git-commit -a -m 'add a' echo b >> hello.c git-commit -a -m 'add b' echo c >> hello.c git-commit -a -m 'add c' say, you want to edit the commit message for 'add a'. first, create new branch at where you wanna change the message git checkout -b temp HEAD^^^ # hmm... HEAD^3 doesn't work cherry pick the 'add a' commit but don't commit yet git-cherry-pick -n master^^ commit the change with reediting the original commit log git commit --reedit master^^ rebase the _master_ to temp git-checkout master git-rebase temp I'm pretty sure that there is better way to do it and these should be easy to be scripted. my two cents, -- yashi