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

Re: [PATCH 2/2] fsck: report errors if reflog entries point at invalid objects

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 8, 2015, 16:00 UTC
Message-ID
<c5720357601be135485ef546cae7ffdb@www.dscho.org>
In-Reply-To
<5575B03C.6040008@alum.mit.edu>
Hi Michael,
On 2015-06-08 17:09, Michael Haggerty wrote:
Show 12 quoted lines
> On 06/08/2015 04:27 PM, Johannes Schindelin wrote:
>> On 2015-06-08 08:40, Michael Haggerty wrote:
>>> Previously, if a reflog entry's old or new SHA-1 was not resolvable
>>> to an object, that SHA-1 was silently ignored. Instead, report such
>>> cases as errors.
>>
>> I like the idea, but I am a bit uncertain whether it would constitute
>> "too backwards-incompatible" a change to make this an error. I think
>> it could be argued both ways: it *is* an improvement, but it could
>> also possibly disrupt scripts that work pretty nicely at the moment.
> 
> What kind of script are you worried about?
I was concerned about scripts that work on repositories whose reflogs become inconsistent for whatever reason (that happened a lot to me in the past, IIRC it had something to do with bare repositories and/or shared object databases).
Now, if I was to run a script in, say, cron to verify that all of my repositories (possibly on a network drive, for shared team use), I could imagine that I actually want to error out if the reflogs become inconsistent. But then, I could also imagine that I care more about the script being quiet when everything is okay except for the reflogs. 
> * This change only causes fsck to output an extra line (and exit with
>   a a non-zero retcode).
It is that non-zero exit status that would make my hypothetical cron script start to fail.
Show 5 quoted lines
> * Repair is only a
> 
>       git reflog expire --expire-unreachable=now --all
> 
>   away, I think.
True.
Plus, as I mentioned, it could be considered a bug fix that fsck now reports this problem.
The more I think about it, the more I think it is actually a bug fix.

Thanks, Dscho

Previous: Michael HaggertyNext: Jeff King
Message 9 of 11 in “fsck: don't ignore broken reflog entries”
  1. 0/2 fsck: don't ignore broken reflog entriesMichael Haggerty, Jun 8, 2015
  2. 1/2 fsck_handle_reflog_sha1(): new functionMichael Haggerty, Jun 8, 2015
  3. Johannes SchindelinJun 8, 2015
  4. Junio C HamanoJun 8, 2015
  5. Michael HaggertyJun 8, 2015
  6. 2/2 fsck: report errors if reflog entries point at invalid objectsMichael Haggerty, Jun 8, 2015
  7. Johannes SchindelinJun 8, 2015
  8. Michael HaggertyJun 8, 2015
  9. Johannes SchindelinJun 8, 2015
  10. Jeff KingJun 8, 2015
  11. Johannes SchindelinJun 8, 2015

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.