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

Re: [PATCH] Change 'Deltifying objects' to 'Delta compressing objects'

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Oct 19, 2007, 21:57 UTC
Message-ID
<alpine.LFD.0.999.0710191446440.26902@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.0.999.0710191157560.26902@woody.linux-foundation.org>
On Fri, 19 Oct 2007, Linus Torvalds wrote:
> 
> Could be done, but I almost think it would be better to just make the 
> sha1_name.c interfaces take some extended data structure which allows 
> looking up multiple SHA1's at the same time.

Btw, I knew I had wanted this in the past, but I had forgotten why. I now remembered.

The thing is, sometimes you want an expression for "all the parents of X". We don't have that, and again, the current internal implementation of sha1_name.c makes it essentially impossible to do within that interface (ie you can do it on *top* of that interface in revision.c, but it cannot be a general SHA1 expression).

So wouldn't it be nice to have a "commit^*" expression to go with "commit^" and "commit^2" etc? One that would name all the parents. It's useful, for example, for saying that you still want to see that commit, but not any of its parents:

	git log commit^*..

could basically work to show that commit (and all subsequent commits), but not the commits leading up to it. Right now, you can't easily say that in the git "sha1 expression algebra".

There are some other cases where you'd like to have things expand to more than one commit. We currently do those with special flags, like --all, but in many ways it would be really nice to be able to do SHA1 operations on them. If we were to make the SHA1 arithmetic able to handle multiple SHA1's (instead of just one), I could see us being able to do things like

	git diff {master,pu}:Makefile
as a way of saying
	git diff master:Makefile pu:Makefile

which already works - simply because we could make the ":name" be able to operate on multiple commit SHA1's and turn them into multiple blob (or tree) SHA1's.

(The above may not sound very useful, but
	git diff {ORIG_HEAD...MERGE_HEAD}:file

would essentially expand to "base version of file", ORIG_HEAD:file and MERGE_HEAD:file, and we could fairly easily teach diff to do a nice three-way diff for things like this! So it does have potential to be a reasonably powerful model)

			Linus
Previous: Linus TorvaldsNext: Shawn O. Pearce
Message 23 of 38 in “Change 'Deltifying objects' to 'Delta compressing objects'”
  1. Change 'Deltifying objects' to 'Delta compressing objects'Shawn O. Pearce, Oct 19, 2007
  2. Jeff KingOct 19, 2007
  3. Sam VilainOct 19, 2007
  4. David SymondsOct 19, 2007
  5. Shawn O. PearceOct 19, 2007
  6. Nicolas PitreOct 19, 2007
  7. Jeff KingOct 19, 2007
  8. Sam VilainOct 19, 2007
  9. Jeff KingOct 19, 2007
  10. Shawn O. PearceOct 19, 2007
  11. Jeff KingOct 19, 2007
  12. Shawn O. PearceOct 19, 2007
  13. Nicolas PitreOct 19, 2007
  14. Jeff KingOct 19, 2007
  15. Nicolas PitreOct 19, 2007
  16. Jeff KingOct 19, 2007
  17. Nicolas PitreOct 19, 2007
  18. Jeff KingOct 19, 2007
  19. Linus TorvaldsOct 19, 2007
  20. Jeff KingOct 19, 2007
  21. Nicolas PitreOct 19, 2007
  22. Linus TorvaldsOct 19, 2007
  23. Linus TorvaldsOct 19, 2007
  24. Shawn O. PearceOct 19, 2007
  25. Shawn O. PearceOct 19, 2007
  26. Stop displaying "Pack pack-$ID created." during git-gcShawn O. Pearce, Oct 19, 2007
  27. Nicolas PitreOct 19, 2007
  28. Shawn O. PearceOct 19, 2007
  29. Nicolas PitreOct 19, 2007
  30. Jeff KingOct 19, 2007
  31. Shawn O. PearceOct 19, 2007
  32. Nicolas PitreOct 19, 2007
  33. Wincent ColaiutaOct 19, 2007
  34. Nicolas PitreOct 19, 2007
  35. Jeff KingOct 19, 2007
  36. Nicolas PitreOct 19, 2007
  37. Jeff KingOct 19, 2007
  38. Nicolas PitreOct 19, 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.