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

Re: Recording merges after repo conversion

From
Johan Herland <johan@herland.net>
Date
Oct 31, 2007, 12:43 UTC
Message-ID
<200710311343.58414.johan@herland.net>
In-Reply-To
<Pine.LNX.4.64.0710311059020.4362@racer.site>
On Wednesday 31 October 2007, Johannes Schindelin wrote:
Show 14 quoted lines
> Hi,
> 
> On Wed, 31 Oct 2007, Peter Karlsson wrote:
> 
> > Johannes Schindelin:
> > 
> > > Why should it?  This would contradict the whole "a commit sha1 hashes 
> > > the commit, and by inference the _whole_ history" principle.
> > 
> > Does it?
> 
> Yes!  Of course!  If what you want becomes possible, I could make an evil 
> change in history long gone, and slip it by you.  You could not even see 
> the history which changed.

Well, technically, if the grafts file was part of the repo, you wouldn't be able to change the (in-tree) grafts file without affecting the SHA1 of HEAD. In other words, given a commit SHA1 sum, you can be sure that someone else who checks out the same commit (and has no local modification to their grafts file) will see exactly the same history as you do.

To a certain degree, this is actually "safer" than today's (out-of-tree) solution, where one can change the grafts file _without_ affecting the current HEAD (SHA1 sum), and thus will not see the same history as someone else who checks out the same HEAD. This is of course _intended_ to a certain degree by the current implementation, but can easily cause confusion if people lose track of what's in their respective grafts files.

Of course, this is both a blessing and a curse: Say, for example, we have three commits:

... --> A --> B --> C

and commit B changes the (in-tree) grafts file. Now if I have HEAD @ A, I will see a different history than if I have HEAD @ C. Worse: If one person has HEAD @ A, and another person has HEAD @ C, and neither is aware of the grafts file change in B, there is _plenty_ of room for getting confused if the two persons start discussing the repo history. Note, however, that similar confusement can be achieved today if one of the persons forgets having changed his out-of-tree grafts file

The grafts file concept is very powerful, but can also be extremely confusing. Adding in-tree versioning of the grafts file will make it more powerful (since we can now easily share and update "errata" to the repo history), but it might also make things _orders_of_magnitude_ more confusing (as demonstrated in the above example, although to be fair, similar confusement can be had in today's out-of-tree solution). At some point things may become so confusing that we'd rather drop the feature instead.

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 12 of 21 in “Recording merges after repo conversion”
  1. Peter KarlssonOct 9, 2007
  2. Benoit SIGOUREOct 9, 2007
  3. Peter KarlssonOct 30, 2007
  4. Lars HjemliOct 30, 2007
  5. Peter KarlssonOct 30, 2007
  6. Lars HjemliOct 30, 2007
  7. Johannes SchindelinOct 31, 2007
  8. Peter KarlssonOct 31, 2007
  9. Johannes SchindelinOct 31, 2007
  10. Peter KarlssonOct 31, 2007
  11. Johannes SchindelinOct 31, 2007
  12. Johan HerlandOct 31, 2007
  13. Johannes SchindelinOct 31, 2007
  14. Johan HerlandOct 31, 2007
  15. Johannes SchindelinOct 31, 2007
  16. Johan HerlandOct 31, 2007
  17. Johannes SchindelinOct 31, 2007
  18. Linus TorvaldsOct 31, 2007
  19. Johan HerlandOct 31, 2007
  20. Johannes SchindelinOct 30, 2007
  21. Peter KarlssonOct 31, 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.