usage: do not insist that standard input must come from a file
PATCH 1/1 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.
---
* It is very likely that I missed some commands, as I worked from a list of files that showed hits from this:
$ perl -e '
while (<>) {
if (/^SYNOPSIS/../^DESCRIPTION/) {
my $bra = ($_ =~ y/</</);
my $ket = ($_ =~ y/>/>/);
if ($bra != $ket) {
print "$_\n";
}
}
}' Documentation/*.txt An unrelated tangent, but we may want to turn show-index.c to a built-in (or perhaps deprecate and remove it).
Documentation/git-cat-file.txt | 2 +- Documentation/git-check-attr.txt | 4 ++-- Documentation/git-check-ignore.txt | 2 +- Documentation/git-commit-tree.txt | 2 +- Documentation/git-fmt-merge-msg.txt | 2 +- Documentation/git-get-tar-commit-id.txt | 12 +++++++----- Documentation/git-hash-object.txt | 2 +- Documentation/git-mktag.txt | 5 +++-- Documentation/git-patch-id.txt | 4 +++- Documentation/git-show-index.txt | 7 ++++--- Documentation/git-show-ref.txt | 2 +- Documentation/git-stripspace.txt | 9 +++++---- Documentation/git-unpack-objects.txt | 2 +- builtin/cat-file.c | 2 +- builtin/check-attr.c | 2 +- builtin/check-ignore.c | 2 +- builtin/commit-tree.c | 2 +- builtin/get-tar-commit-id.c | 2 +- builtin/hash-object.c | 2 +- builtin/mktag.c | 2 +- builtin/patch-id.c | 2 +- builtin/show-ref.c | 2 +- builtin/stripspace.c | 4 ++-- builtin/unpack-objects.c | 2 +- show-index.c | 2 +- 25 files changed, 44 insertions(+), 37 deletions(-)
Documentation/git-cat-file.txt +1 -1
@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv ) <object> -'git cat-file' (--batch | --batch-check) [--follow-symlinks] < <list-of-objects> +'git cat-file' (--batch | --batch-check) [--follow-symlinks] DESCRIPTION -----------
Documentation/git-check-attr.txt +2 -2
@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git check-attr' [-a | --all | attr...] [--] pathname... -'git check-attr' --stdin [-z] [-a | --all | attr...] < <list-of-paths> +'git check-attr' --stdin [-z] [-a | --all | attr...] DESCRIPTION -----------
@@ -28,7 +28,7 @@ OPTIONS Consider `.gitattributes` in the index only, ignoring the working tree. --stdin:: - Read file names from stdin instead of from the command-line. + Read pathnames from stdin instead of from the command-line. -z:: The output format is modified to be machine-parseable.
Documentation/git-check-ignore.txt +1 -1
@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git check-ignore' [options] pathname... -'git check-ignore' [options] --stdin < <list-of-paths> +'git check-ignore' [options] --stdin DESCRIPTION -----------
Documentation/git-commit-tree.txt +1 -1
@@ -9,7 +9,7 @@ git-commit-tree - Create a new commit object SYNOPSIS -------- [verse] -'git commit-tree' <tree> [(-p <parent>)...] < changelog +'git commit-tree' <tree> [(-p <parent>)...] 'git commit-tree' [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] [(-F <file>)...] <tree>
Documentation/git-fmt-merge-msg.txt +1 -1
@@ -9,7 +9,7 @@ git-fmt-merge-msg - Produce a merge commit message SYNOPSIS -------- [verse] -'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] <$GIT_DIR/FETCH_HEAD +'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] 'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] -F <file> DESCRIPTION
Documentation/git-get-tar-commit-id.txt +7 -5
@@ -9,17 +9,19 @@ git-get-tar-commit-id - Extract commit ID from an archive created using git-arch SYNOPSIS -------- [verse] -'git get-tar-commit-id' < <tarfile> +'git get-tar-commit-id' DESCRIPTION ----------- -Acts as a filter, extracting the commit ID stored in archives created by -'git archive'. It reads only the first 1024 bytes of input, thus its -runtime is not influenced by the size of <tarfile> very much. + +Read an archive created by 'git archive' from the standard input and +extracts the commit ID stored in it. It reads only the first 1024 +bytes of input, thus its runtime is not influenced by the size of +the archive very much. If no commit ID is found, 'git get-tar-commit-id' quietly exists with a -return code of 1. This can happen if <tarfile> had not been created +return code of 1. This can happen if the archive had not been created using 'git archive' or if the first parameter of 'git archive' had been a tree ID instead of a commit ID or tag.
Documentation/git-hash-object.txt +1 -1
@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>... -'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters] < <list-of-paths> +'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters] DESCRIPTION -----------
Documentation/git-mktag.txt +3 -2
@@ -9,7 +9,7 @@ git-mktag - Creates a tag object SYNOPSIS -------- [verse] -'git mktag' < signature_file +'git mktag' DESCRIPTION -----------
@@ -20,7 +20,8 @@ The output is the new tag's <object> identifier. Tag Format ---------- -A tag signature file has a very simple fixed format: four lines of +A tag signature file, to be fed from the standard input, has a +very simple fixed format: four lines of object <sha1> type <typename>
Documentation/git-patch-id.txt +3 -1
@@ -8,10 +8,12 @@ git-patch-id - Compute unique ID for a patch SYNOPSIS -------- [verse] -'git patch-id' [--stable | --unstable] < <patch> +'git patch-id' [--stable | --unstable] DESCRIPTION ----------- +Read a patch from the standard input, and compute the patch ID for it. + A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with whitespace and line numbers ignored. As such, it's "reasonably stable", but at the same time also reasonably unique, i.e., two patches that
Documentation/git-show-index.txt +4 -3
@@ -9,13 +9,14 @@ git-show-index - Show packed archive index SYNOPSIS -------- [verse] -'git show-index' < idx-file +'git show-index' DESCRIPTION ----------- -Reads given idx file for packed Git archive created with -'git pack-objects' command, and dumps its contents. +Read an idx file for packed Git archive created with +'git pack-objects' command from the standard input, and +dump its contents. The information it outputs is subset of what you can get from 'git verify-pack -v'; this command only shows the packfile
Documentation/git-show-ref.txt +1 -1
@@ -11,7 +11,7 @@ SYNOPSIS 'git show-ref' [-q|--quiet] [--verify] [--head] [-d|--dereference] [-s|--hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...] -'git show-ref' --exclude-existing[=<pattern>] < ref-list +'git show-ref' --exclude-existing[=<pattern>] DESCRIPTION -----------
Documentation/git-stripspace.txt +5 -4
@@ -9,14 +9,15 @@ git-stripspace - Remove unnecessary whitespace SYNOPSIS -------- [verse] -'git stripspace' [-s | --strip-comments] < input -'git stripspace' [-c | --comment-lines] < input +'git stripspace' [-s | --strip-comments] +'git stripspace' [-c | --comment-lines] DESCRIPTION ----------- -Clean the input in the manner used by Git for text such as commit -messages, notes, tags and branch descriptions. +Read text, such as commit messages, notes, tags and branch +descriptions, from the standard input and clean it in the manner +used by Git. With no arguments, this will:
Documentation/git-unpack-objects.txt +1 -1
@@ -9,7 +9,7 @@ git-unpack-objects - Unpack objects from a packed archive SYNOPSIS -------- [verse] -'git unpack-objects' [-n] [-q] [-r] [--strict] < <packfile> +'git unpack-objects' [-n] [-q] [-r] [--strict] DESCRIPTION
builtin/cat-file.c +1 -1
@@ -426,7 +426,7 @@ static int batch_objects(struct batch_options *opt)static const char *const cat_file_usage[] = {N_ ("git cat-file (-t [--allow-unknown-type]|-s [--allow-unknown-type]|-e|-p|<type>|--textconv) <object>" ), -N_ ("git cat-file (--batch | --batch-check) [--follow-symlinks] < <list-of-objects>" ), +N_ ("git cat-file (--batch | --batch-check) [--follow-symlinks]" ),NULL };
builtin/check-attr.c +1 -1
@@ -9,7 +9,7 @@ static int cached_attrs;static int stdin_paths;static const char *const check_attr_usage[] = {N_ ("git check-attr [-a | --all | <attr>...] [--] <pathname>..." ), -N_ ("git check-attr --stdin [-z] [-a | --all | <attr>...] < <list-of-paths>" ), +N_ ("git check-attr --stdin [-z] [-a | --all | <attr>...]" ),NULL };
builtin/check-ignore.c +1 -1
@@ -8,7 +8,7 @@static int quiet, verbose, stdin_paths, show_non_matching, no_index;static const char *const check_ignore_usage[] = {"git check-ignore [<options>] <pathname>..." , -"git check-ignore [<options>] --stdin < <list-of-paths>" , +"git check-ignore [<options>] --stdin" ,NULL };
builtin/commit-tree.c +1 -1
@@ -10,7 +10,7 @@#include "utf8.h" #include "gpg-interface.h" -static const char commit_tree_usage[] ="git commit-tree [(-p <sha1>)...] [-S[<keyid>]] [-m <message>] [-F <file>] <sha1> <changelog" ; +static const char commit_tree_usage[] ="git commit-tree [(-p <sha1>)...] [-S[<keyid>]] [-m <message>] [-F <file>] <sha1>" ;static const char *sign_commit;
builtin/get-tar-commit-id.c +1 -1
@@ -8,7 +8,7 @@#include "quote.h" static const char builtin_get_tar_commit_id_usage[] = -"git get-tar-commit-id < <tarfile>" ; +"git get-tar-commit-id" ;/* ustar header + extended global header content */ #define RECORDSIZE (512)
builtin/hash-object.c +1 -1
@@ -78,7 +78,7 @@ int cmd_hash_object(int argc, const char **argv, const char *prefix) {static const char *const hash_object_usage[] = {N_ ("git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>..." ), -N_ ("git hash-object --stdin-paths < <list-of-paths>" ), +N_ ("git hash-object --stdin-paths" ),NULL };const char *type = blob_type;
builtin/mktag.c +1 -1
@@ -154,7 +154,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)unsigned char result_sha1[20 ];if (argc !=1 ) -usage ("git mktag < signaturefile" ); +usage ("git mktag" );if (strbuf_read (&buf,0 ,4096 ) <0 ) {die_errno ("could not read from stdin" );
builtin/patch-id.c +1 -1
@@ -165,7 +165,7 @@ static void generate_id_list(int stable)strbuf_release (&line_buf); } -static const char patch_id_usage[] ="git patch-id [--stable | --unstable] < patch" ; +static const char patch_id_usage[] ="git patch-id [--stable | --unstable]" ;static int git_patch_id_config (const char *var,const char *value,void *cb) {
builtin/show-ref.c +1 -1
@@ -8,7 +8,7 @@static const char *const show_ref_usage[] = {N_ ("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference] [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...]" ), -N_ ("git show-ref --exclude-existing[=<pattern>] < <ref-list>" ), +N_ ("git show-ref --exclude-existing[=<pattern>]" ),NULL };
builtin/stripspace.c +2 -2
@@ -78,8 +78,8 @@ static void comment_lines(struct strbuf *buf) }static const char *usage_msg ="\n" -" git stripspace [-s | --strip-comments] < input\n" -" git stripspace [-c | --comment-lines] < input" ; +" git stripspace [-s | --strip-comments]\n" +" git stripspace [-c | --comment-lines]" ;int cmd_stripspace (int argc,const char **argv,const char *prefix) {
builtin/unpack-objects.c +1 -1
@@ -13,7 +13,7 @@#include "fsck.h" static int dry_run, quiet, recover, has_errors, strict; -static const char unpack_usage[] ="git unpack-objects [-n] [-q] [-r] [--strict] < pack-file" ; +static const char unpack_usage[] ="git unpack-objects [-n] [-q] [-r] [--strict]" ;/* We always read in 4kB chunks. */ static unsigned char buffer[4096 ];
show-index.c +1 -1
@@ -2,7 +2,7 @@#include "pack.h" static const char show_index_usage[] = -"git show-index < <packed archive index>" ; +"git show-index" ;int main (int argc,char **argv) {
Signature · 1 line
2.6.1-404-gacc2196
Quoted 1 line · Junio C Hamano
The synopsys text and the usage string of subcommands that read list
nit: s/synopsys/synopsis/
[...]
Documentation/git-cat-file.txt SYNOPSIS · line 13
Quoted 7 lines
+++
b/Documentation/git-cat-file.txtDocumentation/git-cat-file.txt +1
-1@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv ) <object> -'git cat-file' (--batch | --batch-check) [--follow-symlinks] < <list-of-objects> +'git cat-file' (--batch | --batch-check) [--follow-symlinks]
Makes sense. The BATCH OUTPUT section explains the input format.
[...]
Quoted 11 lines
Documentation/git-check-attr.txt +2
-1+++ b/Documentation/git-check-attr.txt@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git check-attr' [-a | --all | attr...] [--] pathname... -'git check-attr' --stdin [-z] [-a | --all | attr...] < <list-of-paths> +'git check-attr' --stdin [-z] [-a | --all | attr...] DESCRIPTION -----------
Documentation/git-check-attr.txt OPTIONS · line 31
Quoted 5 lines
Documentation/git-check-attr.txt +1
-1@@ -28,7 +28,7 @@ OPTIONS Consider `.gitattributes` in the index only, ignoring the working tree. --stdin:: - Read file names from stdin instead of from the command-line. + Read pathnames from stdin instead of from the command-line.
Here I have to read the description of "-z" to understand that pathnames come one per line. How about
Read pathnames from stdin, one per line, instead of from the command line.
?
[...]
Documentation/git-check-ignore.txt SYNOPSIS · line 13
Quoted 7 lines
Documentation/git-check-ignore.txt +2
-1+++ b/Documentation/git-check-ignore.txt@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git check-ignore' [options] pathname... -'git check-ignore' [options] --stdin < <list-of-paths> +'git check-ignore' [options] --stdin
Likewise.
Read pathnames from stdin, one per line, instead of from the command line.
[...]
Documentation/git-commit-tree.txt git-commit-tree - Create a new commit object · line 12
Quoted 7 lines
Documentation/git-commit-tree.txt +2
-1+++ b/Documentation/git-commit-tree.txt@@ -9,7 +9,7 @@ git-commit-tree - Create a new commit object SYNOPSIS -------- [verse] -'git commit-tree' <tree> [(-p <parent>)...] < changelog +'git commit-tree' <tree> [(-p <parent>)...]
The DESCRIPTION explains the input --- good.
[...]
Documentation/git-fmt-merge-msg.txt git-fmt-merge-msg - Produce a merge commit message · line 12
Quoted 7 lines
Documentation/git-fmt-merge-msg.txt +2
-1+++ b/Documentation/git-fmt-merge-msg.txt@@ -9,7 +9,7 @@ git-fmt-merge-msg - Produce a merge commit message SYNOPSIS -------- [verse] -'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] <$GIT_DIR/FETCH_HEAD +'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log]
The input format isn't described anywhere, unless I think of looking at the "-F" option. More importantly, the expected usage isn't described anywhere.
Perhaps an EXAMPLES section would help?
EXAMPLE ------- -- $ git fetch origin master $ git fmt-merge-msg --log <$GIT_DIR/FETCH_HEAD -- Print a log message describing a merge of the "master" branch from the "origin" remote.
Documentation/git-get-tar-commit-id.txt git-get-tar-commit-id - Extract commit ID from an archive created using git-arch · line 12
Quoted 8 lines
Documentation/git-get-tar-commit-id.txt +1
-1@@ -9,17 +9,19 @@ git-get-tar-commit-id - Extract commit ID from an archive created using git-arch SYNOPSIS -------- [verse] -'git get-tar-commit-id' < <tarfile> +'git get-tar-commit-id'
Looks sensible.
[...]
Documentation/git-get-tar-commit-id.txt git-get-tar-commit-id - Extract commit ID from an archive created using git-arch · line 18
Quoted 1 line
Documentation/git-get-tar-commit-id.txt +1
-0+Read an archive created by 'git archive' from the standard input and
Perhaps 'Reads a tar archive'? Otherwise I would be tempted to pass in a zip or tgz file.
[...]
Documentation/git-get-tar-commit-id.txt SYNOPSIS · line 13
Quoted 7 lines
Documentation/git-get-tar-commit-id.txt +2
-1+++ b/Documentation/git-hash-object.txt@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>... -'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters] < <list-of-paths> +'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
Has the same ambiguity as the other --stdin option descriptions.
Read pathnames from stdin, one per line, instead of from the command line.
[...]
Documentation/git-get-tar-commit-id.txt git-mktag - Creates a tag object · line 9
Quoted 4 lines
Documentation/git-get-tar-commit-id.txt +2
-1+++ b/Documentation/git-mktag.txt@@ -9,7 +9,7 @@ git-mktag - Creates a tag object -A tag signature file has a very simple fixed format: four lines of +A tag signature file, to be fed from the standard input, has a
s/from the/to this command's/
[...]
Quoted 2 lines
Documentation/git-get-tar-commit-id.txt +1
-0+++ b/Documentation/git-patch-id.txt@@ -8,10 +8,12 @@ git-patch-id - Compute unique ID for a patch
[...]
Quoted 1 line
+Read a patch from the standard input, and compute the patch ID for it.
Punctuation nit: there shouldn't be a comma before "and".
[...]
Quoted 6 lines
+++
b/Documentation/git-show-index.txtDocumentation/git-get-tar-commit-id.txt +0
-1@@ -9,13 +9,14 @@ git-show-index - Show packed archive index SYNOPSIS -------- [verse] -'git show-index' < idx-file
Documentation/git-get-tar-commit-id.txt git-show-index - Show packed archive index · line 19
Quoted 10 lines
Documentation/git-get-tar-commit-id.txt +4
-2+'git show-index' DESCRIPTION ----------- -Reads given idx file for packed Git archive created with -'git pack-objects' command, and dumps its contents. +Read an idx file for packed Git archive created with +'git pack-objects' command from the standard input, and +dump its contents.
Unrelated nit: this sounds like it's talking about "git archive" on first reading. Maybe:
Reads the idx file generated alongside a Git packfile by 'git pack-objects' and dumps a description of the pack's contents.
[...]
Documentation/git-get-tar-commit-id.txt SYNOPSIS · line 14
Quoted 7 lines
Documentation/git-get-tar-commit-id.txt +2
-1+++ b/Documentation/git-show-ref.txt@@ -11,7 +11,7 @@ SYNOPSIS 'git show-ref' [-q|--quiet] [--verify] [--head] [-d|--dereference] [-s|--hash[=<n>]] [--abbrev[=<n>]] [--tags] [--heads] [--] [<pattern>...] -'git show-ref' --exclude-existing[=<pattern>] < ref-list +'git show-ref' --exclude-existing[=<pattern>]
What is the input format?
Should there be a --stdin option to allow people to explicitly say they want to pass ref names (or patterns?) in stdin?
[...]
Quoted 4 lines
Documentation/git-get-tar-commit-id.txt +4
-0+++ b/Documentation/git-stripspace.txt +++ b/Documentation/git-unpack-objects.txt +++ b/builtin/cat-file.c +++ b/builtin/check-attr.c
Documentation/git-get-tar-commit-id.txt SYNOPSIS
Quoted 10 lines
Documentation/git-get-tar-commit-id.txt +10
-0+++ b/builtin/check-ignore.c +++ b/builtin/commit-tree.c +++ b/builtin/get-tar-commit-id.c +++ b/builtin/hash-object.c +++ b/builtin/mktag.c +++ b/builtin/patch-id.c +++ b/builtin/show-ref.c +++ b/builtin/stripspace.c +++ b/builtin/unpack-objects.c +++ b/show-index.c
Looks good.
Thanks,
Jonathan
Quoted 9 lines · Jonathan Nieder
Documentation/git-check-attr.txt OPTIONS · line 31
Quoted 3 lines
--stdin::
Documentation/git-check-attr.txt +1
-1- Read file names from stdin instead of from the command-line. + Read pathnames from stdin instead of from the command-line.Here I have to read the description of "-z" to understand that pathnames come one per line. How about
Read pathnames from stdin, one per line, instead of from the command line.
Thanks, that would be better (and for all the other one-per-line type of stuff).
Here is what I prepared based on your review in an interdiff form. A few points to note:
* Stole the "fmt-merge-msg" example verbatim ;-)
* The description of "show-ref --exclude" mode should be much clearer now.
Thanks.
Documentation/git-check-attr.txt +2 -1
@@ -28,7 +28,8 @@ OPTIONS Consider `.gitattributes` in the index only, ignoring the working tree. --stdin:: - Read pathnames from stdin instead of from the command-line. + Read pathnames from the standard input, one per line, + instead of from the command-line. -z:: The output format is modified to be machine-parseable.
Documentation/git-check-ignore.txt +2 -1
@@ -35,7 +35,8 @@ OPTIONS for each given pathname. --stdin:: - Read file names from stdin instead of from the command-line. + Read pathnames from the standard input, one per line, + instead of from the command-line. -z:: The output format is modified to be machine-parseable (see
Documentation/git-fmt-merge-msg.txt +12 -0
@@ -57,6 +57,18 @@ merge.summary:: Synonym to `merge.log`; this is deprecated and will be removed in the future. +EXAMPLE +------- + +-- +$ git fetch origin master +$ git fmt-merge-msg --log <$GIT_DIR/FETCH_HEAD +-- + +Print a log message describing a merge of the "master" branch from +the "origin" remote. + + SEE ALSO -------- linkgit:git-merge[1]
Documentation/git-get-tar-commit-id.txt +4 -4
@@ -15,10 +15,10 @@ SYNOPSIS DESCRIPTION ----------- -Read an archive created by 'git archive' from the standard input and -extracts the commit ID stored in it. It reads only the first 1024 -bytes of input, thus its runtime is not influenced by the size of -the archive very much. +Read a tar archive created by 'git archive' from the standard input +and extract the commit ID stored in it. It reads only the first +1024 bytes of input, thus its runtime is not influenced by the size +of the tar archive very much. If no commit ID is found, 'git get-tar-commit-id' quietly exists with a return code of 1. This can happen if the archive had not been created
Documentation/git-hash-object.txt +2 -1
@@ -35,7 +35,8 @@ OPTIONS Read the object from standard input instead of from a file. --stdin-paths:: - Read file names from stdin instead of from the command-line. + Read file names from the standard input, one per line, instead + of from the command-line. --path:: Hash object as it were located at the given path. The location of
Documentation/git-mktag.txt +2 -2
@@ -20,8 +20,8 @@ The output is the new tag's <object> identifier. Tag Format ---------- -A tag signature file, to be fed from the standard input, has a -very simple fixed format: four lines of +A tag signature file, to be fed to this command's standard input, +has a very simple fixed format: four lines of object <sha1> type <typename>
Documentation/git-patch-id.txt +1 -1
@@ -12,7 +12,7 @@ SYNOPSIS DESCRIPTION ----------- -Read a patch from the standard input, and compute the patch ID for it. +Read a patch from the standard input and compute the patch ID for it. A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with whitespace and line numbers ignored. As such, it's "reasonably
Documentation/git-show-index.txt +1 -1
@@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -Read an idx file for packed Git archive created with +Read the idx file for a Git packfile created with 'git pack-objects' command from the standard input, and dump its contents.
Documentation/git-show-ref.txt +3 -2
@@ -23,8 +23,9 @@ particular ref exists. By default, shows the tags, heads, and remote refs. -The --exclude-existing form is a filter that does the inverse, it shows the -refs from stdin that don't exist in the local repository. +The --exclude-existing form is a filter that does the inverse. It reads +refs from stdin, one ref per line, and shows those that don't exist in +the local repository. Use of this utility is encouraged in favor of directly accessing files under the `.git` directory.
Jonathan Nieder
Reviewed-byQuoted 1 line · Junio C Hamano
Here is what I prepared based on your review in an interdiff form.
For what it's worth,
Thanks.