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

Re: potential improvement to 'git log' with a range

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 11, 2010, 21:32 UTC
Message-ID
<m3tyrhfzg8.fsf@localhost.localdomain>
In-Reply-To
<alpine.LFD.2.00.1004091807220.3558@i5.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 13 quoted lines
> On Fri, 9 Apr 2010, Aghiles wrote:
> > 
> > Oh, I should have read the documentation. I was certain that ".." stands
> > for a range but it is a ... complement.
> 
> Well, technically ".." means two different things
> 
>  - for "set operations" (ie "git log" and friends) it's the "relative 
>    complement" of two sets (or "'reachable from A' \ 'reachable from B'").
> 
>  - for "edge operations" (ie "git diff" and friends) it's just two 
>    end-points (aka "range"). A diff doesn't work on sets, it only works on 
>    the two endpoints.
[...]
> Most SCM's really talk about "ranges". Once you think in those terms, 
> complex history doesn't work. Git very fundamentally is much about set 
> theory, and "ranges" is a bad word to use.

For example from I have got from asking on #mercurial IRC channel on FreeNode (a bit of self promotion: I have done this research to write an answer to "Git and Mercurial - Compare and Contrast" question on StackOverflow[1]), Mercurial implements its ".." equivalent in the term of _numeric range_, even for "hg log" (sic!). It turns revision identifiers used in range (-r <rev1>:<rev2>) to LOCAL number of revision, and generates range based on numeric range, IIRC inclusive on both sides (in Git range is exclusive from bottom, inclusive from top).

Which is plain useless for anything but linear subsets of history (compare e.g. "master..next", which in Git shows everything in "next" that is not in "master"; "master" and "next" are not direct descendants of one oanother, at least not usually).

[1] http://stackoverflow.com/questions/1598759/git-and-mercurial-compare-and-contrast/1599930#1599930
P.S. I wonder if Mercurial development list is subscribe-only...
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: AghilesNext: Martin Geisler
Message 8 of 18 in “potential improvement to 'git log' with a range”
  1. AghilesApr 9, 2010
  2. Santi BéjarApr 9, 2010
  3. Sverre RabbelierApr 9, 2010
  4. AghilesApr 10, 2010
  5. Sverre RabbelierApr 10, 2010
  6. Linus TorvaldsApr 10, 2010
  7. AghilesApr 11, 2010
  8. Jakub NarebskiApr 11, 2010
  9. Martin GeislerJun 23, 2010
  10. Jakub NarebskiJun 23, 2010
  11. Martin GeislerJun 23, 2010
  12. Jakub NarebskiJun 23, 2010
  13. Martin GeislerJun 23, 2010
  14. Jay SoffianJun 23, 2010
  15. Junio C HamanoJun 23, 2010
  16. Jay SoffianJun 23, 2010
  17. Junio C HamanoJun 24, 2010
  18. Jay SoffianJun 24, 2010

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.