login
Header Space

 
 

Re: Edit log message after commit

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Kevin Leung <hysoka@...>
Cc: <git@...>
Date: Thursday, September 29, 2005 - 12:05 pm

At Thu, 29 Sep 2005 15:45:49 +0800,
Kevin Leung wrote:

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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Edit log message after commit, Kevin Leung, (Wed Sep 28, 10:28 pm)
Re: Edit log message after commit, Catalin Marinas, (Thu Sep 29, 4:35 am)
Re: Edit log message after commit, Kevin Leung, (Fri Sep 30, 3:58 am)
Re: Edit log message after commit, Kevin Leung, (Thu Sep 29, 3:45 am)
Re: Edit log message after commit, Yasushi SHOJI, (Thu Sep 29, 12:05 pm)
Re: Edit log message after commit, Junio C Hamano, (Fri Sep 30, 4:24 am)
Re: Edit log message after commit, Brian Gerst, (Thu Sep 29, 12:58 am)
Re: Edit log message after commit, Tony Luck, (Thu Sep 29, 12:17 am)
Re: Edit log message after commit, Junio C Hamano, (Thu Sep 29, 12:15 am)
speck-geostationary