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
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 21, 2021, 19:19 UTC
Message-ID
<60a807b82f6aa_558062081c@natae.notmuch>
In-Reply-To
<xmqqv97g2svd.fsf@gitster.g>
Junio C Hamano wrote:
> +Commands that are specifically designed to take two distinct ranges
> +(e.g. "git range-diff R1 R2" to compare two ranges) do exist, but
> +they are exceptions.  Unless otherwise noted, all "git" commands
Not sure why "git" is in quotes.
Show 15 quoted lines
> +that operate on a set of commits work on a single revision range.
> +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
> +
> +because A and B are reachable from C, the revision range specified
> +by these two dotted ranges is a single commit D.
  For example, if you have a linear history like this:
    ---A---B---C---D---E---F
  Doing A..F will retrieve 5 commits, and doing B..E will retrieve 3
  commits, but doing A..F B..E will not retrieve 8 commits. Instead the
  starting point A gets overriden by B, and the ending point of E by F,
  effectively becoming B..F.
  With more complex graphs the result is not so simple and might result
  in two disconnected sets of commits, but that is considered a single
  revision range.
-- 
Felipe Contreras
Previous: Elijah Newren
Message 9 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.