# [PATCH] docs: remove stray bracket from git-clone synopsis

7 messages from 2025-07-31 to 2025-08-12. Participants: Knut Harald Ryager via GitGitGadget, Junio C Hamano, Kristoffer Haugsbakk.
Thread: https://gitlist.dev/t/63885

## Knut Harald Ryager via GitGitGadget, 2025-07-31 14:46

Subject: [PATCH] docs: remove stray bracket from git-clone synopsis
Message-ID: <pull.2023.git.git.1753973177262.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.2023.git.git.1753973177262.gitgitgadget%40gmail.com

```
From: E-K-n <e-k-nut@hotmail.com>

The git-clone documentation contained an extra ‘]’ after
`--also-filter-submodules]`.

This patch removes the duplicate ‘]’ so that the line reads:

    [--also-filter-submodules] [--] <repository>

instead of:

    [--also-filter-submodules]] [--] <repository>

Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
---
    Remove excess right bracket from git-clone docs

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2023%2FKnutRyager%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2023/KnutRyager/master-v1
Pull-Request: https://github.com/git/git/pull/2023

 Documentation/git-clone.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-clone.adoc b/Documentation/git-clone.adoc
index 222d558290e..851502552f2 100644
--- a/Documentation/git-clone.adoc
+++ b/Documentation/git-clone.adoc
@@ -16,7 +16,7 @@ git clone [--template=<template-directory>]
 	  [--depth <depth>] [--[no-]single-branch] [--[no-]tags]
 	  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
 	  [--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow]
-	  [--filter=<filter-spec>] [--also-filter-submodules]] [--] <repository>
+	  [--filter=<filter-spec>] [--also-filter-submodules] [--] <repository>
 	  [<directory>]
 
 DESCRIPTION

base-commit: e813a0200a7121b97fec535f0d0b460b0a33356c
-- 
gitgitgadget

```

## Junio C Hamano, 2025-07-31 19:07

Subject: Re: [PATCH] docs: remove stray bracket from git-clone synopsis
Message-ID: <xmqqh5ysqivy.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqh5ysqivy.fsf%40gitster.g
In-Reply-To: <pull.2023.git.git.1753973177262.gitgitgadget@gmail.com>

```
"Knut Harald Ryager via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: E-K-n <e-k-nut@hotmail.com>

This should be updated to match the name you use on your sign-off
below.

> The git-clone documentation contained an extra ‘]’ after
> `--also-filter-submodules]`.

It is correct to point out that the brackets are not matching, but I
think the one that you are removing a wrong one.

When f05da2b4 (clone, submodule: pass partial clone filters to
submodules, 2022-02-04) added an option --also-filter-submodules to
the command, it wanted to express that the option is only valid when
the "--filter=<filter-spec>" option is also given.  And it did its
update correctly:

-         [--filter=<filter>] [--] <repository>
+         [--filter=<filter> [--also-filter-submodules]] [--] <repository>
 
Later, 76880f05 (doc: git-clone: apply new documentation formatting
guidelines, 2024-03-29) introduced the extra closing bracket after
"--filter=<filter>" to make these two look as if they are unrelated
and independent, i.e.

    [--filter=<filter>] [--also-filter-submodules]]

So, I think the one immediately after "--filter=<filter>" is what
you want to remove, not the one after "--also-filter-submodules".

> This patch removes the duplicate ‘]’ so that the line reads:
>
>     [--also-filter-submodules] [--] <repository>
>
> instead of:
>
>     [--also-filter-submodules]] [--] <repository>

We do not say "this patch does X" in our proposed log message.
Instead, you tell somebody sitting on the keyboard to "Do X".

IOW, something like

    Remove the extra and incorrect closing bracket, so that the line
    reads:

        [--filter=<filter> [--also-filter-submodules]]

    instead of

        [--filter=<filter>] [--also-filter-submodules]]

is how we write this.

> Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
> ---
>     Remove excess right bracket from git-clone docs
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2023%2FKnutRyager%2Fmaster-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2023/KnutRyager/master-v1
> Pull-Request: https://github.com/git/git/pull/2023
>
>  Documentation/git-clone.adoc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/git-clone.adoc b/Documentation/git-clone.adoc
> index 222d558290e..851502552f2 100644
> --- a/Documentation/git-clone.adoc
> +++ b/Documentation/git-clone.adoc
> @@ -16,7 +16,7 @@ git clone [--template=<template-directory>]
>  	  [--depth <depth>] [--[no-]single-branch] [--[no-]tags]
>  	  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
>  	  [--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow]
> -	  [--filter=<filter-spec>] [--also-filter-submodules]] [--] <repository>
> +	  [--filter=<filter-spec>] [--also-filter-submodules] [--] <repository>
>  	  [<directory>]
>  
>  DESCRIPTION
>
> base-commit: e813a0200a7121b97fec535f0d0b460b0a33356c

```

