Skip to content

Introduce more doc linting #1945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,26 @@ $(LINT_DOCS_FSCK_MSGIDS): ../fsck.h fsck-msgids.adoc
$(call mkdir_p_parent_template)
$(QUIET_GEN)$(PERL_PATH) lint-fsck-msgids.perl \
../fsck.h fsck-msgids.adoc $@

lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS)

## Lint: delimited sections
LINT_DOCS_DELIMITED_SECTIONS = $(patsubst %.adoc,.build/lint-docs/delimited-sections/%.ok,$(MAN_TXT))
$(LINT_DOCS_DELIMITED_SECTIONS): lint-delimited-sections.perl
$(LINT_DOCS_DELIMITED_SECTIONS): .build/lint-docs/delimited-sections/%.ok: %.adoc
$(call mkdir_p_parent_template)
$(QUIET_LINT_DELIMSEC)$(PERL_PATH) lint-delimited-sections.perl $< >$@
.PHONY: lint-docs-delimited-sections
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Ramsay Jones wrote (reply to this):

On 05/08/2025 20:10, Jean-Noël Avila via GitGitGadget wrote:
> From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>
> 
> Due to portability issues, the script generate-configlist.sh was fixed to
> not use carriage returns in the output. However, the result is that it no
> longer correctly handles multiple terms in a single entry of the definition
> list.
> 
> We now check that these entries do not exist in the documentation.
> 
> Signed-off-by: Jean-Noël Avila <[email protected]>
> ---
>  Documentation/Makefile                      | 10 +++++++++
>  Documentation/git-check-attr.adoc           |  3 ++-
>  Documentation/git-check-ignore.adoc         |  9 +++++---
>  Documentation/git-http-fetch.adoc           |  4 +++-
>  Documentation/lint-documentation-style.perl | 24 +++++++++++++++++++++
>  Documentation/technical/api-path-walk.adoc  |  5 ++++-
>  shared.mak                                  |  1 +
>  7 files changed, 50 insertions(+), 6 deletions(-)
>  create mode 100755 Documentation/lint-documentation-style.perl
> 
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 76a9e1d02b26..ac8a21e3015c 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -508,6 +508,15 @@ $(LINT_DOCS_DELIMITED_SECTIONS): .build/lint-docs/delimited-sections/%.ok: %.ado
>  .PHONY: lint-docs-delimited-sections
>  lint-docs-delimited-sections: $(LINT_DOCS_DELIMITED_SECTIONS)
>  
> +## Lint: Documentation style
> +LINT_DOCS_DOC_STYLE = $(patsubst %.adoc,.build/lint-docs/doc-style/%.ok,$(MAN_TXT))
> +$(LINT_DOCS_DOC_STYLE): lint-documentation-style.perl
> +$(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc
> +	$(call mkdir_p_parent_template)
> +	$(QUIET_LINT_DOCSTYLE)$(PERL_PATH) lint-documentation-style.perl $< >$@
> +.PHONY: lint-docs-doc-style
> +lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE)
> +
>  lint-docs-manpages:
>  	$(QUIET_GEN)./lint-manpages.sh
>  
> @@ -537,6 +546,7 @@ lint-docs: lint-docs-gitlink
>  lint-docs: lint-docs-man-end-blurb
>  lint-docs: lint-docs-man-section-order
>  lint-docs: lint-docs-delimited-sections
> +lint-docs: lint-docs-doc-style
>  lint-docs: lint-docs-manpages
>  lint-docs: lint-docs-meson
>  
> diff --git a/Documentation/git-check-attr.adoc b/Documentation/git-check-attr.adoc
> index 503b6446574d..15a37a38e3f7 100644
> --- a/Documentation/git-check-attr.adoc
> +++ b/Documentation/git-check-attr.adoc
> @@ -19,7 +19,8 @@ For every pathname, this command will list if each attribute is 'unspecified',
>  
>  OPTIONS
>  -------
> --a, --all::
> +-a::
> +--all::
>  	List all attributes that are associated with the specified
>  	paths.  If this option is used, then 'unspecified' attributes
>  	will not be included in the output.
> diff --git a/Documentation/git-check-ignore.adoc b/Documentation/git-check-ignore.adoc
> index 3e3b4e344629..a6c6c1b6e5be 100644
> --- a/Documentation/git-check-ignore.adoc
> +++ b/Documentation/git-check-ignore.adoc
> @@ -25,11 +25,13 @@ subject to exclude rules; but see `--no-index'.
>  
>  OPTIONS
>  -------
> --q, --quiet::
> +-q::
> +--quiet::
>  	Don't output anything, just set exit status.  This is only
>  	valid with a single pathname.
>  
> --v, --verbose::
> +-v::
> +--verbose::
>  	Instead of printing the paths that are excluded, for each path
>  	that matches an exclude pattern, print the exclude pattern
>  	together with the path.  (Matching an exclude pattern usually
> @@ -49,7 +51,8 @@ linkgit:gitignore[5].
>  	below).  If `--stdin` is also given, input paths are separated
>  	with a NUL character instead of a linefeed character.
>  
> --n, --non-matching::
> +-n::
> +--non-matching::
>  	Show given paths which don't match any pattern.  This only
>  	makes sense when `--verbose` is enabled, otherwise it would
>  	not be possible to distinguish between paths which match a
> diff --git a/Documentation/git-http-fetch.adoc b/Documentation/git-http-fetch.adoc
> index 4ec7c68d3b9e..dcb05890aefd 100644
> --- a/Documentation/git-http-fetch.adoc
> +++ b/Documentation/git-http-fetch.adoc
> @@ -25,8 +25,10 @@ commit-id::
>          Either the hash or the filename under [URL]/refs/ to
>          pull.
>  
> --a, -c, -t::
> +-a::-c::
> +-t::

s/-a::-c::/-a::
-c::/ ?

ATB,
Ramsay Jones

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Jean-Noël AVILA wrote (reply to this):

On Tuesday, 5 August 2025 22:30:23 CEST Ramsay Jones wrote:
> On 05/08/2025 20:10, Jean-Noël Avila via GitGitGadget wrote:
> > From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>
> > 
> > Due to portability issues, the script generate-configlist.sh was fixed to
> > not use carriage returns in the output. However, the result is that it no
> > longer correctly handles multiple terms in a single entry of the 
definition
> > list.
> > 
> > We now check that these entries do not exist in the documentation.
> > 
> > Signed-off-by: Jean-Noël Avila <[email protected]>
> > ---
> > 
> >  Documentation/Makefile                      | 10 +++++++++
> >  Documentation/git-check-attr.adoc           |  3 ++-
> >  Documentation/git-check-ignore.adoc         |  9 +++++---
> >  Documentation/git-http-fetch.adoc           |  4 +++-
> >  Documentation/lint-documentation-style.perl | 24 +++++++++++++++++++++
> >  Documentation/technical/api-path-walk.adoc  |  5 ++++-
> >  shared.mak                                  |  1 +
> >  7 files changed, 50 insertions(+), 6 deletions(-)
> >  create mode 100755 Documentation/lint-documentation-style.perl
> > 
> > diff --git a/Documentation/Makefile b/Documentation/Makefile
> > index 76a9e1d02b26..ac8a21e3015c 100644
> > --- a/Documentation/Makefile
> > +++ b/Documentation/Makefile
> > @@ -508,6 +508,15 @@ $(LINT_DOCS_DELIMITED_SECTIONS):
> > .build/lint-docs/delimited-sections/%.ok: %.ado> 
> >  .PHONY: lint-docs-delimited-sections
> >  lint-docs-delimited-sections: $(LINT_DOCS_DELIMITED_SECTIONS)
> > 
> > +## Lint: Documentation style
> > +LINT_DOCS_DOC_STYLE = $(patsubst
> > %.adoc,.build/lint-docs/doc-style/%.ok,$(MAN_TXT)) +$
(LINT_DOCS_DOC_STYLE):
> > lint-documentation-style.perl
> > +$(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc
> > +	$(call mkdir_p_parent_template)
> > +	$(QUIET_LINT_DOCSTYLE)$(PERL_PATH) lint-documentation-style.perl $< 
>$@
> > +.PHONY: lint-docs-doc-style
> > +lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE)
> > +
> > 
> >  lint-docs-manpages:
> >  	$(QUIET_GEN)./lint-manpages.sh
> > 
> > @@ -537,6 +546,7 @@ lint-docs: lint-docs-gitlink
> > 
> >  lint-docs: lint-docs-man-end-blurb
> >  lint-docs: lint-docs-man-section-order
> >  lint-docs: lint-docs-delimited-sections
> > 
> > +lint-docs: lint-docs-doc-style
> > 
> >  lint-docs: lint-docs-manpages
> >  lint-docs: lint-docs-meson
> > 
> > diff --git a/Documentation/git-check-attr.adoc
> > b/Documentation/git-check-attr.adoc
> > index 503b6446574d..15a37a38e3f7 100644
> > --- a/Documentation/git-check-attr.adoc
> > +++ b/Documentation/git-check-attr.adoc
> > @@ -19,7 +19,8 @@ For every pathname, this command will list if each 
attribute is
> > 'unspecified',> 
> >  OPTIONS
> >  -------
> > 
> > --a, --all::
> > +-a::
> > 
> > +--all::
> >  	List all attributes that are associated with the specified
> >  	paths.  If this option is used, then 'unspecified' attributes
> >  	will not be included in the output.
> > 
> > diff --git a/Documentation/git-check-ignore.adoc
> > b/Documentation/git-check-ignore.adoc index 3e3b4e344629..a6c6c1b6e5be 
100644
> > --- a/Documentation/git-check-ignore.adoc
> > +++ b/Documentation/git-check-ignore.adoc
> > @@ -25,11 +25,13 @@ subject to exclude rules; but see `--no-index'.
> > 
> >  OPTIONS
> >  -------
> > 
> > --q, --quiet::
> > +-q::
> > 
> > +--quiet::
> >  	Don't output anything, just set exit status.  This is only
> >  	valid with a single pathname.
> > 
> > --v, --verbose::
> > +-v::
> > 
> > +--verbose::
> >  	Instead of printing the paths that are excluded, for each path
> >  	that matches an exclude pattern, print the exclude pattern
> >  	together with the path.  (Matching an exclude pattern usually
> > 
> > @@ -49,7 +51,8 @@ linkgit:gitignore[5].
> > 
> >  	below).  If `--stdin` is also given, input paths are separated
> >  	with a NUL character instead of a linefeed character.
> > 
> > --n, --non-matching::
> > +-n::
> > 
> > +--non-matching::
> >  	Show given paths which don't match any pattern.  This only
> >  	makes sense when `--verbose` is enabled, otherwise it would
> >  	not be possible to distinguish between paths which match a
> > 
> > diff --git a/Documentation/git-http-fetch.adoc
> > b/Documentation/git-http-fetch.adoc
> > index 4ec7c68d3b9e..dcb05890aefd 100644
> > --- a/Documentation/git-http-fetch.adoc
> > +++ b/Documentation/git-http-fetch.adoc
> > 
> > @@ -25,8 +25,10 @@ commit-id::
> >          Either the hash or the filename under [URL]/refs/ to
> >          pull.
> > 
> > --a, -c, -t::
> > +-a::-c::
> 
> > +-t::
> s/-a::-c::/-a::
> -c::/ ?
> 
> ATB,
> Ramsay Jones

