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

Re: [PATCH] doc: revisions: improve single range explanation

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Jun 13, 2021, 02:50 UTC
Message-ID
<4067f10f-067f-6475-8305-2e10631388c6@gmail.com>
In-Reply-To
<20210613004434.10278-1-felipe.contreras@gmail.com>
Hi,
On 13/06/21 07.44, Felipe Contreras wrote:
Show 37 quoted lines
> The original explanation didn't seem clear enough to some people.
> 
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>   Documentation/revisions.txt | 22 +++++++++++-----------
>   1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
> index f5f17b65a1..d8cf512686 100644
> --- a/Documentation/revisions.txt
> +++ b/Documentation/revisions.txt
> @@ -299,22 +299,22 @@ empty range that is both reachable and unreachable from HEAD.
>   
>   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
> +they are exceptions.  Unless otherwise noted, all git commands
>   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
> +For example, if you have a linear history like this:
>   
> -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---C---D---E---F
>   
> -    ---A---B---o---o---C---D
> +Doing A..F will retrieve 5 commits, and doing B..E will retrieve 3
> +commits, but doing A..F B..E will not retrieve two revision ranges
> +totalling 8 commits. Instead the starting point A gets overriden by B,
> +and the ending point of E by F, effectively becoming B..F, a single
> +revision range.
> 

AFAIK, A..F means all commits from A to F. But in case of branched history like

     ---A---B---C---G---H---I <- main
                \
                 ---D---E---F <- mybranch

the notation main..mybranch means all commits that are reachable from mybranch but not from main, but the opposite (mybranch..main) means the opposite!

So basically the right-hand side of two dot notation specifies from what commit I want to select the range, and the left-hand side specifies the commit which I don't want to reach.

-- 
An old man doll... just what I always wanted! - Clara
Previous: Felipe ContrerasNext: Felipe Contreras
Message 2 of 11 in “doc: revisions: improve single range explanation”
  1. doc: revisions: improve single range explanationFelipe Contreras, Jun 13, 2021
  2. Bagas SanjayaJun 13, 2021
  3. Felipe ContrerasJun 13, 2021
  4. Eric SunshineJun 13, 2021
  5. Felipe ContrerasJun 13, 2021
  6. Elijah NewrenJun 13, 2021
  7. Felipe ContrerasJun 13, 2021
  8. Elijah NewrenJun 14, 2021
  9. Felipe ContrerasJun 15, 2021
  10. Eric SunshineJun 13, 2021
  11. Felipe ContrerasJun 13, 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.