git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] rev-parse: documentation adjustment - mention remote tracking with @{u}
@ 2022-06-20  4:01 Tao Klerks via GitGitGadget
  2022-06-21 16:19 ` Junio C Hamano
  2022-06-23  5:01 ` [PATCH v2] " Tao Klerks via GitGitGadget
  0 siblings, 2 replies; 4+ messages in thread
From: Tao Klerks via GitGitGadget @ 2022-06-20  4:01 UTC (permalink / raw)
  To: git; +Cc: Tao Klerks, Tao Klerks

From: Tao Klerks <tao@klerks.biz>

The documentation explained the conversion from remote branch path to
local tracking ref path for @{push}, but not for @{upstream}.

Add the note to @{upstream}, and reference it in @{push} to avoid undue
repetition.

Signed-off-by: Tao Klerks <tao@klerks.biz>
---
    rev-parse: documentation adjustment - mention remote tracking with @{u}
    
    Small clarification in the doc for git rev-parse.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1265%2FTaoK%2Ftao-upstreak-doc-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1265/TaoK/tao-upstreak-doc-fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1265

 Documentation/revisions.txt | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index f5f17b65a12..33809036f04 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -97,18 +97,19 @@ some output processing may assume ref names in UTF-8.
 
 '[<branchname>]@\{upstream\}', e.g. 'master@\{upstream\}', '@\{u\}'::
   The suffix '@\{upstream\}' to a branchname (short form '<branchname>@\{u\}')
-  refers to the branch that the branch specified by branchname is set to build on
-  top of (configured with `branch.<name>.remote` and
-  `branch.<name>.merge`).  A missing branchname defaults to the
-  current one. These suffixes are also accepted when spelled in uppercase, and
-  they mean the same thing no matter the case.
+  refers to the remote branch that the branch specified by branchname
+  is set to build on top of (configured with `branch.<name>.remote` and
+  `branch.<name>.merge`). As `branch.<name>.merge` is the branch path on the
+  remote, it is first converted to a local tracking branch (i.e., something in
+  `refs/remotes/`). A missing branchname defaults to the current one. These
+  suffixes are also accepted when spelled in uppercase, and they mean the same
+  thing no matter the case.
 
 '[<branchname>]@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
   The suffix '@\{push}' reports the branch "where we would push to" if
   `git push` were run while `branchname` was checked out (or the current
-  `HEAD` if no branchname is specified). Since our push destination is
-  in a remote repository, of course, we report the local tracking branch
-  that corresponds to that branch (i.e., something in `refs/remotes/`).
+  `HEAD` if no branchname is specified). Like for '@\{upstream\}', we report
+  the local tracking branch that corresponds to that remote branch.
 +
 Here's an example to make it more clear:
 +

base-commit: 5b71c59bc3b9365075e2a175aa7b6f2b0c84ce44
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rev-parse: documentation adjustment - mention remote tracking with @{u}
  2022-06-20  4:01 [PATCH] rev-parse: documentation adjustment - mention remote tracking with @{u} Tao Klerks via GitGitGadget