Yep, the newline is inserted too late.

Thank you for the review. Will reroll in a couple days.

Jean-Noël Avila


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Collin Funk wrote (reply to this):

Hi,

"Jean-Noël Avila via GitGitGadget" <[email protected]> writes:

> From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>
>
> Due to portability issues, the script generate-configlist.sh was fixed to
> not use carriage returns in the output. However, the result is that it no
> longer correctly handles multiple terms in a single entry of the definition
> list.
>
> We now check that these entries do not exist in the documentation.
>
> Signed-off-by: Jean-Noël Avila <[email protected]>
> ---
>  Documentation/Makefile                      | 10 +++++++++
>  Documentation/git-check-attr.adoc           |  3 ++-
>  Documentation/git-check-ignore.adoc         |  9 +++++---
>  Documentation/git-http-fetch.adoc           |  4 +++-
>  Documentation/lint-documentation-style.perl | 24 +++++++++++++++++++++
>  Documentation/technical/api-path-walk.adoc  |  5 ++++-
>  shared.mak                                  |  1 +
>  7 files changed, 50 insertions(+), 6 deletions(-)
>  create mode 100755 Documentation/lint-documentation-style.perl

I documented that this was the correct way to format them in
CodingGuidelines. At the time I commented that there were some places
that didn't follow this rule. Junio replied [1]:

