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

Re: Weird shallow-tree conversion state, and branches of shallow trees

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 16, 2007, 14:59 UTC
Message-ID
<Pine.LNX.4.64.0704160745040.5473@woody.linux-foundation.org>
In-Reply-To
<20070416021729.GH2689@curie-int.orbis-terrarum.net>
On Sun, 15 Apr 2007, Robin H. Johnson wrote:
Show 7 quoted lines
>
> Nobody has addressed the single problem that I have with adding it when
> it's leaving the environment, and that's still of paramount concern to
> me. Simply put, there is a conflict between being able to add revision
> information of stuff leaving the environment, and those additions
> breaking previous checksums (which may be digitally signed, and thus
> breaking the signatures).
Don't be silly. 

You can just checksum without the ID. Which you have to do with git anyway, since any expanded ID *itself* would be part of any ID, which means that under git, you *physically*cannot* make an ID string be part of the source control environment anyway, unless you did the SHA1 while ignoring the $Id$ expansion.

In other words, the problem you talk about exists *regardless*. You suggest pushing that problem into the SCM layer, and de-stabilizing the SCM and causing EVERYBODY ELSE provlems.

And I'm telling you that if you want the idiocy of keyword expansion, you can have it, BUT YOU CANNOT HAVE IT IN THE SCM.

Because *every* *single* problem you have with keyword expansion (whether it be checksums or anything else) will be MUCH MUCH worse if you do it at the SCM level!

Really. 

When you talk about your "single problem", why the HELL do you think that problem goes away just because you try to deal with it inside the SCM? Trust me, the problem does *not* go away, it gets *bigger*.

You're trying to push it into the SCM, because _you_ don't want to deal with the inevitable problems that keywords cause. But face it, the SCM wants to deal with them *even*less*, because they are much worse there, and more importantly, you'd be trying to push them into a level where most users have gotten over the braindamage and no longer want it!

So you're trying to make *everybody* suffer, just because you cannot do it right.

And suffer people do. There's a reason people are so negative about keyword expansion: we've _seen_ those problems first-hand.

So the proper solution is:
 - don't do keyword expansion on the "originals".
 - add release information when you do a release. 
 - if you want to sign releases, do so *after* the release. That's what a 
   release process is all about.
 - if you're so damn lazy that you can't be bothered to do the signing of 
   the release, don't ask others to do stupid things because *you* do 
   something stupid - just make sure that whatever release information you 
   add can be *removed*, so that you can verify an exact match.

For example, look at how "git archive" does this. It actually adds release information to the tar-file. It's hidden as a magic header, but that also means that since it's *separate* from the source code, it avoids all the problems with keyword expansion, and now you can (for example) diff the tar-ball source tree with the git tree, and you will not get spurious AND INCORRECT differences! And any checksums would still be valid!

And the same kind of thing can be done even if you absolutely have to embed the information on a file-by-file basis. Just make sure that you do it in some reversible manner. But preferably you generate a separate file (eg my hypothetical Makefile example that actually generates a "prt" file from a "svg" file) so that you have the original and can do any diff or validation efforts on *that*.

			Linus
Previous: Daniel BarkalowNext: Andy Parkins
Message 23 of 34 in “Weird shallow-tree conversion state, and branches of shallow trees”
  1. Robin H. JohnsonApr 12, 2007
  2. Johannes SchindelinApr 14, 2007
  3. Robin H. JohnsonApr 15, 2007
  4. David LangApr 15, 2007
  5. Robin H. JohnsonApr 15, 2007
  6. Shawn O. PearceApr 15, 2007
  7. Nguyen Thai Ngoc DuyApr 15, 2007
  8. Jakub NarebskiApr 15, 2007
  9. Linus TorvaldsApr 15, 2007
  10. Andy ParkinsApr 15, 2007
  11. Linus TorvaldsApr 15, 2007
  12. Bill LearApr 16, 2007
  13. Andy ParkinsApr 16, 2007
  14. Julian PhillipsApr 16, 2007
  15. Robin H. JohnsonApr 16, 2007
  16. Theodore TsoApr 16, 2007
  17. Nguyen Thai Ngoc DuyApr 16, 2007
  18. Linus TorvaldsApr 16, 2007
  19. Nguyen Thai Ngoc DuyApr 16, 2007
  20. Robin H. JohnsonApr 16, 2007
  21. Linus TorvaldsApr 16, 2007
  22. Daniel BarkalowApr 17, 2007
  23. Linus TorvaldsApr 16, 2007
  24. Andy ParkinsApr 16, 2007
  25. Sven VerdoolaegeApr 16, 2007
  26. Linus TorvaldsApr 16, 2007
  27. David LangApr 16, 2007
  28. David LangApr 17, 2007
  29. Andy ParkinsApr 17, 2007
  30. Junio C HamanoApr 16, 2007
  31. Andy ParkinsApr 16, 2007
  32. Junio C HamanoApr 17, 2007
  33. Andy ParkinsApr 17, 2007
  34. Robin H. JohnsonApr 15, 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.