threads / patch / 63885

patchdocs: remove stray bracket from git-clone synopsis

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

## tl;dr

7 messages between Jul 31, 2025 and Aug 12, 2025. Diffs are folded; open one to read it.

replies: 6people: 3as markdown or json

Knut Harald Ryager via GitGitGadget· Jul 31, 2025, 14:46 UTC · lore
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(-)
Show changes to Documentation/git-clone.adoc +1 −1
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· Jul 31, 2025, 19:07 UTC · re: Knut Harald Ryager via GitGitGadget · lore

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

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

Show 7 quoted lines
> 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.
Show 26 quoted lines
> 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· Aug 10, 2025, 21:30 UTC · re: Knut Harald Ryager via GitGitGadget · lore

[PATCH v2] Remove the extra and incorrect closing bracket, so that the line reads:

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(-)
Show changes to Documentation/git-clone.adoc +1 −1
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· Aug 11, 2025, 06:14 UTC · re: Knut Harald Ryager via GitGitGadget · lore

Re: [PATCH v2] Remove the extra and incorrect closing bracket, so that the line reads:

On Sun, Aug 10, 2025, at 23:30, Knut Harald Ryager via GitGitGadget wrote:
Show 30 quoted lines
> 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]]
Show 5 quoted lines
>
>      -    The git-clone documentation contained an extra ‘]’ after
>      -    `--also-filter-submodules]`.
>      +        [--filter=<filter> [--also-filter-submodules]]
> ...
-- 
Kristoffer
Junio C Hamano· Aug 11, 2025, 16:07 UTC · re: Kristoffer Haugsbakk · lore

Re: [PATCH v2] Remove the extra and incorrect closing bracket, so that the line reads:

"Kristoffer Haugsbakk" <code@khaugsbakk.name> writes:
Show 12 quoted lines
> 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· Aug 11, 2025, 22:04 UTC · re: Knut Harald Ryager via GitGitGadget · lore

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

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(-)
Show changes to Documentation/git-clone.adoc +1 −1
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· Aug 12, 2025, 15:55 UTC · re: Knut Harald Ryager via GitGitGadget · lore

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

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

Show 16 quoted lines
> 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>

← back to recent threads