@ 2022-06-21 16:19 ` Junio C Hamano
  2022-06-23  4:37   ` Tao Klerks
  2022-06-23  5:01 ` [PATCH v2] " Tao Klerks via GitGitGadget
  1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2022-06-21 16:19 UTC (permalink / raw)
  To: Tao Klerks via GitGitGadget; +Cc: git, Tao Klerks

"Tao Klerks via GitGitGadget" <gitgitgadget@gmail.com> writes:

>  '[<branchname>]@\{upstream\}', e.g. 'master@\{upstream\}', '@\{u\}'::
>    The suffix '@\{upstream\}' to a branchname (short form '<branchname>@\{u\}')
> -  refers to the branch that the branch specified by branchname is set to build on
> -  top of (configured with `branch.<name>.remote` and
> -  `branch.<name>.merge`).  A missing branchname defaults to the
> -  current one. These suffixes are also accepted when spelled in uppercase, and
> -  they mean the same thing no matter the case.
> +  refers to the remote branch that the branch specified by branchname
> +  is set to build on top of (configured with `branch.<name>.remote` and
> +  `branch.<name>.merge`).

Let's refrain from inventing confusing new phrases that are not
defined in "git help glossary".

What is a "remote branch"?  I think this is better left as "the
branch", to avoid confusion with remote-tracking branch we keep
locally.  I think a version with a slight tweak, e.g.

        ... refers to the name of the branch (configured with
        `branch.<name>.merge`) at the remote (configured with
        `branch.<name>.remote`) that the branch is set to build on
        top of.

would be OK, though.

> ... As `branch.<name>.merge` is the branch path on the
> +  remote, it is first converted to a local tracking branch (i.e., something in
> +  `refs/remotes/`).

Let's correct it to "remote-tracking branch".

But more importantly, the order of explanation feels a bit
backwards. Something like...

    A branch B may be set up to build on top of a branch X
    (configured with `branch.<name>.merge`) at a remote R
    (configured with `branch.<name>.remote`).  B@{u} refers to the
    remote-tracking branch for the branch X taken from remote R,
    typically found at `refs/remotes/R/X`.

... to cover both of the above, perhaps, may flow more naturally?

> ... A missing branchname defaults to the current one. These
> +  suffixes are also accepted when spelled in uppercase, and they mean the same
> +  thing no matter the case.

>  '[<branchname>]@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
>    The suffix '@\{push}' reports the branch "where we would push to" if
>    `git push` were run while `branchname` was checked out (or the current
> -  `HEAD` if no branchname is specified). Since our push destination is
> -  in a remote repository, of course, we report the local tracking branch
> -  that corresponds to that branch (i.e., something in `refs/remotes/`).
> +  `HEAD` if no branchname is specified). Like for '@\{upstream\}', we report
> +  the local tracking branch that corresponds to that remote branch.
>  +
>  Here's an example to make it more clear:
>  +
>
> base-commit: 5b71c59bc3b9365075e2a175aa7b6f2b0c84ce44

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rev-parse: documentation adjustment - mention remote tracking with @{u}
  2022-06-21 16:19 ` Junio C Hamano
@ 2022-06-23  4:37   ` Tao Klerks
  0 siblings, 0 replies; 4+ messages in thread
From: Tao Klerks @ 2022-06-23  4:37 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Tao Klerks via GitGitGadget, git

On Tue, Jun 21, 2022 at 6:19 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Tao Klerks via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > ... As `branch.<name>.merge` is the branch path on the
> > +  remote, it is first converted to a local tracking branch (i.e., something in
> > +  `refs/remotes/`).
>
> Let's correct it to "remote-tracking branch".
>
> But more importantly, the order of explanation feels a bit
> backwards. Something like...
>
>     A branch B may be set up to build on top of a branch X
>     (configured with `branch.<name>.merge`) at a remote R
>     (configured with `branch.<name>.remote`).  B@{u} refers to the
>     remote-tracking branch for the branch X taken from remote R,
>     typically found at `refs/remotes/R/X`.
>
> ... to cover both of the above, perhaps, may flow more naturally?
>

Looks great, thanks! I feel like a bit of a fraud signing my name to
it now, but the important thing is that's a much better improvement
than I proposed. Patch v2 coming.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] rev-parse: documentation adjustment - mention remote tracking with @{u}
  2022-06-20  4:01 [PATCH] rev-parse: documentation adjustment - mention remote tracking with @{u} Tao Klerks via GitGitGadget
  2022-06-21 16:19 ` Junio C Hamano
