git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Query on git commit amend

From
VKViresh Kumar <viresh.kumar@st.com>
Date
Dec 7, 2011, 04:20 UTC
Message-ID
<4EDEE988.2070902@st.com>
In-Reply-To
<87wra9und4.fsf@gmail.com>
Thanks guys. This whole session was new to me.
On 12/7/2011 7:58 AM, Vijay Lakshminarayanan wrote:
Show 12 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> > Vijay Lakshminarayanan <laksvij@gmail.com> 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
Previous: Vijay LakshminarayananNext: Björn Steinbrink
Message 20 of 27 in “Query on git commit amend”
  1. Viresh KumarDec 6, 2011
  2. Konstantin KhomoutovDec 6, 2011
  3. Dirk SüsserottDec 6, 2011
  4. Johannes SixtDec 6, 2011
  5. Viresh KumarDec 6, 2011
  6. Viresh KumarDec 6, 2011
  7. Vijay LakshminarayananDec 6, 2011
  8. Jeff KingDec 6, 2011
  9. Vijay LakshminarayananDec 7, 2011
  10. Junio C HamanoDec 6, 2011
  11. Junio C HamanoDec 6, 2011
  12. 0/4 Re: commit: honor --no-editJonathan Nieder, Dec 7, 2011
  13. 1/4 test: add missing "&&" after echo commandJonathan Nieder, Dec 7, 2011
  14. Jeff KingDec 7, 2011
  15. Jeff KingDec 7, 2011
  16. 2/4 test: remove a porcelain test that hard-codes commit namesJonathan Nieder, Dec 7, 2011
  17. 3/4 t7501 (commit): modernize styleJonathan Nieder, Dec 7, 2011
  18. 4/4 test: commit --amend should honor --no-editJonathan Nieder, Dec 7, 2011
  19. Vijay LakshminarayananDec 7, 2011
  20. Viresh KumarDec 7, 2011
  21. Björn SteinbrinkDec 7, 2011
  22. Viresh KumarDec 7, 2011
  23. Vijay LakshminarayananDec 7, 2011
  24. Junio C HamanoDec 8, 2011
  25. Viresh KumarDec 9, 2011
  26. Viresh KumarDec 8, 2011
  27. Viresh KumarDec 8, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.