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

Re: [PATCH] builtin-fast-export.c: add default case to avoid crash on corrupt repo

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 22, 2009, 21:58 UTC
Message-ID
<7vwsahcj8i.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<40aa078e0903220522g66cf2172l9f1a43ed562cc4d3@mail.gmail.com>
Erik Faye-Lund <kusmabite@googlemail.com> writes:
Show 8 quoted lines
> Anyway, I guess this makes the most sense as a four-patch series:
> 1) Add test-cases for tags of tag objects, tag objects of tag objects,
> tags of trees and tag objects of trees.
> 2) Turn the existing error into a warning
> 3) Add the missing warning and remove the crash
> 4) Fix fast-export to export tags pointing to tags.
>
> Makes sense?
Yes.

I suspect we will hear an argument that say the dying is deliberate because pretending to have produced a faithful export while some information is lacking is bad and warnings are easy to miss, and I would certainly understand that argument.

We have similar issue with signed tags and filter-branch, which strips the signature when it rewrites the history. I recall the code originally died for the same reasoning, but asking "it died; what can the user do now?" made us realize that it is the best we can do to make best-effort reproduction with a warning when losing information.

This falls into the same category. I think "we die by default if we cannot give a faithful reproduction, and the user needs to give an explicit permission (e.g. --force option) to lose information", is a very sensible thing to do, but "we die if we cannot export some things, and we refuse to produce an approximation." without an escape hatch is not.

Previous: Erik Faye-LundNext: Shawn O. Pearce
Message 5 of 6 in “builtin-fast-export.c: add default case to avoid crash on corrupt repo”
  1. builtin-fast-export.c: add default case to avoid crash on corrupt repoErik Faye-Lund, Mar 21, 2009
  2. Junio C HamanoMar 21, 2009
  3. Erik Faye-LundMar 22, 2009
  4. Erik Faye-LundMar 22, 2009
  5. Junio C HamanoMar 22, 2009
  6. Shawn O. PearceMar 23, 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.