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

Re: [PATCH] Make repack less likely to corrupt repository

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 15, 2009, 20:09 UTC
Message-ID
<7vvdrbjwbt.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<200902151942.15055.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:
Show 25 quoted lines
> söndag 15 februari 2009 17:46:59 skrev Johannes Schindelin:
>> Hi,
>> 
>> On Sun, 15 Feb 2009, Robin Rosenberg wrote:
>> > -	exit 1
>> > +	echo >&2 "INFO: We recovered from the repack error, but your repo"
>> > +	echo >&2 "INFO: is probably suboptimally packed. You may try to repack"
>> > +	echo >&2 "INFO: later. A common reason for repacking failure is that"
>> > +	echo >&2 "INFO: a Windows program was locking one of the old pack files."
>> > +	echo >&2 "INFO: To repack successfully you may have to close that program"
>> > +	echo >&2 "INFO: before repacking."
>> 
>> cat >&2 << EOF?
>
> Yeah, but I followed the pattern from the warnings just prior to these messages.
>
>> > +	exit
>> 
>> You lose the error condition here, but I cannot find a convincing argument 
>> about that in the commit message.
>
> I was thinking of my patch as an ammendment to Junios patch. In that context.
>
> "Exit success if rollback fails after failing to rename old packs." Doesn't this
> count?

No, it does not count, because that sentence is just a statement about _what_ your change does, and does not explain _why_ it is better to report success, other than an unstated "because I think that is more appropriate."

I think your "INFO:" lines are good to give additional useful cue for the human operators, though.

If we wanted to move away old ones to replace them with new ones, and we failed to comply with what the user wished for because the preparatory step of moving-them-away failed, it _is_ a failure, and for this reason, it should be reported as such. That would be my counter-statement that explains _why_.

If you were arguing for using a different but still non-zero exit status to signal the "you asked us to repack but I refused to do so because I couldn't move the in-use packs away; by the way I did not corrupt your repository because I successfully rolled back everything I did, so do not worry to much about it" case, I agree that such a change would be better than what we have. It would allow an automated process to tell a more grave repository error and "I need to kill the git object server that is pinning some of the packfiles open and re-run the repack" situation apart.

Previous: Robin RosenbergNext: Robin Rosenberg
Message 15 of 20 in “Make repack less likely to corrupt repository”
  1. Make repack less likely to corrupt repositoryRobin Rosenberg, Feb 9, 2009
  2. Junio C HamanoFeb 9, 2009
  3. Robin RosenbergFeb 10, 2009
  4. Junio C HamanoFeb 10, 2009
  5. Robin RosenbergFeb 10, 2009
  6. Junio C HamanoFeb 10, 2009
  7. Robin RosenbergFeb 10, 2009
  8. Junio C HamanoFeb 10, 2009
  9. Robin RosenbergFeb 11, 2009
  10. Junio C HamanoFeb 11, 2009
  11. Robin RosenbergFeb 11, 2009
  12. Robin RosenbergFeb 15, 2009
  13. Johannes SchindelinFeb 15, 2009
  14. Robin RosenbergFeb 15, 2009
  15. Junio C HamanoFeb 15, 2009
  16. Robin RosenbergFeb 16, 2009
  17. Robin RosenbergFeb 19, 2009
  18. Johannes SchindelinFeb 19, 2009
  19. Junio C HamanoFeb 20, 2009
  20. Junio C HamanoFeb 20, 2009

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.