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

Re: [PATCH 2/2] git repack: keep commits hidden by a graft

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 24, 2009, 05:04 UTC
Message-ID
<7veis6vfh5.fsf@alter.siamese.dyndns.org>
In-Reply-To
<34dfd22bb99c7c466b6131876e8b52ac46f388aa.1248362827u.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 12 quoted lines
> When you have grafts that pretend that a given commit has different
> parents than the ones recorded in the commit object, it is dangerous
> to let 'git repack' remove those hidden parents, as you can easily
> remove the graft and end up with a broken repository.
>
> So let's play it safe and keep those parent objects and everything
> that is reachable by them.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>
> 	Maybe we should not even bother documenting this option?
Why isn't it "--[no-]grafts-replace-parents"?

"--grafts-replace-parents=no" tempts users to say =never or =false, and also suggests we might add settings with other semantics later, but I do not think of any offhand.

As far as I can tell, what the updated code does when this option is in effect is not "do not replace parents", but is "use both real parents and grafted parents", which is the right thing to do (if we said "use only the true parents", then parents reachable only through grafts will be lost after repacking, which is not what we want).

It would probably make more sense to call it "--keep-real-parents" or something.

Do we want to cull duplicated parents? I do not think it matters in this particular context of checking the reachability, but I am just double checking if you thought about the issue.

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 10 in “Make git-gc more robust with regard to grafts”
  1. 0/2 Make git-gc more robust with regard to graftsJohannes Schindelin, Jul 23, 2009
  2. 1/2 Add a test showing that 'git repack' throws away grafted-away parentsJohannes Schindelin, Jul 23, 2009
  3. Björn SteinbrinkJul 23, 2009
  4. 2/2 git repack: keep commits hidden by a graftJohannes Schindelin, Jul 23, 2009
  5. Junio C HamanoJul 24, 2009
  6. Johannes SchindelinJul 24, 2009
  7. Junio C HamanoJul 24, 2009
  8. Björn SteinbrinkJul 24, 2009
  9. Johannes SchindelinJul 24, 2009
  10. Junio C HamanoJul 24, 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.