> We are updating them gradually while avoiding collisions with
> patches that do other "real" work; see many recent patches to
> Documentation/config/ area by Jean-Noël Avila for more, e.g.
> d30c5cc4 (doc: convert git-mergetool options to new synopsis style,
> 2025-05-25).

As long as he is okay with the change, this looks good to me. It isn't
that many changes, so hopefully it is. :)

Small nit, but the issue was '\n' not being interpreted as a newline in
sed's s command. Mentioning carriage return makes me think of '\r'.

Reviewed-by: Collin Funk <[email protected]>

Collin

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Jean-Noël AVILA wrote (reply to this):

On Wednesday, 6 August 2025 03:02:04 CEST Collin Funk wrote:
> Hi,
> 
> "Jean-Noël Avila via GitGitGadget" <[email protected]> writes:
> > From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>
> > 
> > Due to portability issues, the script generate-configlist.sh was fixed to
> > not use carriage returns in the output. However, the result is that it no
> > longer correctly handles multiple terms in a single entry of the 
definition
> > list.
> > 
> > We now check that these entries do not exist in the documentation.
> > 
> > Signed-off-by: Jean-Noël Avila <[email protected]>
> > ---
> > 
> >  Documentation/Makefile                      | 10 +++++++++
> >  Documentation/git-check-attr.adoc           |  3 ++-
> >  Documentation/git-check-ignore.adoc         |  9 +++++---
> >  Documentation/git-http-fetch.adoc           |  4 +++-
> >  Documentation/lint-documentation-style.perl | 24 +++++++++++++++++++++
> >  Documentation/technical/api-path-walk.adoc  |  5 ++++-
> >  shared.mak                                  |  1 +
> >  7 files changed, 50 insertions(+), 6 deletions(-)
> >  create mode 100755 Documentation/lint-documentation-style.perl
> 
> I documented that this was the correct way to format them in
> CodingGuidelines. At the time I commented that there were some places
> 
> that didn't follow this rule. Junio replied [1]:
> > We are updating them gradually while avoiding collisions with
> > patches that do other "real" work; see many recent patches to
> > Documentation/config/ area by Jean-Noël Avila for more, e.g.
> > d30c5cc4 (doc: convert git-mergetool options to new synopsis style,
> > 2025-05-25).
> 
> As long as he is okay with the change, this looks good to me. It isn't
> that many changes, so hopefully it is. :)
> 
> Small nit, but the issue was '\n' not being interpreted as a newline in
> sed's s command. Mentioning carriage return makes me think of '\r'.
> 
> Reviewed-by: Collin Funk <[email protected]>
> 
> Collin

