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

Re: grafts+repack+prune = history at danger

From
Junio C Hamano <junkio@cox.net>
Date
Jan 25, 2007, 23:07 UTC
Message-ID
<7vireu7lj0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<45B8E61E.C9C5E6C6@eudaptics.com>
Johannes Sixt <J.Sixt@eudaptics.com> writes:
Show 11 quoted lines
> Isn't there a major hole in the logic how repack works when grafts are
> in effect?
>
> I did this (details follow):
>
> 1. specify grafts
> 2. repack
> 3. prune
> 4. clone
>
> Result: Broken history in the clone; info/grafts was not copied.
That is expected.

If you had problem in the original repository (i.e. the one with grafts) that lost objects after step 3., that would be serious and needs to be fixed, but otherwise the rule of thumb has always been not to expose repositories with grafts without telling unsuspecting downstream people for cloning or fetching. It will give objects they did not even ask for.

grafts are local matter for archaeologist's convenience to glue two independent histories together, and not much more. For example, the history that starts at v2.6.12-rc2 can be grafted on top of old bkcvs history, but people who clone from you may not expect to get anything beyond the true origin of the history at v2.6.12-rc2 (after all that commit object records it as a parentless commit).

I suspect you could extend fetch-pack protocol to give existing grafts from upload-pack to trivially fix 'clone', but I do not know offhand what the ramifications of it are for normal 'fetch'. You would need to merge potentially conflicting graft information you obtained from where you fetched from and what you already had before starting to fetch.

Previous: Johannes SixtNext: Johannes Sixt
Message 2 of 15 in “grafts+repack+prune = history at danger”
  1. Johannes SixtJan 25, 2007
  2. Junio C HamanoJan 25, 2007
  3. Johannes SixtJan 26, 2007
  4. Junio C HamanoJan 26, 2007
  5. Johannes SixtJan 26, 2007
  6. Junio C HamanoJan 26, 2007
  7. Johannes SixtJan 26, 2007
  8. Junio C HamanoJan 26, 2007
  9. Johannes SixtJan 26, 2007
  10. Junio C HamanoJan 26, 2007
  11. Jakub NarebskiJan 26, 2007
  12. Linus TorvaldsJan 26, 2007
  13. Junio C HamanoJan 26, 2007
  14. Linus TorvaldsJan 27, 2007
  15. Mark WoodingJan 26, 2007

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.