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

7 messages from 2023-01-07 to 2023-01-14. Participants: muzimuzhi Z, Junio C Hamano.
Thread: https://gitlist.dev/t/59044

## muzimuzhi Z, 2023-01-07 17:34

Subject: Did config `branch.<name>.fetch` ever exist?
Message-ID: <CAEg0tHSLyaewkgGs0dEXfwQhKmbiO65bXZVU8t7Kn4WwJ1p0Fw@mail.gmail.com>
URL: https://gitlist.dev/e/CAEg0tHSLyaewkgGs0dEXfwQhKmbiO65bXZVU8t7Kn4WwJ1p0Fw%40mail.gmail.com

```
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, 2023-01-08 04:35

Subject: Re: Did config `branch.<name>.fetch` ever exist?
Message-ID: <xmqqfsclzlqx.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqfsclzlqx.fsf%40gitster.g
In-Reply-To: <CAEg0tHSLyaewkgGs0dEXfwQhKmbiO65bXZVU8t7Kn4WwJ1p0Fw@mail.gmail.com>

```
muzimuzhi Z <muzimuzhi@gmail.com> writes:

> 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, 2023-01-09 04:18

Subject: [PATCH] doc: fix non-existing config name
Message-ID: <CAEg0tHT5PD4K89E3fcNq_WbaLPHozLi-PsJFDsQrzkGi7Na9jg@mail.gmail.com>
URL: https://gitlist.dev/e/CAEg0tHT5PD4K89E3fcNq_WbaLPHozLi-PsJFDsQrzkGi7Na9jg%40mail.gmail.com
In-Reply-To: <xmqqfsclzlqx.fsf@gitster.g>

```
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, 2023-01-09 21:38

Subject: Re: [PATCH] doc: fix non-existing config name
Message-ID: <CAEg0tHQtf9G0N24Xfe-gvRM1AFaiS_ApcuQ8hZtsZAeMhhVWAQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAEg0tHQtf9G0N24Xfe-gvRM1AFaiS_ApcuQ8hZtsZAeMhhVWAQ%40mail.gmail.com
In-Reply-To: <CAEg0tHT5PD4K89E3fcNq_WbaLPHozLi-PsJFDsQrzkGi7Na9jg@mail.gmail.com>

```
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写道：
>
> 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, 2023-01-13 17:54

Subject: Re: [PATCH] doc: fix non-existing config name
Message-ID: <xmqqo7r248x9.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqo7r248x9.fsf%40gitster.g
In-Reply-To: <CAEg0tHQtf9G0N24Xfe-gvRM1AFaiS_ApcuQ8hZtsZAeMhhVWAQ@mail.gmail.com>

```
muzimuzhi Z <muzimuzhi@gmail.com> writes:

> 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.

>> 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, 2023-01-14 01:12

Subject: [PATCH v2] doc: fix non-existent config name
Message-ID: <CAEg0tHSZi22RUBREJB=Cfy6O72cicv9FTkgo_Z=gvGRdPK1acw@mail.gmail.com>
URL: https://gitlist.dev/e/CAEg0tHSZi22RUBREJB%3DCfy6O72cicv9FTkgo_Z%3DgvGRdPK1acw%40mail.gmail.com
In-Reply-To: <xmqqo7r248x9.fsf@gitster.g>

```
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, 2023-01-14 01:33

Subject: Re: [PATCH v2] doc: fix non-existent config name
Message-ID: <xmqqedrxoq7n.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqedrxoq7n.fsf%40gitster.g
In-Reply-To: <CAEg0tHSZi22RUBREJB=Cfy6O72cicv9FTkgo_Z=gvGRdPK1acw@mail.gmail.com>

```
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.

> 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.

> 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:
>  +

```
