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

Re: [PATCH] revisions(7): clarify that most commands take a single revision range

From
Junio C Hamano <gitster@pobox.com>
Date
May 20, 2021, 05:02 UTC
Message-ID
<xmqqcztmuhem.fsf@gitster.g>
In-Reply-To
<xmqqh7iyuhlp.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 40 quoted lines
> Bagas Sanjaya <bagasdotme@gmail.com> writes:
>
>> On 18/05/21 18.17, Junio C Hamano wrote:
>>> ...
>>> +In other words, writing two "two-dot range notation" next to each
>>> +other, e.g.
>>> +
>>> +    $ git log A..B C..D
>>> +
>>> +does *not* specify two revision ranges for most commands.  Instead
>>> +it will name a single connected set of commits, i.e. those that are
>>> +reachable from either B or D but are reachable from neither A or C.
>>> +In a linear history like this:
>>> +
>>> +    ---A---B---o---o---C---D
>>> +
>>
>> So "git log A..B C..D" is same as "A..D", right?
>
> A..B C..D is equivalent to ^A ^C B D, and in order to be part of the
> set it represents, a commit must not be reachable from A, must not
> be reachable from C, and must be reachable from B or D.
>
> In the picture, A, B and two o's are all reachable from C, therefore
> are not part of the set A..B C..D represents.  Neither is C, as it
> is reachable from C.  That leaves only D in the resulting range.
>
> A..D is a set of connected five commits, B o o C D in the above
> picture.
>
> So, no.
>
> The confusion we often see goes more like "The set A..B contains B
> (and nothing else), and C..D contains D (and nothing else), hence
> 'git log A..B C..D' would show B and D".  But that is not what
> happens because "git log" (like most other commands) takes just a
> "range" that is "A..B C..D", which is a set of connected commits
> each of whose member is reachable from one of the "positive"
> endpoints (like B and D) and is not reachable from any of the
> "negative" endpoints (like A and C).

Well, apparently the proposed text may have failed to educate you about what a "revision range" is and how it works, so it is not good enough, so I'll postpone merging the change down further and see if somebody else can come up with a better description.

Thanks.
Previous: Junio C HamanoNext: Bagas Sanjaya
Message 4 of 9 in “revisions(7): clarify that most commands take a single revision range”
  1. revisions(7): clarify that most commands take a single revision rangeJunio C Hamano, May 18, 2021
  2. Bagas SanjayaMay 20, 2021
  3. Junio C HamanoMay 20, 2021
  4. Junio C HamanoMay 20, 2021
  5. Bagas SanjayaMay 20, 2021
  6. Elijah NewrenMay 20, 2021
  7. Eric SunshineMay 20, 2021
  8. Elijah NewrenMay 20, 2021
  9. Felipe ContrerasMay 21, 2021

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.