threads / discuss / 59044

Did config `branch.<name>.fetch` ever exist?

Subject: Did config `branch.<name>.fetch` ever exist?

## tl;dr

7 messages between Jan 7, 2023 and Jan 14, 2023.

replies: 6people: 2as markdown or json

muzimuzhi Z· Jan 7, 2023, 17:34 UTC · lore
Hi all,
(originally posted on stackoverflow: https://stackoverflow.com/q/75040372)

Git configuration `branch.<name>.fetch` is mentioned in the first `git-fetch` example [1]:

> - Update the remote-tracking branches:
>       $ git fetch origin
>   The above command copies all branches from the remote refs/heads/ namespace and stores them to the local refs/remotes/origin/ namespace, unless the branch..fetch option is used to specify a non-default refspec.

But I can't find its doc in `git-config`'s doc. Did `branch.<name>.fetch` ever exist?

Searching in `git-config`'s doc for configs starting with `branch.` or ending with `.fetch`, it seems `branch.<name>.fetch` is a typo of `remote.<name>.fetch`.

PS: That `git-fetch` example was added in commit d504f69 in 2009. [3]

[1] https://git-scm.com/docs/git-fetch#_examples [2] https://git-scm.com/docs/git-config [3] https://github.com/git/git/commit/d504f6975d34025ed3b5478b657789410b52cdb1

best regards, Yukai Chou

Junio C Hamano· Jan 8, 2023, 04:35 UTC · re: muzimuzhi Z · lore

Re: Did config `branch.<name>.fetch` ever exist?

muzimuzhi Z <muzimuzhi@gmail.com> writes:
Show 16 quoted lines
> Git configuration `branch.<name>.fetch` is mentioned in the first
> `git-fetch` example [1]:
>
>> - Update the remote-tracking branches:
>>       $ git fetch origin
>>   The above command copies all branches from the remote
>>   refs/heads/ namespace and stores them to the local
>>   refs/remotes/origin/ namespace, unless the branch.<name>.fetch
>>   option is used to specify a non-default refspec.
>
> But I can't find its doc in `git-config`'s doc. Did
> `branch.<name>.fetch` ever exist?
>
> Searching in `git-config`'s doc for configs starting with `branch.` or
> ending with `.fetch`, it seems `branch.<name>.fetch` is a typo of
> `remote.<name>.fetch`.
Correct.  Care to send a patch to correct it?
Thanks.
muzimuzhi Z· Jan 9, 2023, 04:18 UTC · re: Junio C Hamano · lore

[PATCH] doc: fix non-existing config name

Replace non-existent `branch.<name>.fetch` to `remote.<repository>.fetch`, in the first example in `git-fetch` doc, which was introduced in d504f69 (modernize fetch/merge/pull examples, 2009-10-21).

Rename placeholder `<name>` to `<repository>`, to be consistent with all other uses in git docs, except that `git-config.txt` uses `remote.<name>.fetch` in its "Variables" section.

Also add missing monospace markups.
Signed-off-by: muzimuzhi <muzimuzhi@gmail.com>
---
 Documentation/git-fetch.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
index 63d9569..fba66f1 100644
--- a/Documentation/git-fetch.txt
+++ b/Documentation/git-fetch.txt
@@ -251,10 +251,10 @@ EXAMPLES
 $ git fetch origin
 ------------------------------------------------
 +
-The above command copies all branches from the remote refs/heads/
-namespace and stores them to the local refs/remotes/origin/ namespace,
-unless the branch.<name>.fetch option is used to specify a non-default
-refspec.
+The above command copies all branches from the remote `refs/heads/`
+namespace and stores them to the local `refs/remotes/origin/` namespace,
+unless the `remote.<repository>.fetch` option is used to specify a
+non-default refspec.

 * Using refspecs explicitly:
 +
-- 
2.39.0
muzimuzhi Z· Jan 9, 2023, 21:38 UTC · re: muzimuzhi Z · lore

Re: [PATCH] doc: fix non-existing config name

Somehow My last mail failed to sent to Clemens Buchacher (drizzd@aon.at):
> 550 5.7.1 <drizzd@aon.at>: Recipient address rejected: mailbox not found

I found two lines about Clemens in `.mailmap` (see below) [1] and drizzd@gmx.net was used last time when Clemens mailed to the current mailing list in Feb 2019 [2].

    Clemens Buchacher <drizzd@gmx.net> <drizzd@aon.at>
    Clemens Buchacher <drizzd@gmx.net> <clemens.buchacher@intel.com>
Thus I added drizzd@gmx.net to cc.
yukai

[1] https://github.com/git/git/blob/a38d39a4c50d1275833aba54c4dbdfce9e2e9ca1/.mailmap#L45-L46 [2] https://lore.kernel.org/git/B168DCB1-7A69-4729-89C7-B513464DD468@gmx.net/

muzimuzhi Z <muzimuzhi@gmail.com> 于2023年1月9日周一 12:18写道:
Show 37 quoted lines
>
> Replace non-existent `branch.<name>.fetch` to `remote.<repository>.fetch`, in
> the first example in `git-fetch` doc, which was introduced in
> d504f69 (modernize fetch/merge/pull examples, 2009-10-21).
>
> Rename placeholder `<name>` to `<repository>`, to be consistent with all other
> uses in git docs, except that `git-config.txt` uses `remote.<name>.fetch` in
> its "Variables" section.
>
> Also add missing monospace markups.
>
> Signed-off-by: muzimuzhi <muzimuzhi@gmail.com>
> ---
>  Documentation/git-fetch.txt | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
> index 63d9569..fba66f1 100644
> --- a/Documentation/git-fetch.txt
> +++ b/Documentation/git-fetch.txt
> @@ -251,10 +251,10 @@ EXAMPLES
>  $ git fetch origin
>  ------------------------------------------------
>  +
> -The above command copies all branches from the remote refs/heads/
> -namespace and stores them to the local refs/remotes/origin/ namespace,
> -unless the branch.<name>.fetch option is used to specify a non-default
> -refspec.
> +The above command copies all branches from the remote `refs/heads/`
> +namespace and stores them to the local `refs/remotes/origin/` namespace,
> +unless the `remote.<repository>.fetch` option is used to specify a
> +non-default refspec.
>
>  * Using refspecs explicitly:
>  +
> --
> 2.39.0
Junio C Hamano· Jan 13, 2023, 17:54 UTC · re: muzimuzhi Z · lore

Re: [PATCH] doc: fix non-existing config name

muzimuzhi Z <muzimuzhi@gmail.com> writes:
Show 12 quoted lines
> Somehow My last mail failed to sent to Clemens Buchacher (drizzd@aon.at):
>
>> 550 5.7.1 <drizzd@aon.at>: Recipient address rejected: mailbox not found
>
> I found two lines about Clemens in `.mailmap` (see below) [1] and
> drizzd@gmx.net was used last time when Clemens mailed to the current
> mailing list in Feb 2019 [2].
>
>     Clemens Buchacher <drizzd@gmx.net> <drizzd@aon.at>
>     Clemens Buchacher <drizzd@gmx.net> <clemens.buchacher@intel.com>
>
> Thus I added drizzd@gmx.net to cc.
Thanks for the above explanation.
> yukai

Is that your name, or is it "muzimuzhi Z"? Please see and follow Documentation/SubmittingPatches:[[sign-off]] and [[real-name]] sections.

The patch, including the proposed log message, looks excellent.
Thanks.
Show 36 quoted lines
>> Replace non-existent `branch.<name>.fetch` to `remote.<repository>.fetch`, in
>> the first example in `git-fetch` doc, which was introduced in
>> d504f69 (modernize fetch/merge/pull examples, 2009-10-21).
>>
>> Rename placeholder `<name>` to `<repository>`, to be consistent with all other
>> uses in git docs, except that `git-config.txt` uses `remote.<name>.fetch` in
>> its "Variables" section.
>>
>> Also add missing monospace markups.
>>
>> Signed-off-by: muzimuzhi <muzimuzhi@gmail.com>
>> ---
>>  Documentation/git-fetch.txt | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
>> index 63d9569..fba66f1 100644
>> --- a/Documentation/git-fetch.txt
>> +++ b/Documentation/git-fetch.txt
>> @@ -251,10 +251,10 @@ EXAMPLES
>>  $ git fetch origin
>>  ------------------------------------------------
>>  +
>> -The above command copies all branches from the remote refs/heads/
>> -namespace and stores them to the local refs/remotes/origin/ namespace,
>> -unless the branch.<name>.fetch option is used to specify a non-default
>> -refspec.
>> +The above command copies all branches from the remote `refs/heads/`
>> +namespace and stores them to the local `refs/remotes/origin/` namespace,
>> +unless the `remote.<repository>.fetch` option is used to specify a
>> +non-default refspec.
>>
>>  * Using refspecs explicitly:
>>  +
>> --
>> 2.39.0
muzimuzhi Z· Jan 14, 2023, 01:12 UTC · re: Junio C Hamano · lore

[PATCH v2] doc: fix non-existent config name

From c879cb10f61afc361c484267f498d5815bc1b932 Mon Sep 17 00:00:00 2001
From: muzimuzhi <muzimuzhi@gmail.com>
Date: Mon, 9 Jan 2023 06:37:47 +0800
Subject: [PATCH v2] doc: fix non-existent config name

Replace non-existent `branch.<name>.fetch` to `remote.<repository>.fetch`, in the first example in `git-fetch` doc, which was introduced in d504f6975d (modernize fetch/merge/pull examples, 2009-10-21).

Rename placeholder `<name>` to `<repository>`, to be consistent with all other uses in git docs, except that `git-config.txt` uses `remote.<name>.fetch` in its "Variables" section.

Also add missing monospace markups.
Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
---
Changes compared to PATCH v1:
 - Use real name in sign-off
 - Update commit reference in a non-shallow clone, resulting in longer
   <abbrev-hash>
 - Use word "non-existent" in commit message uniformly
 - Rebase to latest master a38d39a4c5 (The sixth batch, 2023-01-08)
 Documentation/git-fetch.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
index 63d9569e16..fba66f1460 100644
--- a/Documentation/git-fetch.txt
+++ b/Documentation/git-fetch.txt
@@ -251,10 +251,10 @@ EXAMPLES
 $ git fetch origin
 ------------------------------------------------
 +
-The above command copies all branches from the remote refs/heads/
-namespace and stores them to the local refs/remotes/origin/ namespace,
-unless the branch.<name>.fetch option is used to specify a non-default
-refspec.
+The above command copies all branches from the remote `refs/heads/`
+namespace and stores them to the local `refs/remotes/origin/` namespace,
+unless the `remote.<repository>.fetch` option is used to specify a
+non-default refspec.

 * Using refspecs explicitly:
 +
-- 
2.39.0
Junio C Hamano· Jan 14, 2023, 01:33 UTC · re: muzimuzhi Z · lore

Re: [PATCH v2] doc: fix non-existent config name

muzimuzhi Z <muzimuzhi@gmail.com> writes:
> From c879cb10f61afc361c484267f498d5815bc1b932 Mon Sep 17 00:00:00 2001
> From: muzimuzhi <muzimuzhi@gmail.com>

The "author identity" is taken from this line (or from the e-mail header), and it should be identical to your sign-off.

> Date: Mon, 9 Jan 2023 06:37:47 +0800
> Subject: [PATCH v2] doc: fix non-existent config name

In general, there shouldn't be a reason to include the above four lines in your message body. An exception is "From:" to override the author identity when you cannot send your e-mail using the same name as what is used on your sign-off. See Discussion section of "git am" manual page.

Show 11 quoted lines
> Replace non-existent `branch.<name>.fetch` to `remote.<repository>.fetch`, in
> the first example in `git-fetch` doc, which was introduced in
> d504f6975d (modernize fetch/merge/pull examples, 2009-10-21).
>
> Rename placeholder `<name>` to `<repository>`, to be consistent with all other
> uses in git docs, except that `git-config.txt` uses `remote.<name>.fetch` in
> its "Variables" section.
>
> Also add missing monospace markups.
>
> Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
Perfect.  Will queue.
> Changes compared to PATCH v1:
>  - Update commit reference in a non-shallow clone, resulting in longer
>    <abbrev-hash>
Great.
Show 19 quoted lines
> diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
> index 63d9569e16..fba66f1460 100644
> --- a/Documentation/git-fetch.txt
> +++ b/Documentation/git-fetch.txt
> @@ -251,10 +251,10 @@ EXAMPLES
>  $ git fetch origin
>  ------------------------------------------------
>  +
> -The above command copies all branches from the remote refs/heads/
> -namespace and stores them to the local refs/remotes/origin/ namespace,
> -unless the branch.<name>.fetch option is used to specify a non-default
> -refspec.
> +The above command copies all branches from the remote `refs/heads/`
> +namespace and stores them to the local `refs/remotes/origin/` namespace,
> +unless the `remote.<repository>.fetch` option is used to specify a
> +non-default refspec.
>
>  * Using refspecs explicitly:
>  +

← back to recent threads