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

Re: Feature request: Allow to update commit ID in messages when rebasing

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 18, 2019, 02:08 UTC
Message-ID
<xmqqtvewgj4c.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<878sw8bbby.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 20 quoted lines
> On Wed, Apr 17 2019, Giuseppe Crinò wrote:
>
>> The feature I'm asking is to add an extra-step during rebasing,
>> checking whether there's a reference to a commit that's not going to
>> be included in history and asks the user whether the heuristics is
>> correct and if she wants to update those references.
>>
>> Scenario: it can happen for a commit message to contain the ID of an
>> ancestor commit. A typical example is a commit with the message
>> "revert 01a9fe8". If 01a9fe8 and the commit that reverts it are
>> involved in a rebase the message "revert 01a9fe8" is no longer valid
>> -- the old 01a9fe8 has now a different hash. This will most likely be
>> ignored by the person who's rebasing but will let the other people
>> reading history confused.
>
> This would be useful. Done properly we'd need some machinery/command to
> extract the commit id parts from the free-text of the commit
> message. That would be useful for other parts of git, e.g. as discussed
> here:
> https://public-inbox.org/git/xmqqvaxp9oyp.fsf@gitster.mtv.corp.google.com/
That's a helpful input.

But in general we do not have an infrastructure to systematically keep track of "this commit was rewritten to produce that other commit", so even if a mention of an old/superseded commit can be identified reliably, there is no reliable source to rewrite it to the name of the corresponding commit in the new world.

For that mapping, we'd need something like the "git change/evolve" Stefan Xenos was working on, which hasn't materialized.

Previous: Ævar Arnfjörð BjarmasonNext: Jakub Narebski
Message 3 of 7 in “Feature request: Allow to update commit ID in messages when rebasing”
  1. Giuseppe CrinòApr 17, 2019
  2. Ævar Arnfjörð BjarmasonApr 17, 2019
  3. Junio C HamanoApr 18, 2019
  4. Jakub NarebskiApr 18, 2019
  5. Phil HordApr 18, 2019
  6. Giuseppe CrinòApr 18, 2019
  7. Jakub NarebskiApr 19, 2019

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.