[PATCH v2 0/5] Doc git commit
- From
Jean-Noël Avila via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jan 15, 2025, 20:23 UTC
- Message-ID
- <pull.1845.v2.git.1736972628.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1845.git.1735912046.gitgitgadget@gmail.com>
This series continues the effort of rewriting the documentation with uniformization and better formatting of the man pages. This time, git-commit is processed, taking advantage of previous experiences.
Jean-Noël Avila (5): doc: apply new documentation guidelines to git commit doc: the mode param of -u of git commit is optional doc: make more direct explanations in git commit options doc: convert git commit config to new format doc: migrate git-commit manpage secondary files to new format
Documentation/config/commit.txt | 25 +-- Documentation/git-commit.txt | 281 +++++++++++++++---------------- Documentation/i18n.txt | 4 +- Documentation/signoff-option.txt | 8 +- builtin/commit.c | 2 +- 5 files changed, 161 insertions(+), 159 deletions(-)
base-commit: 1b4e9a5f8b5f048972c21fe8acafe0404096f694 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1845%2Fjnavila%2Fdoc_git-commit-v2 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1845/jnavila/doc_git-commit-v2 Pull-Request: https://github.com/gitgitgadget/git/pull/1845
Range-diff vs v1:
1: dfd907fc314 ! 1: 91cff84b5f8 doc: git-commit: apply new documentation guidelines
@@ Metadata
Author: Jean-Noël Avila <jn.avila@free.fr>
## Commit message ##
- doc: git-commit: apply new documentation guidelines
+ doc: apply new documentation guidelines to git commit
- The documentation for git-commit has been updated to follow the new
- documentation guidelines. The following changes have been applied to
- the series of patches:
-
- - switching the synopsis to a synopsis block which will automatically
+ - switch the synopsis to a synopsis block which will automatically
format placeholders in italics and keywords in monospace
- use _<placeholder>_ instead of <placeholder> in the description
- use `backticks for keywords and more complex option
descriptions`. The new rendering engine will apply synopsis rules to
these spans.
- Additionally, some option descriptions have been turned into
- imperative mood to make them more consistent with the rest of the
- documentation.
-
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
## Documentation/git-commit.txt ##
@@ Documentation/git-commit.txt: git-commit - Record changes to the repository
-[verse]
-'git commit' [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
+[synopsis]
-+git commit [-a | --interactive | --patch] [-s] [-v] [-u[<mode>]] [--amend]
++git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
[--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>]
@@ Documentation/git-commit.txt: summary of what is included by any of the above fo
-------
--a::
---all::
-- Tell the command to automatically stage files that have
+`-a`::
+`--all`::
-+ Automatically stage files that have
+ Tell the command to automatically stage files that have
been modified and deleted, but new files you have not
told Git about are not affected.
@@ Documentation/git-commit.txt: summary of what is included by any of the above fo
--F <file>::
---file=<file>::
-- Take the commit message from the given file. Use '-' to
+`-F <file>`::
+`--file=<file>`::
-+ Take the commit message from _<file>_. Use `-` to
+ Take the commit message from the given file. Use '-' to
read the message from the standard input.
---author=<author>::
@@ Documentation/git-commit.txt: summary of what is included by any of the above fo
--m <msg>::
---message=<msg>::
-- Use the given <msg> as the commit message.
+`-m <msg>`::
+`--message=<msg>`::
-+ Use _<msg>_ as the commit message.
+ Use the given <msg> as the commit message.
If multiple `-m` options are given, their values are
concatenated as separate paragraphs.
+
@@ Documentation/git-commit.txt: summary of what is included by any of the above fo
+`-t <file>`::
+`--template=<file>`::
When editing the commit message, start the editor with the
-- contents in the given file. The `commit.template` configuration
-+ contents in _<file>_. The `commit.template` configuration
+ contents in the given file. The `commit.template` configuration
variable is often used to give this option implicitly to the
- command. This mechanism can be used by projects that want to
- guide participants with some hints on what to write in the message
@@ Documentation/git-commit.txt: The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`.
include::signoff-option.txt[]
@@ Documentation/git-commit.txt: The `-m` option is mutually exclusive with `-c`, `
--n::
---[no-]verify::
-- By default, the pre-commit and commit-msg hooks are run.
-- When any of `--no-verify` or `-n` is given, these are bypassed.
+`-n`::
+`--[no-]verify`::
-+ Bypass the `pre-commit` and `commit-msg` hooks.
+ By default, the pre-commit and commit-msg hooks are run.
+ When any of `--no-verify` or `-n` is given, these are bypassed.
See also linkgit:githooks[5].
---allow-empty::
@@ Documentation/git-commit.txt: The `-m` option is mutually exclusive with `-c`, `
linkgit:git-commit-tree[1].
---cleanup=<mode>::
-- This option determines how the supplied commit message should be
+`--cleanup=<mode>`::
-+ Determine how the supplied commit message should be
+ This option determines how the supplied commit message should be
cleaned up before committing. The '<mode>' can be `strip`,
`whitespace`, `verbatim`, `scissors` or `default`.
+
@@ Documentation/git-commit.txt: default::
--e::
---edit::
-- The message taken from file with `-F`, command line with
-- `-m`, and from commit object with `-C` are usually used as
-- the commit log message unmodified. This option lets you
-- further edit the message taken from these sources.
+`-e`::
+`--edit`::
-+ Let the user further edit the message taken from file
-+ with `-F`, command line with `-m`, and from commit object
-+ with `-C` are usually used as the commit log message unmodified.
+ The message taken from file with `-F`, command line with
+ `-m`, and from commit object with `-C` are usually used as
+ the commit log message unmodified. This option lets you
+ further edit the message taken from these sources.
---no-edit::
+`--no-edit`::
@@ Documentation/git-commit.txt: include::i18n.txt[]
`VISUAL` environment variable, or the `EDITOR` environment variable (in that
order). See linkgit:git-var[1] for details.
-
- ## builtin/commit.c ##
-@@
- #include "trailer.h"
-
- static const char * const builtin_commit_usage[] = {
-- N_("git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
-+ N_("git commit [-a | --interactive | --patch] [-s] [-v] [-u[<mode>]] [--amend]\n"
- " [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>]\n"
- " [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
- " [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
-: ----------- > 2: d58526a9b39 doc: the mode param of -u of git commit is optional
-: ----------- > 3: 39db87ff906 doc: make more direct explanations in git commit options
2: 9f518ec8f9d ! 4: 9216554bd70 doc: git-commit.txt: convert git commit config to new format
@@ Metadata
Author: Jean-Noël Avila <jn.avila@free.fr>
## Commit message ##
- doc: git-commit.txt: convert git commit config to new format
+ doc: convert git commit config to new format
Also prevent git-commit manpage to refer to itself in the config
description by using a variable.
3: 9f8d4e74b7b ! 5: 28316a709da doc: git-commit: migrate secondary files to new format
@@ Metadata
Author: Jean-Noël Avila <jn.avila@free.fr>
## Commit message ##
- doc: git-commit: migrate secondary files to new format
+ doc: migrate git-commit manpage secondary files to new format
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
-- gitgitgadget