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

Re: [QUESTION] about .git/info/grafts file

From
Junio C Hamano <junkio@cox.net>
Date
Jan 19, 2006, 18:24 UTC
Message-ID
<7v3bjkf54k.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<cda58cb80601190251v5251c8bdh@mail.gmail.com>
Franck <vagabon.xyz@gmail.com> writes:
> I don't see why it is so bad to create a "grafted" repository ? I want
> it to be small but still want to merge by using git-resolve with XX
> repository.
Franck, and people on the list,

I have a bad habit of responding to a "call for help" request by stating how things are currently done and why, sometimes with an outline of how the limitation in the current way can be (or at least I think it could be, without testing that solution myself) worked around, but without making it explicit if the limitation is something that should not be there or if it is something fundamental. This often makes it sound as if I am saying I think the original request is unreasonable, and/or the current state of affairs is perfect. This is one of such cases.

I agree it would be nice to support "strictly speaking, the repository is incomplete but has everything necessary as long as you operate near the tip of the development" mode of operation.

It only has never been a high priority.
Show 6 quoted lines
> Well in my graft file I did:
>
>                     $ cat > .git/info/grafts
>                     <shaid> <shaid>
>
>                     $

The trailing empty line at the end is discarded as a comment, I think, so that should be fine. "terminated by a newline" in the documentation talks about each line being terminated by a LF, not about terminating the file itself with an extra newline.

I think you spotted a bug in a documentation and another in the code. I presume these two <shaid> are the same in what you did; you are saying "this commit has itself as its parent", but that can never be the case and the graft parser should reject such line and complain but I do not think the current code does so.

The documentation says "a commit and its fake parents ... separated by a space and terminated by a newline". We should at least say "zero or more fake parents", or make it ever clearer by giving a couple of examples.

Previous: Junio C HamanoNext: Franck
Message 10 of 21 in “[QUESTION] about .git/info/grafts file”
  1. FranckJan 17, 2006
  2. FranckJan 18, 2006
  3. Junio C HamanoJan 19, 2006
  4. FranckJan 19, 2006
  5. Petr BaudisJan 19, 2006
  6. Linus TorvaldsJan 19, 2006
  7. FranckJan 19, 2006
  8. Linus TorvaldsJan 19, 2006
  9. Junio C HamanoJan 19, 2006
  10. Junio C HamanoJan 19, 2006
  11. FranckJan 20, 2006
  12. Andreas EricssonJan 19, 2006
  13. Petr BaudisJan 19, 2006
  14. FranckJan 19, 2006
  15. Andreas EricssonJan 19, 2006
  16. Petr BaudisJan 19, 2006
  17. Petr BaudisJan 19, 2006
  18. Ryan AndersonJan 20, 2006
  19. Junio C HamanoJan 20, 2006
  20. FranckJan 20, 2006
  21. Junio C HamanoJan 20, 2006

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.