As a matter of fact, the script did not check config description files, but 
only root man pages. Will also push this change in the next iteration.

Thanks

Jean-Noël


lint-docs-delimited-sections: $(LINT_DOCS_DELIMITED_SECTIONS)

## Lint: Documentation style
LINT_DOCS_DOC_STYLE = $(patsubst %.adoc,.build/lint-docs/doc-style/%.ok,$(DOC_DEP_TXT))
$(LINT_DOCS_DOC_STYLE): lint-documentation-style.perl
$(LINT_DOCS_DOC_STYLE): .build/lint-docs/doc-style/%.ok: %.adoc
$(call mkdir_p_parent_template)
$(QUIET_LINT_DOCSTYLE)$(PERL_PATH) lint-documentation-style.perl $< >$@
.PHONY: lint-docs-doc-style
lint-docs-doc-style: $(LINT_DOCS_DOC_STYLE)

lint-docs-manpages:
$(QUIET_GEN)./lint-manpages.sh

Expand Down Expand Up @@ -528,6 +545,8 @@ lint-docs: lint-docs-fsck-msgids
lint-docs: lint-docs-gitlink
lint-docs: lint-docs-man-end-blurb
lint-docs: lint-docs-man-section-order
lint-docs: lint-docs-delimited-sections
lint-docs: lint-docs-doc-style
lint-docs: lint-docs-manpages
lint-docs: lint-docs-meson