## Knut Harald Ryager via GitGitGadget, 2025-08-10 21:30

Subject: [PATCH v2] Remove the extra and incorrect closing bracket, so that the line reads:
Message-ID: <pull.2023.v2.git.git.1754861423787.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.2023.v2.git.git.1754861423787.gitgitgadget%40gmail.com
In-Reply-To: <pull.2023.git.git.1753973177262.gitgitgadget@gmail.com>

```
From: Knut Harald Ryager <e-k-nut@hotmail.com>

    [--filter=<filter> [--also-filter-submodules]]

instead of

    [--filter=<filter>] [--also-filter-submodules]]

Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
---
    Remove excess right bracket from git-clone docs

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2023%2FKnutRyager%2Fmaster-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2023/KnutRyager/master-v2
Pull-Request: https://github.com/git/git/pull/2023

Range-diff vs v1:

 1:  6bb5c653356 ! 1:  bb158425b8a docs: remove stray bracket from git-clone synopsis
     @@
       ## Metadata ##
     -Author: E-K-n <e-k-nut@hotmail.com>
     +Author: Knut Harald Ryager <e-k-nut@hotmail.com>
      
       ## Commit message ##
     -    docs: remove stray bracket from git-clone synopsis
     +    Remove the extra and incorrect closing bracket, so that the line reads:
      
     -    The git-clone documentation contained an extra ‘]’ after
     -    `--also-filter-submodules]`.
     +        [--filter=<filter> [--also-filter-submodules]]
      
     -    This patch removes the duplicate ‘]’ so that the line reads:
     +    instead of
      
     -        [--also-filter-submodules] [--] <repository>
     -
     -    instead of:
     -
     -        [--also-filter-submodules]] [--] <repository>
     +        [--filter=<filter>] [--also-filter-submodules]]
      
          Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
      
     @@ Documentation/git-clone.adoc: git clone [--template=<template-directory>]
       	  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
       	  [--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow]
      -	  [--filter=<filter-spec>] [--also-filter-submodules]] [--] <repository>
     -+	  [--filter=<filter-spec>] [--also-filter-submodules] [--] <repository>
     ++	  [--filter=<filter-spec> [--also-filter-submodules]] [--] <repository>
       	  [<directory>]
       
       DESCRIPTION


 Documentation/git-clone.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-clone.adoc b/Documentation/git-clone.adoc
index 222d558290e..d829206d1b5 100644
--- a/Documentation/git-clone.adoc
+++ b/Documentation/git-clone.adoc
@@ -16,7 +16,7 @@ git clone [--template=<template-directory>]
 	  [--depth <depth>] [--[no-]single-branch] [--[no-]tags]
 	  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
 	  [--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow]
-	  [--filter=<filter-spec>] [--also-filter-submodules]] [--] <repository>
+	  [--filter=<filter-spec> [--also-filter-submodules]] [--] <repository>
 	  [<directory>]
 
 DESCRIPTION

base-commit: e813a0200a7121b97fec535f0d0b460b0a33356c
-- 
gitgitgadget

```