@ 2022-06-23  5:01 ` Tao Klerks via GitGitGadget
  1 sibling, 0 replies; 4+ messages in thread
From: Tao Klerks via GitGitGadget @ 2022-06-23  5:01 UTC (permalink / raw)
  To: git; +Cc: Tao Klerks, Tao Klerks, Tao Klerks

From: Tao Klerks <tao@klerks.biz>

The documentation explained the conversion from remote branch path to
local tracking ref path for @{push}, but not for @{upstream}.

Add the explanation to @{upstream}, and reference it in @{push} to avoid
undue repetition.

Signed-off-by: Tao Klerks <tao@klerks.biz>
---
    rev-parse: documentation adjustment - mention remote tracking with @{u}
    
    Small clarification in the doc for git rev-parse.
    
    Changes in V2:
    
     * Applied Junio's proposed simplification

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1265%2FTaoK%2Ftao-upstreak-doc-fix-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1265/TaoK/tao-upstreak-doc-fix-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1265

Range-diff vs v1:

 1:  58d2735d752 ! 1:  9e47e12e9cb rev-parse: documentation adjustment - mention remote tracking with @{u}
     @@ Commit message
          The documentation explained the conversion from remote branch path to
          local tracking ref path for @{push}, but not for @{upstream}.
      
     -    Add the note to @{upstream}, and reference it in @{push} to avoid undue
     -    repetition.
     +    Add the explanation to @{upstream}, and reference it in @{push} to avoid
     +    undue repetition.
      
          Signed-off-by: Tao Klerks <tao@klerks.biz>
      
       ## Documentation/revisions.txt ##
      @@ Documentation/revisions.txt: some output processing may assume ref names in UTF-8.
     +   before the current one.
       
       '[<branchname>]@\{upstream\}', e.g. 'master@\{upstream\}', '@\{u\}'::
     -   The suffix '@\{upstream\}' to a branchname (short form '<branchname>@\{u\}')
     +-  The suffix '@\{upstream\}' to a branchname (short form '<branchname>@\{u\}')
      -  refers to the branch that the branch specified by branchname is set to build on
      -  top of (configured with `branch.<name>.remote` and
      -  `branch.<name>.merge`).  A missing branchname defaults to the
      -  current one. These suffixes are also accepted when spelled in uppercase, and
      -  they mean the same thing no matter the case.
     -+  refers to the remote branch that the branch specified by branchname
     -+  is set to build on top of (configured with `branch.<name>.remote` and
     -+  `branch.<name>.merge`). As `branch.<name>.merge` is the branch path on the
     -+  remote, it is first converted to a local tracking branch (i.e., something in
     -+  `refs/remotes/`). A missing branchname defaults to the current one. These
     -+  suffixes are also accepted when spelled in uppercase, and they mean the same
     -+  thing no matter the case.
     ++  A branch B may be set up to build on top of a branch X (configured with
     ++  `branch.<name>.merge`) at a remote R (configured with
     ++  `branch.<name>.remote`). B@{u} refers to the remote-tracking branch for
     ++  the branch X taken from remote R, typically found at `refs/remotes/R/X`.
       
       '[<branchname>]@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
         The suffix '@\{push}' reports the branch "where we would push to" if
     @@ Documentation/revisions.txt: some output processing may assume ref names in UTF-
      -  in a remote repository, of course, we report the local tracking branch
      -  that corresponds to that branch (i.e., something in `refs/remotes/`).
      +  `HEAD` if no branchname is specified). Like for '@\{upstream\}', we report
     -+  the local tracking branch that corresponds to that remote branch.
     ++  the remote-tracking branch that corresponds to that branch at the remote.
       +
       Here's an example to make it more clear:
       +


 Documentation/revisions.txt | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index f5f17b65a12..7fcfbcbac7e 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -96,19 +96,16 @@ some output processing may assume ref names in UTF-8.
   before the current one.
 
 '[<branchname>]@\{upstream\}', e.g. 'master@\{upstream\}', '@\{u\}'::
-  The suffix '@\{upstream\}' to a branchname (short form '<branchname>@\{u\}')
-  refers to the branch that the branch specified by branchname is set to build on
-  top of (configured with `branch.<name>.remote` and
-  `branch.<name>.merge`).  A missing branchname defaults to the
-  current one. These suffixes are also accepted when spelled in uppercase, and
-  they mean the same thing no matter the case.
+  A branch B may be set up to build on top of a branch X (configured with
+  `branch.<name>.merge`) at a remote R (configured with
+  `branch.<name>.remote`). B@{u} refers to the remote-tracking branch for
+  the branch X taken from remote R, typically found at `refs/remotes/R/X`.
 
 '[<branchname>]@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
   The suffix '@\{push}' reports the branch "where we would push to" if
   `git push` were run while `branchname` was checked out (or the current
-  `HEAD` if no branchname is specified). Since our push destination is
-  in a remote repository, of course, we report the local tracking branch
-  that corresponds to that branch (i.e., something in `refs/remotes/`).
+  `HEAD` if no branchname is specified). Like for '@\{upstream\}', we report
+  the remote-tracking branch that corresponds to that branch at the remote.
 +
 Here's an example to make it more clear:
 +

base-commit: 5b71c59bc3b9365075e2a175aa7b6f2b0c84ce44
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-23  5:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20  4:01 [PATCH] rev-parse: documentation adjustment - mention remote tracking with @{u} Tao Klerks via GitGitGadget
2022-06-21 16:19 ` Junio C Hamano
2022-06-23  4:37   ` Tao Klerks
2022-06-23  5:01 ` [PATCH v2] " Tao Klerks via GitGitGadget

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).