Skip to content

Commit 33e8fc8

Browse files
committed
usage: do not insist that standard input must come from a file
The synopsys text and the usage string of subcommands that read list of things from the standard input are often shown like this: git gostak [--distim] < <list-of-doshes> This is problematic in a number of ways: * The way to use these commands is more often to feed them the output from another command, not feed them from a file. * Manual pages outside Git, commands that operate on the data read from the standard input, e.g "sort", "grep", "sed", etc., are not described with such a "< redirection-from-file" in their synopsys text. Our doing so introduces inconsistency. * We do not insist on where the output should go, by saying git gostak [--distim] < <list-of-doshes> > <output> * As it is our convention to enclose placeholders inside <braket>, the redirection operator followed by a placeholder filename becomes very hard to read, both in the documentation and in the help text. Let's clean them all up, after making sure that the documentation clearly describes the modes that take information from the standard input and what kind of things are expected on the input. [jc: stole example for fmt-merge-msg from Jonathan] Helped-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3c3d3f6 commit 33e8fc8

25 files changed

+64
-41
lines changed

Documentation/git-cat-file.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv ) <object>
13-
'git cat-file' (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>
13+
'git cat-file' (--batch | --batch-check) [--follow-symlinks]
1414

1515
DESCRIPTION
1616
-----------

Documentation/git-check-attr.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git check-attr' [-a | --all | attr...] [--] pathname...
13-
'git check-attr' --stdin [-z] [-a | --all | attr...] < <list-of-paths>
13+
'git check-attr' --stdin [-z] [-a | --all | attr...]
1414

1515
DESCRIPTION
1616
-----------
@@ -28,7 +28,8 @@ OPTIONS
2828
Consider `.gitattributes` in the index only, ignoring the working tree.
2929

3030
--stdin::
31-
Read file names from stdin instead of from the command-line.
31+
Read pathnames from the standard input, one per line,
32+
instead of from the command-line.
3233

3334
-z::
3435
The output format is modified to be machine-parseable.

Documentation/git-check-ignore.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git check-ignore' [options] pathname...
13-
'git check-ignore' [options] --stdin < <list-of-paths>
13+
'git check-ignore' [options] --stdin
1414

1515
DESCRIPTION
1616
-----------
@@ -35,7 +35,8 @@ OPTIONS
3535
for each given pathname.
3636

3737
--stdin::
38-
Read file names from stdin instead of from the command-line.
38+
Read pathnames from the standard input, one per line,
39+
instead of from the command-line.
3940

4041
-z::
4142
The output format is modified to be machine-parseable (see

Documentation/git-commit-tree.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-commit-tree - Create a new commit object
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git commit-tree' <tree> [(-p <parent>)...] < changelog
12+
'git commit-tree' <tree> [(-p <parent>)...]
1313
'git commit-tree' [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]
1414
[(-F <file>)...] <tree>
1515

Documentation/git-fmt-merge-msg.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-fmt-merge-msg - Produce a merge commit message
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] <$GIT_DIR/FETCH_HEAD
12+
'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log]
1313
'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] -F <file>
1414

1515
DESCRIPTION
@@ -57,6 +57,18 @@ merge.summary::
5757
Synonym to `merge.log`; this is deprecated and will be removed in
5858
the future.
5959

60+
EXAMPLE
61+
-------
62+
63+
--
64+
$ git fetch origin master
65+
$ git fmt-merge-msg --log <$GIT_DIR/FETCH_HEAD
66+
--
67+
68+
Print a log message describing a merge of the "master" branch from
69+
the "origin" remote.
70+
71+
6072
SEE ALSO
6173
--------
6274
linkgit:git-merge[1]

Documentation/git-get-tar-commit-id.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ git-get-tar-commit-id - Extract commit ID from an archive created using git-arch
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git get-tar-commit-id' < <tarfile>
12+
'git get-tar-commit-id'
1313

1414

1515
DESCRIPTION
1616
-----------
17-
Acts as a filter, extracting the commit ID stored in archives created by
18-
'git archive'. It reads only the first 1024 bytes of input, thus its
19-
runtime is not influenced by the size of <tarfile> very much.
17+
18+
Read a tar archive created by 'git archive' from the standard input
19+
and extract the commit ID stored in it. It reads only the first
20+
1024 bytes of input, thus its runtime is not influenced by the size
21+
of the tar archive very much.
2022

2123
If no commit ID is found, 'git get-tar-commit-id' quietly exists with a
22-
return code of 1. This can happen if <tarfile> had not been created
24+
return code of 1. This can happen if the archive had not been created
2325
using 'git archive' or if the first parameter of 'git archive' had been
2426
a tree ID instead of a commit ID or tag.
2527

Documentation/git-hash-object.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>...
13-
'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters] < <list-of-paths>
13+
'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
1414

1515
DESCRIPTION
1616
-----------
@@ -35,7 +35,8 @@ OPTIONS
3535
Read the object from standard input instead of from a file.
3636

3737
--stdin-paths::
38-
Read file names from stdin instead of from the command-line.
38+
Read file names from the standard input, one per line, instead
39+
of from the command-line.
3940

4041
--path::
4142
Hash object as it were located at the given path. The location of

Documentation/git-mktag.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-mktag - Creates a tag object
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git mktag' < signature_file
12+
'git mktag'
1313

1414
DESCRIPTION
1515
-----------
@@ -20,7 +20,8 @@ The output is the new tag's <object> identifier.
2020

2121
Tag Format
2222
----------
23-
A tag signature file has a very simple fixed format: four lines of
23+
A tag signature file, to be fed to this command's standard input,
24+
has a very simple fixed format: four lines of
2425

2526
object <sha1>
2627
type <typename>

Documentation/git-patch-id.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ git-patch-id - Compute unique ID for a patch
88
SYNOPSIS
99
--------
1010
[verse]
11-
'git patch-id' [--stable | --unstable] < <patch>
11+
'git patch-id' [--stable | --unstable]
1212

1313
DESCRIPTION
1414
-----------
15+
Read a patch from the standard input and compute the patch ID for it.
16+
1517
A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a
1618
patch, with whitespace and line numbers ignored. As such, it's "reasonably
1719
stable", but at the same time also reasonably unique, i.e., two patches that

Documentation/git-show-index.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ git-show-index - Show packed archive index
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git show-index' < idx-file
12+
'git show-index'
1313

1414

1515
DESCRIPTION
1616
-----------
17-
Reads given idx file for packed Git archive created with
18-
'git pack-objects' command, and dumps its contents.
17+
Read the idx file for a Git packfile created with
18+
'git pack-objects' command from the standard input, and
19+
dump its contents.
1920

2021
The information it outputs is subset of what you can get from
2122
'git verify-pack -v'; this command only shows the packfile

0 commit comments

Comments
 (0)