Re: Query on git commit amend
- From
- Vijay Lakshminarayanan <laksvij@gmail.com>
- Date
- Dec 7, 2011, 15:06 UTC
- Message-ID
- <87ehwgv2uc.fsf@gmail.com>
- In-Reply-To
- <4EDEFD66.4020404@st.com>
Viresh Kumar <viresh.kumar@st.com> writes:
[snip]
Show 9 quoted lines
> Now, whats the benefit of > > GIT_EDITOR=cat git commit --amend > > over > > git commit --amend -C HEAD > > ?
The latter preserves the original timestamp of the commit and other environment variables like GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL whereas GIT_EDITOR=cat (or true or :) are equivalent to opening up the commit in an editor and so consider these variables during execution.
For instance, you could say
$ GIT_EDITOR=cat GIT_COMMITTER_EMAIL=foo@bar.baz git commit --amend
and the commiter email would be set to foo@bar.baz
-- Cheers ~vijay Gnus should be more complicated.