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

Re: Bug: rebase -i creates committer time inversions on 'reword'

From
PWPhillip Wood <phillip.wood@talktalk.net>
Date
Apr 18, 2018, 10:19 UTC
Message-ID
<808c222a-c566-3654-4082-cc0e04a4ad20@talktalk.net>
In-Reply-To
<06c5bd54-f1b0-7fe5-6aa8-870e0ae4487d@kdbg.org>
On 16/04/18 06:56, Johannes Sixt wrote:
Show 34 quoted lines
> 
> Am 15.04.2018 um 23:35 schrieb Junio C Hamano:
>> Ah, do you mean we have an internal sequence like this, when "rebase
>> --continue" wants to conclude an edit/reword?
> 
> Yes, it's only 'reword' that is affected, because then subsequent picks
> are processed by the original process.
> 
>>   - we figure out the committer ident, which grabs a timestamp and
>>     cache it;
>>
>>   - we spawn "commit" to conclude the stopped step, letting it record
>>     its beginning time (which is a bit older than the above) or its
>>     ending time (which is much older due to human typing speed);
> 
> Younger in both cases, of course. According to my tests, we seem to pick
> the beginning time, because the first 'reword'ed commit typically has
> the same timestamp as the preceding picks. Later 'reword'ed commits have
> noticably younger timestamps.
> 
>>   - subsequent "picks" are made in the same process, and share the
>>     timestamp we grabbed in the first step, which is older than the
>>     second one.
>>
>> I guess we'd want a mechanism to tell ident.c layer "discard the
>> cached one, as we are no longer in the same automated sequence", and
>> use that whenever we spawn an editor (or otherwise go interactive).
> 
> Frankly, I think that this caching is overengineered (or prematurly
> optimized). If the design requires that different callers of datestamp()
> must see the same time, then the design is broken. In a fixed design,
> there would be a single call of datestamp() in advance, and then the
> timestamp, which then obviously is a very important piece of data, would
> be passed along as required.

I'm inclined to agree, though it creates complications if we're going to keep giving commits the same author and committer dates when neither is explicitly specified.

Best Wishes
Phillip
> 
> -- Hannes
Previous: Junio C HamanoNext: Phillip Wood
Message 9 of 17 in “Bug: rebase -i creates committer time inversions on 'reword'”
  1. Johannes SixtApr 13, 2018
  2. Phillip WoodApr 14, 2018
  3. Johannes SchindelinApr 14, 2018
  4. Phillip WoodApr 16, 2018
  5. Phillip WoodApr 19, 2018
  6. Junio C HamanoApr 15, 2018
  7. Johannes SixtApr 16, 2018
  8. Junio C HamanoApr 17, 2018
  9. Phillip WoodApr 18, 2018
  10. ident: don't cache default datePhillip Wood, Apr 18, 2018
  11. Ævar Arnfjörð BjarmasonApr 18, 2018
  12. Phillip WoodApr 18, 2018
  13. Johannes SixtApr 18, 2018
  14. Junio C HamanoApr 18, 2018
  15. Phillip WoodApr 19, 2018
  16. Johannes SchindelinApr 20, 2018
  17. Phillip WoodApr 20, 2018

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.