## Kristoffer Haugsbakk, 2025-08-11 06:14

Subject: Re: [PATCH v2] Remove the extra and incorrect closing bracket, so that the line reads:
Message-ID: <a065e0cb-75e6-4836-9897-05089089367c@app.fastmail.com>
URL: https://gitlist.dev/e/a065e0cb-75e6-4836-9897-05089089367c%40app.fastmail.com
In-Reply-To: <pull.2023.v2.git.git.1754861423787.gitgitgadget@gmail.com>

```
On Sun, Aug 10, 2025, at 23:30, Knut Harald Ryager via GitGitGadget wrote:
> From: Knut Harald Ryager <e-k-nut@hotmail.com>
>
>     [--filter=<filter> [--also-filter-submodules]]
>
> instead of
>
>     [--filter=<filter>] [--also-filter-submodules]]
>
> Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
> ---
>     Remove excess right bracket from git-clone docs
>
> Published-As:
> https://github.com/gitgitgadget/git/releases/tag/pr-git-2023%2FKnutRyager%2Fmaster-v2
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git
> pr-git-2023/KnutRyager/master-v2
> Pull-Request: https://github.com/git/git/pull/2023
>
> Range-diff vs v1:
>
>  1:  6bb5c653356 ! 1:  bb158425b8a docs: remove stray bracket from
> git-clone synopsis
>      @@
>        ## Metadata ##
>      -Author: E-K-n <e-k-nut@hotmail.com>
>      +Author: Knut Harald Ryager <e-k-nut@hotmail.com>
>
>        ## Commit message ##
>      -    docs: remove stray bracket from git-clone synopsis
>      +    Remove the extra and incorrect closing bracket, so that the line reads:

It looks like you accidentally deleted the nice subject line

    docs: remove stray bracket from git-clone synopsis

When rewriting the commit message with Junio’s suggestion.  Which made
what was supposed to be the first line of the first paragraph into the
subject line.

I think you want this:

    docs: remove stray bracket from git-clone synopsis

    Remove the extra and incorrect closing bracket, so that the line
    reads:

        [--filter=<filter> [--also-filter-submodules]]

    instead of

        [--filter=<filter>] [--also-filter-submodules]]

>
>      -    The git-clone documentation contained an extra ‘]’ after
>      -    `--also-filter-submodules]`.
>      +        [--filter=<filter> [--also-filter-submodules]]
> ...

-- 
Kristoffer


```

## Junio C Hamano, 2025-08-11 16:07

Subject: Re: [PATCH v2] Remove the extra and incorrect closing bracket, so that the line reads:
Message-ID: <xmqqms853kpu.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqms853kpu.fsf%40gitster.g
In-Reply-To: <a065e0cb-75e6-4836-9897-05089089367c@app.fastmail.com>

```
"Kristoffer Haugsbakk" <code@khaugsbakk.name> writes:

> I think you want this:
>
>     docs: remove stray bracket from git-clone synopsis
>
>     Remove the extra and incorrect closing bracket, so that the line
>     reads:
>
>         [--filter=<filter> [--also-filter-submodules]]
>
>     instead of
>
>         [--filter=<filter>] [--also-filter-submodules]]

As even the author of this patch was once confused, I think 
the reason why this plausible change

          [--filter=<filter>] [--also-filter-submodules]

is not a correct fix should also be in the proposed log message to
help readers.


```

## Knut Harald Ryager via GitGitGadget, 2025-08-11 22:04

Subject: [PATCH v3] docs: remove stray bracket from git-clone synopsis
Message-ID: <pull.2023.v3.git.git.1754949872593.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.2023.v3.git.git.1754949872593.gitgitgadget%40gmail.com
In-Reply-To: <pull.2023.v2.git.git.1754861423787.gitgitgadget@gmail.com>

