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

Re: [PATCH 0/2] commit: preserve commit hash on a no-op amend

From
Ben Knoble <ben.knoble@gmail.com>
Date
Jun 13, 2026, 14:07 UTC
Message-ID
<C33C3BEB-6353-4461-8E7A-72DB663F8BEE@gmail.com>
In-Reply-To
<355d4f1a-147c-47e3-ab09-06810d7910c0@kdbg.org>
Show 11 quoted lines
> Le 13 juin 2026 à 05:59, Johannes Sixt <j6t@kdbg.org> a écrit :
> 
> Am 13.06.26 um 11:16 schrieb Harald Nordgren via GitGitGadget:
>> git commit --amend --no-edit rewrote the commit and moved the branch tip
>> even when nothing changed, because the committer date was reset to "now".
>> Reuse the existing committer date so a no-op amend keeps the commit hash and
>> leaves the branch untouched.
> 
> `git commit --amend --no-edit` is a way to set the committer timestamp
> to the current time without changing other aspects of the commit. This
> takes away this ability, doesn't it?
Indeed. This is a convenient formula to force CI re-runs in certain environments, and so on.
Previous: Johannes SixtNext: Junio C Hamano
Message 5 of 7 in “commit: preserve commit hash on a no-op amend”
  1. 0/2 commit: preserve commit hash on a no-op amendHarald Nordgren via GitGitGadget, Jun 13, 2026
  2. 1/2 commit: extract commit_index_files_or_die() helperHarald Nordgren via GitGitGadget, Jun 13, 2026
  3. 2/2 commit: keep the commit on a no-op amendHarald Nordgren via GitGitGadget, Jun 13, 2026
  4. Johannes SixtJun 13, 2026
  5. Ben KnobleJun 13, 2026
  6. Junio C HamanoJun 13, 2026
  7. Harald NordgrenJun 13, 2026

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.