Expand Down
1 change: 1 addition & 0 deletions Documentation/RelNotes/1.6.2.4.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ exec >/var/tmp/1
echo O=$(git describe maint)
O=v1.6.2.3-38-g318b847
git shortlog --no-merges $O..maint
---
3 changes: 2 additions & 1 deletion Documentation/blame-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ include::line-range-format.adoc[]
iso format is used. For supported values, see the discussion
of the --date option at linkgit:git-log[1].

--[no-]progress::
--progress::
--no-progress::
Progress status is reported on the standard error stream
by default when it is attached to a terminal. This flag
enables progress reporting even if not attached to a
Expand Down
1 change: 1 addition & 0 deletions Documentation/diff-format.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ if the file was renamed on any side of history. With
followed by the name of the path in the merge commit.

Examples for `-c` and `--cc` without `--combined-all-paths`:

------------------------------------------------
::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c
::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM bar.sh
Expand Down
3 changes: 2 additions & 1 deletion Documentation/diff-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ endif::git-format-patch[]
Turn off rename detection, even when the configuration
file gives the default to do so.

`--[no-]rename-empty`::
`--rename-empty`::
`--no-rename-empty`::
Whether to use empty blobs as rename source.

ifndef::git-format-patch[]
Expand Down
15 changes: 10 additions & 5 deletions Documentation/fetch-options.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--[no-]all::
--all::
--no-all::
Fetch all remotes, except for the ones that has the
`remote.<name>.skipFetchAll` configuration variable set.
This overrides the configuration variable fetch.all`.
Expand Down Expand Up @@ -88,7 +89,8 @@ This is incompatible with `--recurse-submodules=[yes|on-demand]` and takes
precedence over the `fetch.output` config option.

ifndef::git-pull[]
--[no-]write-fetch-head::
--write-fetch-head::
--no-write-fetch-head::
Write the list of remote refs fetched in the `FETCH_HEAD`
file directly under `$GIT_DIR`. This is the default.
Passing `--no-write-fetch-head` from the command line tells
Expand Down Expand Up @@ -118,13 +120,16 @@ ifndef::git-pull[]
Allow several <repository> and <group> arguments to be
specified. No <refspec>s may be specified.

--[no-]auto-maintenance::
--[no-]auto-gc::
--auto-maintenance::
--no-auto-maintenance::
--auto-gc::
--no-auto-gc::
Run `git maintenance run --auto` at the end to perform automatic
repository maintenance if needed. (`--[no-]auto-gc` is a synonym.)
This is enabled by default.

--[no-]write-commit-graph::
--write-commit-graph::
--no-write-commit-graph::
Write a commit-graph after fetching. This overrides the config
setting `fetch.writeCommitGraph`.
endif::git-pull[]
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git-am.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ OPTIONS
--keep-non-patch::
Pass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).

--[no-]keep-cr::
--keep-cr::
--no-keep-cr::
With `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1])
with the same option, to prevent it from stripping CR at the end of
lines. `am.keepcr` configuration variable can be used to specify the
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git-backfill.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ OPTIONS
blobs seen at a given path. The default minimum batch size is
50,000.

