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

Re: multiple-commit cherry-pick?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Nov 14, 2008, 16:11 UTC
Message-ID
<alpine.LFD.2.00.0811140800540.3468@nehalem.linux-foundation.org>
In-Reply-To
<20081114050822.GA23963@foursquare.net>
On Fri, 14 Nov 2008, Chris Frey wrote:
> 
> Would it be possible to add "range" support to a subset of commands by
> using a git-range wrapper?

It would be better to just extend the SHA-1 arithmetic. We could do it, no problem. It's just a SMOP.

For example, right now the arithmetic is entirely "flat", with no precedence, no nesting, nothing but a single level of set operations. We could extend it to be hierarchical.

So we _could_ do something like
	git log {a..b} {c..d ^e}

and just declare that { $args } is a self-contained "subset", and effectively becomes the same thing as "$(git rev-list $args)" but with magic no-walking semantics (ie all walking is done only _within_ the { }, not between different groups.

You literally _can_ do it right now that way:
	git log --no-walk $(git rev-list HEAD~5..HEAD~3) $(git rev-list HEAD~1..)

actually works, but that will hit argument size limits on many platforms really quickly.

So we could make a '{ }' in the argument space basically do a SHA1 expansion of the range inside, and imply --no-walk. It's _not_ entirely trivial, because we'd need to handle the fact that object flags are sticky, and clear them in between invocations of multiple ranges, but it's not _fundmanetally_ difficult. It's just that somebody would need to do it.

		Linus
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 22 of 31 in “multiple-commit cherry-pick?”
  1. Miles BaderNov 6, 2008
  2. Deskin MillerNov 6, 2008
  3. Björn SteinbrinkNov 6, 2008
  4. Miles BaderNov 6, 2008
  5. Björn SteinbrinkNov 6, 2008
  6. Miles BaderNov 7, 2008
  7. Björn SteinbrinkNov 7, 2008
  8. Miles BaderNov 7, 2008
  9. Alex RiesenNov 6, 2008
  10. Linus TorvaldsNov 7, 2008
  11. Miles BaderNov 7, 2008
  12. Alex RiesenNov 7, 2008
  13. Junio C HamanoNov 7, 2008
  14. Alex RiesenNov 7, 2008
  15. Linus TorvaldsNov 7, 2008
  16. Alex RiesenNov 9, 2008
  17. Johannes SchindelinNov 10, 2008
  18. Alex RiesenNov 10, 2008
  19. Johannes SchindelinNov 10, 2008
  20. Chris FreyNov 14, 2008
  21. Johannes SchindelinNov 14, 2008
  22. Linus TorvaldsNov 14, 2008
  23. Johannes SchindelinNov 14, 2008
  24. Junio C HamanoNov 14, 2008
  25. Linus TorvaldsNov 14, 2008
  26. Linus TorvaldsNov 14, 2008
  27. Pierre HabouzitNov 16, 2008
  28. Francis GaliegueNov 14, 2008
  29. Junio C HamanoNov 10, 2008
  30. Johannes SchindelinNov 10, 2008
  31. Michael RadziejNov 7, 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.