```
From: Knut Harald Ryager <e-k-nut@hotmail.com>

Remove the extra and incorrect closing bracket, so that the line reads:

    [--filter=<filter> [--also-filter-submodules]]

instead of

    [--filter=<filter>] [--also-filter-submodules]]

Note: Both filter options were grouped when --also-filter-submodules
was added by commit f05da2b4. The extra bracket was added
later by commit 76880f05.

Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
---
    Remove excess right bracket from git-clone docs
    
    cc: "Kristoffer Haugsbakk" code@khaugsbakk.name

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2023%2FKnutRyager%2Fmaster-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2023/KnutRyager/master-v3
Pull-Request: https://github.com/git/git/pull/2023

Range-diff vs v2:

 1:  bb158425b8a ! 1:  c1a167a16fd Remove the extra and incorrect closing bracket, so that the line reads:
     @@ Metadata
      Author: Knut Harald Ryager <e-k-nut@hotmail.com>
      
       ## Commit message ##
     +    docs: remove stray bracket from git-clone synopsis
     +
          Remove the extra and incorrect closing bracket, so that the line reads:
      
              [--filter=<filter> [--also-filter-submodules]]
     @@ Commit message
      
              [--filter=<filter>] [--also-filter-submodules]]
      
     +    Note: Both filter options were grouped when --also-filter-submodules
     +    was added by commit f05da2b4. The extra bracket was added
     +    later by commit 76880f05.
     +
          Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
      
       ## Documentation/git-clone.adoc ##


 Documentation/git-clone.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-clone.adoc b/Documentation/git-clone.adoc
index 222d558290e..d829206d1b5 100644
--- a/Documentation/git-clone.adoc
+++ b/Documentation/git-clone.adoc
@@ -16,7 +16,7 @@ git clone [--template=<template-directory>]
 	  [--depth <depth>] [--[no-]single-branch] [--[no-]tags]
 	  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
 	  [--[no-]remote-submodules] [--jobs <n>] [--sparse] [--[no-]reject-shallow]
-	  [--filter=<filter-spec>] [--also-filter-submodules]] [--] <repository>
+	  [--filter=<filter-spec> [--also-filter-submodules]] [--] <repository>
 	  [<directory>]
 
 DESCRIPTION

base-commit: e813a0200a7121b97fec535f0d0b460b0a33356c
-- 
gitgitgadget

```

## Junio C Hamano, 2025-08-12 15:55

Subject: Re: [PATCH v3] docs: remove stray bracket from git-clone synopsis
Message-ID: <xmqqms84v8jy.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqms84v8jy.fsf%40gitster.g
In-Reply-To: <pull.2023.v3.git.git.1754949872593.gitgitgadget@gmail.com>

```
"Knut Harald Ryager via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Knut Harald Ryager <e-k-nut@hotmail.com>
>
> Remove the extra and incorrect closing bracket, so that the line reads:
>
>     [--filter=<filter> [--also-filter-submodules]]
>
> instead of
>
>     [--filter=<filter>] [--also-filter-submodules]]
>
> Note: Both filter options were grouped when --also-filter-submodules
> was added by commit f05da2b4. The extra bracket was added
> later by commit 76880f05.
>
> Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
> ---

Thanks.  Let me rewrite the proposed log message thusly:

--- >8 ---
Subject: docs: remove stray bracket from git-clone synopsis

The synopsis section has an extra closing bracket, like this:

    [--filter=<filter>] [--also-filter-submodules]]

The extra one is not the one at the end of this line; it is the one
after "...=<filter>".

The "--also-filter-submodules" option was added by f05da2b4 (clone,
submodule: pass partial clone filters to submodules, 2022-02-04).
Because it makes sense only when used with the "--filter=<filter>"
option, these two options are enclosed in a pair of brackets.  The
extra one was added by 76880f05 (doc: git-clone: apply new
documentation formatting guidelines, 2024-03-29) by mistake.

Remove the extra and incorrect closing bracket, so that the line
reads:

    [--filter=<filter> [--also-filter-submodules]]

Signed-off-by: Knut Harald Ryager <e-k-nut@hotmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

```