`--[no-]sparse`::
`--sparse`::
`--no-sparse`::
Only download objects if they appear at a path that matches the
current sparse-checkout. If the sparse-checkout feature is enabled,
then `--sparse` is assumed and can be disabled with `--no-sparse`.
Expand Down
6 changes: 4 additions & 2 deletions Documentation/git-cat-file.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ OPTIONS
or to ask for a "blob" with `<object>` being a tag object that
points at it.

--[no-]mailmap::
--[no-]use-mailmap::
--mailmap::
--no-mailmap::
--use-mailmap::
--no-use-mailmap::
Use mailmap file to map author, committer and tagger names
and email addresses to canonical real names and email addresses.
See linkgit:git-shortlog[1].
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git-check-attr.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ For every pathname, this command will list if each attribute is 'unspecified',

OPTIONS
-------
-a, --all::
-a::
--all::
List all attributes that are associated with the specified
paths. If this option is used, then 'unspecified' attributes
will not be included in the output.
Expand Down
9 changes: 6 additions & 3 deletions Documentation/git-check-ignore.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ subject to exclude rules; but see `--no-index'.

OPTIONS
-------
-q, --quiet::
-q::
--quiet::
Don't output anything, just set exit status. This is only
valid with a single pathname.

-v, --verbose::
-v::
--verbose::
Instead of printing the paths that are excluded, for each path
that matches an exclude pattern, print the exclude pattern
together with the path. (Matching an exclude pattern usually
Expand All @@ -49,7 +51,8 @@ linkgit:gitignore[5].
below). If `--stdin` is also given, input paths are separated
with a NUL character instead of a linefeed character.

-n, --non-matching::
-n::
--non-matching::
Show given paths which don't match any pattern. This only
makes sense when `--verbose` is enabled, otherwise it would
not be possible to distinguish between paths which match a
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git-check-ref-format.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ a branch.

OPTIONS
-------
--[no-]allow-onelevel::
--allow-onelevel::
--no-allow-onelevel::
Controls whether one-level refnames are accepted (i.e.,
refnames that do not contain multiple `/`-separated
components). The default is `--no-allow-onelevel`.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-checkout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ include::diff-context-options.adoc[]
separated with _NUL_ character and all other characters are taken
literally (including newlines and quotes).

<branch>::
`<branch>`::
Branch to checkout; if it refers to a branch (i.e., a name that,
when prepended with "refs/heads/", is a valid ref), then that
branch is checked out. Otherwise, if it refers to a valid
Expand Down
12 changes: 8 additions & 4 deletions Documentation/git-clone.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ corresponding `--mirror` and `--no-tags` options instead.
reachable from a specified remote branch or tag. This option
can be specified multiple times.

`--[no-]single-branch`::
`--single-branch`::
`--no-single-branch`::
Clone only the history leading to the tip of a single branch,
either specified by the `--branch` option or the primary
branch remote's `HEAD` points at.
Expand All @@ -282,7 +283,8 @@ corresponding `--mirror` and `--no-tags` options instead.
branch when `--single-branch` clone was made, no remote-tracking
branch is created.

`--[no-]tags`::
`--tags`::
`--no-tags`::
Control whether or not tags will be cloned. When `--no-tags` is
given, the option will be become permanent by setting the
`remote.<remote>.tagOpt=--no-tags` configuration. This ensures that
Expand Down Expand Up @@ -313,10 +315,12 @@ the clone is finished. This option is ignored if the cloned repository does
not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,
or `--mirror` is given)

`--[no-]shallow-submodules`::
`--shallow-submodules`::
`--no-shallow-submodules`::
All submodules which are cloned will be shallow with a depth of 1.

`--[no-]remote-submodules`::
`--remote-submodules`::
`--no-remote-submodules`::
All submodules which are cloned will use the status of the submodule's
remote-tracking branch to update the submodule, rather than the
superproject's recorded SHA-1. Equivalent to passing `--remote` to
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git-commit-graph.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ OPTIONS
object directory, `git commit-graph ...` will exit with non-zero
status.

--[no-]progress::
--progress::
--no-progress::
Turn progress on/off explicitly. If neither is specified, progress is
shown if standard error is connected to a terminal.

Expand Down
4 changes: 3 additions & 1 deletion Documentation/git-commit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ include::signoff-option.adoc[]
each trailer would appear, and other details.

`-n`::
`--[no-]verify`::
`--verify`::
`--no-verify`::
Bypass the `pre-commit` and `commit-msg` hooks.
See also linkgit:githooks[5].

Expand Down Expand Up @@ -281,6 +282,7 @@ variable (see linkgit:git-config[1]).
+
--
It is a rough equivalent for:

------
$ git reset --soft HEAD^
$ ... do something else to come up with the right tree ...
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ Valid `<type>`'s include:
When the color setting for `name` is undefined, the command uses
`color.ui` as fallback.

--[no-]includes::
--includes::
--no-includes::
Respect `include.*` directives in config files when looking up
values. Defaults to `off` when a specific file is given (e.g.,
using `--file`, `--global`, etc) and `on` when searching all
Expand Down
9 changes: 6 additions & 3 deletions Documentation/git-difftool.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ with custom merge tool commands and has the same value as `$MERGED`.
--tool-help::
Print a list of diff tools that may be used with `--tool`.

--[no-]symlinks::
--symlinks::
--no-symlinks::
'git difftool''s default behavior is to create symlinks to the
working tree when run in `--dir-diff` mode and the right-hand
side of the comparison yields the same content as the file in
Expand All @@ -94,7 +95,8 @@ instead. `--no-symlinks` is the default on Windows.
Additionally, `$BASE` is set in the environment.

-g::
--[no-]gui::
--gui::
--no-gui::
When 'git-difftool' is invoked with the `-g` or `--gui` option
the default diff tool will be read from the configured
`diff.guitool` variable instead of `diff.tool`. This may be
Expand All @@ -104,7 +106,8 @@ instead. `--no-symlinks` is the default on Windows.
fallback in the order of `merge.guitool`, `diff.tool`,
`merge.tool` until a tool is found.

--[no-]trust-exit-code::
--trust-exit-code::
--no-trust-exit-code::
Errors reported by the diff tool are ignored by default.
Use `--trust-exit-code` to make 'git-difftool' exit when an
invoked diff tool returns a non-zero exit code.
Expand Down
5 changes: 4 additions & 1 deletion Documentation/git-fast-import.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ Locations of Marks Files
Like --import-marks but instead of erroring out, silently
skips the file if it does not exist.

--[no-]relative-marks::
--relative-marks::
--no-relative-marks::
After specifying --relative-marks the paths specified
with --import-marks= and --export-marks= are relative
to an internal directory in the current repository.
Expand Down Expand Up @@ -605,9 +606,11 @@ Marks must be declared (via `mark`) before they can be used.

The special case of restarting an incremental import from the
current branch value should be written as:

----
from refs/heads/branch^0
----

The `^0` suffix is necessary as fast-import does not permit a branch to
start from itself, and the branch is created in memory before the
`from` command is even read from the input. Adding `^0` will force
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git-fmt-merge-msg.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ OPTIONS
Do not list one-line descriptions from the actual commits being
merged.

--[no-]summary::
--summary::
--no-summary::
Synonyms to --log and --no-log; these are deprecated and will be
removed in the future.

Expand Down
Loading
Loading