Subject: Re: Query on git commit amend

From: Viresh Kumar <[email-masked]>
Date: Wed, 7 Dec 2011 09:50:24 +0530

Thanks guys. This whole session was new to me.

On 12/7/2011 7:58 AM, Vijay Lakshminarayanan wrote:
> Junio C Hamano <[email-masked]> writes:
> 
>> > Vijay Lakshminarayanan <[email-masked]> writes:
>> >
>>> >> I've found 
>>> >>
>>> >> $ GIT_EDITOR=cat git commit --amend
>>> >>
>>> >> useful.
>> >
>> > Are you sure it is a cat?
> Yes.

This didn't worked for me. Got following error:

cat: unrecognized option `--amend'
Try `cat --help' for more information.
error: There was a problem with the editor 'cat git commit --amend'.
Please supply the message using either -m or -F option.
Could not commit staged changes.

>> > I almost always use
>> >
>> >     $ EDITOR=: git commit --amend

Even this didn't worked for me:

error: pathspec '.git/COMMIT_EDITMSG' did not match any file(s) known to git.
error: There was a problem with the editor 'git commit --amend'.
Please supply the message using either -m or -F option.
Could not commit staged changes.

Only "true" worked for me.

Probably, i have an older version of git (version 1.7.2.2)

One more thing. I couldn't get completely how this worked. Maybe any pointers to
earlier discussions.

The way i am testing it is:
- Stop after a commit in middle of rebase using "edit" or "e" option
- set EDITOR or GIT_EDITOR
- change files
- git add changed_files
- git rebase --continue

-- 
viresh