From: Yasushi SHOJI <yashi@atmark-techno.com>
To: Kevin Leung <hysoka@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Edit log message after commit
Date: Fri, 30 Sep 2005 01:05:54 +0900 [thread overview]
Message-ID: <87br2bq2ot.wl@mail2.atmark-techno.com> (raw)
In-Reply-To: <dhg5vl$9ac$1@sea.gmane.org>
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
next prev parent reply other threads:[~2005-09-29 16:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-29 2:28 Edit log message after commit Kevin Leung
2005-09-29 4:15 ` Junio C Hamano
2005-09-29 4:17 ` Tony Luck
2005-09-29 4:58 ` Brian Gerst
2005-09-29 7:45 ` Kevin Leung
2005-09-29 16:05 ` Yasushi SHOJI [this message]
2005-09-30 8:24 ` Junio C Hamano
2005-09-29 8:35 ` Catalin Marinas
2005-09-30 7:58 ` Kevin Leung
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=87br2bq2ot.wl@mail2.atmark-techno.com \
--to=yashi@atmark-techno.com \
--cc=git@vger.kernel.org \
--cc=hysoka@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.