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

Re: [PATCH 3/3] rename_ref: replace empty deletion message in HEAD's log

From
Kyle Meyer <kyle@kyleam.com>
Date
Feb 17, 2017, 23:42 UTC
Message-ID
<87zihkpeoz.fsf@kyleam.com>
In-Reply-To
<20170217195549.z6uyy7hbbhj5avh7@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> On Fri, Feb 17, 2017 at 02:43:50PM -0500, Jeff King wrote:
>
>> Yes. I think the options are basically (in order of decreasing
>> preference in my opinion):
>> 
>>   1. Log a rename entry (same sha1, but note the rename in the free-form
>>      text).
>> 
>>   2. Log a delete (sha1 goes to null) followed by a creation (from null
>>      back to the original sha1).
>> 
>>   3. Log nothing at all for HEAD.
>> 
>> This does half of (2). If we do the second half, then I'd prefer it to
>> (3). But if we can do (1), that is better still (IMHO).
[...]
Show 16 quoted lines
>> I'm actually confused about which bit of code is updating HEAD. I do not
>> see it either in files_rename_ref() or in the caller. Yet it clearly
>> happens. But that is the code that would know enough to do (1) or the
>> second half of (2) above.
>
> Ah, I found it. It's in replace_each_worktree_head_symref() these days,
> which does not bother to pass a log message.
> 
> So I think the second half of (2) is probably something like the patch
> below.
>
> Thinking on it more, we probably _do_ want two entries. Because the
> operations are not atomic, it's possible that we may end up in a
> half-way state after the first entry is written. And when debugging such
> a case, I'd much rather see the first half of the operation logged than
> nothing at all.
OK, I'll have a go at replacing patch 3 with this approach.
-- 
Kyle
Previous: Junio C HamanoNext: Kyle Meyer
Message 21 of 36 in “HEAD's reflog entry for a renamed branch”
  1. Kyle MeyerJan 16, 2017
  2. Jeff KingJan 26, 2017
  3. Junio C HamanoJan 26, 2017
  4. Jeff KingJan 26, 2017
  5. 0/3 delete_ref(): support reflog messagesKyle Meyer, Feb 17, 2017
  6. 1/3 delete_refs(): accept a reflog message argumentKyle Meyer, Feb 17, 2017
  7. Jeff KingFeb 17, 2017
  8. Junio C HamanoFeb 17, 2017
  9. Kyle MeyerFeb 17, 2017
  10. 2/3 update-ref: pass reflog message argument to delete_refsKyle Meyer, Feb 17, 2017
  11. Jeff KingFeb 17, 2017
  12. Junio C HamanoFeb 17, 2017
  13. Kyle MeyerFeb 17, 2017
  14. Jeff KingFeb 17, 2017
  15. 3/3 rename_ref: replace empty deletion message in HEAD's logKyle Meyer, Feb 17, 2017
  16. Jeff KingFeb 17, 2017
  17. Junio C HamanoFeb 17, 2017
  18. Jeff KingFeb 17, 2017
  19. Jeff KingFeb 17, 2017
  20. Junio C HamanoFeb 17, 2017
  21. Kyle MeyerFeb 17, 2017
  22. Kyle MeyerFeb 17, 2017
  23. Jeff KingFeb 17, 2017
  24. Junio C HamanoFeb 17, 2017
  25. Jeff KingFeb 17, 2017
  26. 0/4 delete_ref: support reflog messagesKyle Meyer, Feb 21, 2017
  27. 1/4 delete_ref: accept a reflog message argumentKyle Meyer, Feb 21, 2017
  28. Duy NguyenFeb 23, 2017
  29. Junio C HamanoFeb 23, 2017
  30. Kyle MeyerFeb 25, 2017
  31. 2/4 update-ref: pass reflog message to delete_ref()Kyle Meyer, Feb 21, 2017
  32. 4/4 branch: record creation of renamed branch in HEAD's logKyle Meyer, Feb 21, 2017
  33. 3/4 rename_ref: replace empty message in HEAD's logKyle Meyer, Feb 21, 2017
  34. Jeff KingFeb 21, 2017
  35. Junio C HamanoFeb 21, 2017
  36. Kyle MeyerFeb 21, 2017

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.