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

[PATCH 0/3] commit: add an option to reword the last commit

From
PGPhillip Wood via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 21, 2020, 13:30 UTC
Message-ID
<pull.736.git.1600695050.gitgitgadget@gmail.com>

If one notices a typo in the last commit after starting to stage changes for the next commit it is useful to be able to reword the last commit without changing its contents. Currently the way to do that is by specifying --amend --only with no pathspec which is not that obvious to new users (so much so that before beb635ca9c ("commit: remove 'Clever' message for --only --amend", 2016-12-09) commit printed a message to congratulate the user on figuring out how to do it). If the last commit is empty one has to pass --allow-empty as well even though the contents are not being changed. These patches contain a couple of small clean ups for the commit documentation add a --reword option for commit that rewords the last commit without changing its contents.

Phillip Wood (3):
  commit docs: use backquotes when quoting options
  commit: reorder synopsis
  commit: add an option the reword HEAD
 Documentation/git-commit.txt          | 30 +++++++++-----
 builtin/commit.c                      | 46 +++++++++++++++++++++-
 t/t7501-commit-basic-functionality.sh | 56 +++++++++++++++++++++++++++
 3 files changed, 121 insertions(+), 11 deletions(-)
base-commit: 54e85e7af1ac9e9a92888060d6811ae767fea1bc
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-736%2Fphillipwood%2Fwip%2Fcommit-reword-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-736/phillipwood/wip/commit-reword-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/736
-- 
gitgitgadget
Next: Phillip Wood via GitGitGadget
Message 1 of 21 in “commit: add an option to reword the last commit”
  1. 0/3 commit: add an option to reword the last commitPhillip Wood via GitGitGadget, Sep 21, 2020
  2. 3/3 commit: add an option the reword HEADPhillip Wood via GitGitGadget, Sep 21, 2020
  3. Eric SunshineSep 21, 2020
  4. Phillip WoodSep 21, 2020
  5. Eric SunshineSep 21, 2020
  6. Junio C HamanoSep 21, 2020
  7. Phillip WoodSep 22, 2020
  8. Junio C HamanoSep 22, 2020
  9. Christian CouderSep 21, 2020
  10. Phillip WoodSep 21, 2020
  11. Johannes SchindelinSep 23, 2020
  12. Phillip WoodSep 23, 2020
  13. Johannes SchindelinSep 23, 2020
  14. Phillip WoodSep 24, 2020
  15. Junio C HamanoSep 24, 2020
  16. 1/3 commit docs: use backquotes when quoting optionsPhillip Wood via GitGitGadget, Sep 21, 2020
  17. 2/3 commit: reorder synopsisPhillip Wood via GitGitGadget, Sep 21, 2020
  18. Junio C HamanoSep 22, 2020
  19. Phillip WoodSep 22, 2020
  20. Junio C HamanoSep 22, 2020
  21. Junio C HamanoSep 21, 2020

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.