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

Re: To graft or not to graft... (Re: Recovering from repository corruption)

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 11, 2008, 23:34 UTC
Message-ID
<m3ve0fr1fg.fsf@localhost.localdomain>
In-Reply-To
<20080611232126.GA9054@cuci.nl>
"Stephen R. van den Berg" <srb@cuci.nl> writes:
Show 18 quoted lines
> This is kind of confusing.
>
> As I understood it from the few shreds of documentation that actually
> mention the grafts file, the grafts file is *not* being cloned.
> Therefore, my assumption was that cloning a repository that has a grafts
> file gives an identical result to cloning the same repository *without*
> the grafts file present.
> 
> As I understand it now, the cloning process actually peeks at the grafts
> file while cloning, and then doesn't copy it.  This results in a rather
> confusingly corrupt clone.
> 
> I suggest two things:
> a. That during the cloning process, the grafts file is completely
>    disregarded in any case at first.
> b. Preferably the grafts file is copied as well (after cloning).  I
>    never really understood why the file is not being copied in the first
>    place (anyone care to explain that?).

A bit of explanation: initially I think grafts were created as a means to "graft" historical repository (conversion from BitKeeper and from patches) to current work repository (from when git was deemed suitable as SCM for Linux kernel development). Nevertheless the machenism is generic enough to change history _locally_ in many strange ways (for example shallow clone uses kind of grafts).

Because graft file can be used to alter history, this totally _bypases_ the check given by sha1 of commit and cryptographically signed tags. It negates security given by sha-1 signing. That's why using grafs must be _conscious_ decision - therefore they are purely local and not propagated.

(Also there were no place for grafts in the "smart" trasport, i.e. git and ssh protocols. Thinking about what happens if both sides have grafs files which differ...)

On the other hand history _without_ grafts might not validate. I think that it is why current confusing behavior...

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Stephen R. van den BergNext: Linus Torvalds
Message 24 of 31 in “Recovering from repository corruption”
  1. Denis BuenoJun 10, 2008
  2. Jakub NarebskiJun 10, 2008
  3. Denis BuenoJun 10, 2008
  4. Jakub NarebskiJun 10, 2008
  5. Denis BuenoJun 10, 2008
  6. Jakub NarebskiJun 10, 2008
  7. Denis BuenoJun 10, 2008
  8. Linus TorvaldsJun 10, 2008
  9. Denis BuenoJun 10, 2008
  10. Linus TorvaldsJun 10, 2008
  11. Denis BuenoJun 10, 2008
  12. Linus TorvaldsJun 10, 2008
  13. Denis BuenoJun 10, 2008
  14. TarmiganJun 10, 2008
  15. Denis BuenoJun 10, 2008
  16. Linus TorvaldsJun 10, 2008
  17. Linus TorvaldsJun 10, 2008
  18. Nicolas PitreJun 11, 2008
  19. Linus TorvaldsJun 11, 2008
  20. Nicolas PitreJun 11, 2008
  21. Denis BuenoJun 10, 2008
  22. Junio C HamanoJun 10, 2008
  23. To graft or not to graft... (Re: Recovering from repository corruption)Stephen R. van den Berg, Jun 11, 2008
  24. Jakub NarebskiJun 11, 2008
  25. Linus TorvaldsJun 11, 2008
  26. Johan HerlandJun 12, 2008
  27. Jeff KingJun 12, 2008
  28. Johan HerlandJun 12, 2008
  29. Stephen R. van den BergJun 12, 2008
  30. Nicolas PitreJun 10, 2008
  31. Denis BuenoJun 10, 2008

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.