git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Unbalanced closing paren in help of git commit

From
Tomas Nordin <tomasn@posteo.net>
Date
Jul 21, 2024, 12:21 UTC
Message-ID
<871q3nx7f3.fsf@posteo.net>
In-Reply-To
<xmqqcynnejwl.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 26 quoted lines
> Tomas Nordin <tomasn@posteo.net> writes:
>
>> Hello List
>>
>> The second line of the help message for git commit looks like this:
>
> This seems to have come from 00ea64ed (doc/git-commit: add
> documentation for fixup=[amend|reword] options, 2021-03-15),
> if "git blame" is to be trusted.
>
>>     [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]
>
> We can have --dry-run but we do not have to, we can have only one of
>
>     "-c <commit>"
>     "-C <commit>",
>     "--squash <commit>",
>     "--fixup amend:<commit>"
>     "--fixup reword:<commit>", or
>     "--fixup <commit>"
>
> as they are mutually exclusive, but it is OK if we have none of
> them.
>
> The last closing parenthesis after <commit> but before the closing
> square bracket is unwanted, I think, as you pointed out.

So then I make an attempt to provide a patch to remove that closing parenthesis. Please tell if it should be done differently somehow. The patch was done on top of maint.

From 5da052f43b119949c0ac0c7c3047542bc7474c17 Mon Sep 17 00:00:00 2001
From: Tomas Nordin <tomasn@posteo.net>
Date: Sun, 21 Jul 2024 13:16:50 +0200
Subject: [PATCH] doc: remove dangling closing parenthesis
* Documentation/git-commit.txt:
  The second line of the synopsis, starting with [--dry-run] has a
  dangling closing paren in the second optional group. Probably added by
  misstake, so remove it.
Signed-off-by: Tomas Nordin <tomasn@posteo.net>
---
 Documentation/git-commit.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 89ecfc63a8..c822113c11 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -9,7 +9,7 @@ SYNOPSIS
 --------
 [verse]
 'git commit' [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
-	   [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]
+	   [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>]
 	   [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
 	   [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
 	   [--date=<date>] [--cleanup=<mode>] [--[no-]status]
-- 
2.39.2
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “Unbalanced closing paren in help of git commit”
  1. Tomas NordinJul 7, 2024
  2. Jeff KingJul 8, 2024
  3. Tomas NordinJul 8, 2024
  4. Jeff KingJul 8, 2024
  5. Junio C HamanoJul 8, 2024
  6. Tomas NordinJul 21, 2024
  7. Junio C HamanoJul 22, 2024
  8. Tomas NordinJul 22, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.