docs: use metavariables consistently
v2 cover docs: use metavariables consistently
Update the documentation and usage statements to use metavariables, such as <commit>, more consistently. The biggest change is to drop the <tree-ish> and <commit-ish> (or <committish>) notation and just use <tree> or <commit>, since every command but commit-tree accepts tree-ishes and commit-ishes. The "-ish" terms are still kept around in various places where it makes sense to differentiate between an actual tree or commit and a tree-ish or commit-ish.
This is a rework of my earlier patch set from March [1], with the following differences:
- Drop the patch to commit-tree that makes it accept a tree-ish.
- Drop the patch dealing with <tag> and <tagname>.
- Leave -ish terms in comments and in places where they make sense.
- Rebase onto master (1b97434). Some of the patches from before have since been accepted from other authors.
- Fix a problem that Junio noticed with the "grep docs" patch.
[1] http://kerneltrap.org/mailarchive/git/2010/3/13/25484
Mark Lodato (8):
fsck docs: remove outdated and useless diagnostic
docs: use ...' instead of *' for multiplicity
docs: use <sha1> to mean unabbreviated ID http-fetch docs: use <commit-id> consistently grep docs: grep accepts a <tree-ish>, not a <tree>
docs: use <tree> instead of <tree-ish>
docs: use <commit> instead of <commit-ish> describe docs: note that <commit> is optional
Documentation/RelNotes/1.6.2.4.txt | 2 +- Documentation/diff-format.txt | 10 +++++----- Documentation/diff-generate-patch.txt | 2 +- Documentation/git-archive.txt | 4 ++-- Documentation/git-cat-file.txt | 2 +- Documentation/git-checkout.txt | 16 ++++++++-------- Documentation/git-commit-tree.txt | 3 ++- Documentation/git-describe.txt | 15 ++++++++------- Documentation/git-diff-index.txt | 4 ++-- Documentation/git-diff-tree.txt | 18 +++++++++--------- Documentation/git-fast-import.txt | 22 +++++++++++----------- Documentation/git-fsck.txt | 5 +---- Documentation/git-http-fetch.txt | 4 ++-- Documentation/git-ls-files.txt | 6 +++--- Documentation/git-ls-tree.txt | 6 +++--- Documentation/git-merge-index.txt | 2 +- Documentation/git-merge-tree.txt | 2 +- Documentation/git-name-rev.txt | 2 +- Documentation/git-read-tree.txt | 10 +++++----- Documentation/git-rebase.txt | 2 +- Documentation/git-svn.txt | 6 +++--- Documentation/git-tar-tree.txt | 4 ++-- Documentation/git.txt | 27 +++++++++++++-------------- Documentation/gitcli.txt | 6 +++--- Documentation/gittutorial-2.txt | 6 ++---- Documentation/glossary-content.txt | 4 ++++ archive.c | 4 ++-- builtin/commit-tree.c | 2 +- builtin/describe.c | 4 ++-- builtin/diff-index.c | 2 +- builtin/diff-tree.c | 2 +- builtin/ls-files.c | 4 ++-- builtin/ls-tree.c | 2 +- builtin/merge-index.c | 2 +- builtin/read-tree.c | 2 +- builtin/revert.c | 4 ++-- builtin/tar-tree.c | 2 +- contrib/examples/git-reset.sh | 2 +- contrib/examples/git-revert.sh | 4 ++-- git-svn.perl | 6 +++--- t/t4100/t-apply-3.patch | 8 ++++---- t/t4100/t-apply-7.patch | 8 ++++---- 42 files changed, 124 insertions(+), 124 deletions(-)
Signature · 1 line
1.7.3.2
PATCH v2 1/8 fsck docs: remove outdated and useless diagnostic
In git-fsck(1), there was a reference to the warning "<tree> has full pathnames in it". This exact wording has not been used since 2005 (commit f1f0d0889e55), when the wording was changed slightly. More importantly, the description of that warning was useless, and there were many other similar warning messages which were not document at all. Since all these warnings are fairly obvious, there is no need for them to be in the man page.
--- Documentation/git-fsck.txt | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
Documentation/git-fsck.txt +0 -3
@@ -123,9 +123,6 @@ dangling <type> <object>:: The <type> object <object>, is present in the database but never 'directly' used. A dangling commit could be a root node. -warning: git-fsck: tree <tree> has full pathnames in it:: - And it shouldn't... - sha1 mismatch <object>:: The database has an object who's sha1 doesn't match the database value.
Signature · 1 line
1.7.3.2
PATCH v2 2/8 docs: use `...' instead of `*' for multiplicity
In reply to Mark LodatoFinish the work of 0adda93 (Use parentheses and `...' where appropriate) to follow the rules set forth in Documentation/CodingGuidelines.
--- Documentation/git-fsck.txt | 2 +- Documentation/git-merge-index.txt | 2 +- Documentation/gitcli.txt | 2 +- builtin/describe.c | 2 +- builtin/merge-index.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
Documentation/git-fsck.txt +1 -1
@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git fsck' [--tags] [--root] [--unreachable] [--cache] [--no-reflogs] - [--[no-]full] [--strict] [--verbose] [--lost-found] [<object>*] + [--[no-]full] [--strict] [--verbose] [--lost-found] [<object>...] DESCRIPTION -----------
Documentation/git-merge-index.txt +1 -1
@@ -8,7 +8,7 @@ git-merge-index - Run a merge for files needing merging SYNOPSIS -------- -'git merge-index' [-o] [-q] <merge-program> (-a | [--] <file>*) +'git merge-index' [-o] [-q] <merge-program> (-a | [--] <file>...) DESCRIPTION -----------
Documentation/gitcli.txt +1 -1
@@ -81,7 +81,7 @@ couple of magic command line options: + --------------------------------------------- $ git describe -h -usage: git describe [options] <committish>* +usage: git describe [options] <committish>... --contains find the tag that comes after the commit --debug debug search strategy on stderr
builtin/describe.c +1 -1
@@ -12,7 +12,7 @@#define MAX_TAGS (FLAG_BITS - 1)static const char *const describe_usage[] = { -"git describe [options] <committish>*" , +"git describe [options] <committish>..." ,"git describe [options] --dirty" ,NULL };
builtin/merge-index.c +1 -1
@@ -76,7 +76,7 @@ int cmd_merge_index(int argc, const char **argv, const char *prefix)signal (SIGCHLD ,SIG_DFL );if (argc <3 ) -usage ("git merge-index [-o] [-q] <merge-program> (-a | [--] <filename>*)" ); +usage ("git merge-index [-o] [-q] <merge-program> (-a | [--] <filename>...)" );read_cache ();
Signature · 1 line
1.7.3.2
Re: [PATCH 2/8] docs: use `...' instead of `*' for multiplicity
Quoted 4 lines · Mark Lodato
Finish the work of 0adda93 (Use parentheses and `...' where appropriate) to follow the rules set forth in
Documentation/CodingGuidelines.Signed-off-by Mark Lodato <[email protected]>
[...]
builtin/describe.c line 15
Quoted 2 lines
builtin/describe.c +1
-1- "git describe [options] <committish>*", + "git describe [options] <committish>...",
Isn't <sth>... one or more, while <sth>* is zero or more, i.e. shouldn't <sth>* be replaced by [<sth>...]?
Hmmm... I see that <sth>* was actively wrong if it was to mean zero or more, so your change doesn't only make documentation more consistent, but fixes errorneous use of convention.
Signature · 3 lines
Jakub Narebski Poland ShadeHawk on #git
Re: [PATCH 2/8] docs: use `...' instead of `*' for multiplicity
Quoted 7 lines · Jakub Narebski
Quoted 4 lines · Mark Lodato
Finish the work of 0adda93 (Use parentheses and `...' where appropriate) to follow the rules set forth in
Documentation/CodingGuidelines.Signed-off-by Mark Lodato <[email protected]>
Quoted 7 lines
[...]
Quoted 2 lines
- "git describe [options] <committish>*",
+ "git describe [options] <committish>...",Isn't <sth>... one or more, while <sth>* is zero or more, i.e. shouldn't <sth>* be replaced by [<sth>...]?
Yes, I was confused by the * notation - one more reason to get rid of it!
Quoted 3 lines
Hmmm... I see that <sth>* was actively wrong if it was to mean zero or more, so your change doesn't only make documentation more consistent, but fixes errorneous use of convention.
I think zero or more is correct, which is why I submitted patch 8/8 to change from <commit>... to [<commit>...]. Now I understand that all 8/8 was doing was fixing a mistake I introduced in this patch. I'll correct it in the next version.
PATCH v2 3/8 docs: use <sha1> to mean unabbreviated ID
In reply to Mark LodatoThere are some places that literally require a full, 40-character SHA-1 ID, rather than a generic revision specifier. Introduce in git(1) the <sha1> terminology to mean this. Use <sha1> in git-diff-tree(1) to note that --stdin only takes <sha1>s, not generic <tree>s or <commit>s. Use <tree> and <commit> in the usage statement for 'commit-tree'.
--- Documentation/git-diff-tree.txt | 4 ++-- Documentation/git.txt | 5 +++++ builtin/commit-tree.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-)
Documentation/git-diff-tree.txt +2 -2
@@ -49,8 +49,8 @@ include::diff-options.txt[] --stdin:: When '--stdin' is specified, the command does not take <tree-ish> arguments from the command line. Instead, it - reads lines containing either two <tree>, one <commit>, or a - list of <commit> from its standard input. (Use a single space + reads lines containing <sha1>s: either two trees, one commit, or + multiple commits from its standard input. (Use a single space as separator.) + When two trees are given, it compares the first tree with the second.
Documentation/git.txt +5 -0
@@ -457,6 +457,11 @@ list. Identifier Terminology ---------------------- +<sha1>:: + Indicates a full, 40-character SHA-1 identifier of an object. + The type of the referenced object is unspecified. + Abbreviated or symbolic identifiers cannot be used. + <object>:: Indicates the object name for any type of object.
builtin/commit-tree.c +1 -1
@@ -9,7 +9,7 @@#include "builtin.h" #include "utf8.h" -static const char commit_tree_usage[] ="git commit-tree <sha1> [(-p <sha1>)...] < changelog" ; +static const char commit_tree_usage[] ="git commit-tree <tree> [(-p <commit>)...] < changelog" ;static void new_parent (struct commit *parent,struct commit_list **parents_p) {
Signature · 1 line
1.7.3.2
Re: [PATCH 3/8] docs: use <sha1> to mean unabbreviated ID
Quoted 2 lines · Mark Lodato
There are some places that literally require a full, 40-character SHA-1 ID, rather than a generic revision specifier.
One name I have seen for these is "object IDs", as in git get-tar-commit-id (to avoid putting too much emphasis on precisely how the identifiers are chosen).
Quoted 2 lines
Use <sha1> in git-diff-tree(1) to note
that --stdin only takes <sha1>s, not generic <tree>s or <commit>s.
In this example, maybe it would be cleanest to spell out "40-digit object identifier".
Perhaps something like this? (The text is more verbose than I'd like and it would be nicer to include an example, though.)
---
Documentation/git-diff-tree.txt +5 -3
@@ -49,9 +49,11 @@ include::diff-options.txt[] --stdin:: When '--stdin' is specified, the command does not take <tree-ish> arguments from the command line. Instead, it - reads lines containing either two <tree>, one <commit>, or a - list of <commit> from its standard input. (Use a single space - as separator.) + reads lines, each naming two trees, one commit, or multiple + commits, from its standard input. Each line consists of a + list of full 40-digit object identifiers with a single space + as separator. Objects must be named directly; for example, + a tag ID cannot be used to represent a commit. + When two trees are given, it compares the first tree with the second. When a single commit is given, it compares the commit with its
Re: [PATCH 3/8] docs: use <sha1> to mean unabbreviated ID
Quoted 8 lines · Jonathan Nieder
Quoted 2 lines · Mark Lodato
There are some places that literally require a full, 40-character SHA-1 ID, rather than a generic revision specifier.
One name I have seen for these is "object IDs", as in git get-tar-commit-id (to avoid putting too much emphasis on precisely how the identifiers are chosen).
Yes, I think I also saw "a full object name" (cf. diff --full-index) and evan "object name" (cf. git-pack-objects(1)). These are all deliberate efforts to stay away from spelling SHA-1 explicitly, and I think it makes sense to do so here. "40-digit object ID" is a mouthful, though.
As to what this series tries to do, I think it is generally a good idea to start allowing documents to say <tree> when a reader can plug either a commit or a tree, rather than <tree-ish>, only because all Porcelains automatically dereference object names to needed types these days.
But such a change needs to mark places that _must_ take the name of an object of the specific type somehow. It is Ok to say ls-tree takes a tree, but then we must say you should feed commit-tree nothing but a tree.
It is a separate issue to allow plumbings to automatically dereference when both of the following two conditions hold: (1) the intent is clear from the context; (2) nobody sane would have been relying on the side effect of the current typechecking.
Letting commit-tree to unwrap a tree-ish to a tree would be a good example that clearly satisfies (1)---I am not sure about the other one.
PATCH v2 4/8 http-fetch docs: use <commit-id> consistently
In reply to Mark Lodato--- Documentation/git-http-fetch.txt | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Documentation/git-http-fetch.txt +2 -2
@@ -8,7 +8,7 @@ git-http-fetch - Download from a remote git repository via HTTP SYNOPSIS -------- -'git http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [--stdin] <commit> <url> +'git http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [--stdin] <commit-id> <url> DESCRIPTION -----------
@@ -16,7 +16,7 @@ Downloads a remote git repository via HTTP. OPTIONS ------- -commit-id:: +<commit-id>:: Either the hash or the filename under [URL]/refs/ to pull.
Signature · 1 line
1.7.3.2
Re: [PATCH 4/8] http-fetch docs: use <commit-id> consistently
Quoted 12 lines · Mark Lodato
Documentation/git-http-fetch.txt +1
-1@@ -8,7 +8,7 @@ git-http-fetch - Download from a remote git repository via HTTP SYNOPSIS -------- -'git http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [--stdin] <commit> <url> +'git http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [--stdin] <commit-id> <url> DESCRIPTION -----------
Documentation/git-http-fetch.txt Downloads a remote git repository via HTTP. · line 21
Quoted 7 lines
Documentation/git-http-fetch.txt +1
-1@@ -16,7 +16,7 @@ Downloads a remote git repository via HTTP. OPTIONS ------- -commit-id:: +<commit-id>:: Either the hash or the filename under [URL]/refs/ to pull.
Does this mean the same thing as "commit id" in other manpages?
PATCH v2 5/8 grep docs: grep accepts a <tree-ish>, not a <tree>
In reply to Mark LodatoAlso document that -p accepts a <commit> in the usage message.
--- Documentation/git-grep.txt | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Documentation/git-grep.txt +2 -2
@@ -22,7 +22,7 @@ SYNOPSIS [-A <post-context>] [-B <pre-context>] [-C <context>] [-f <file>] [-e] <pattern> [--and|--or|--not|(|)|-e <pattern>...] - [--cached | --no-index | <tree>...] + [--cached | --no-index | <tree-ish>...] [--] [<pathspec>...] DESCRIPTION
@@ -176,7 +176,7 @@ OPTIONS Do not output matched lines; instead, exit with status 0 when there is a match and with non-zero status when there isn't. -<tree>...:: +<tree-ish>...:: Instead of searching tracked files in the working tree, search blobs in the given trees.
Signature · 1 line
1.7.3.2
PATCH v2 6/8 docs: use <tree> instead of <tree-ish>
In reply to Mark LodatoNo git command, besides commit-tree, accepts only a tree and not a tree-ish, so let us remove the latter term from common usage in the documentation in order to reduce the amount of jargon.
The term "tree-ish" was left in the following situations:
- all comments in the code
- situations where "tree-ish" is being contrasted to "tree"
- error messages, to prevent porcelains from changing
- tests
- the glossary
--- Documentation/RelNotes/1.6.2.4.txt | 2 +- Documentation/diff-format.txt | 10 +++++----- Documentation/diff-generate-patch.txt | 2 +- Documentation/git-archive.txt | 4 ++-- Documentation/git-cat-file.txt | 2 +- Documentation/git-checkout.txt | 16 ++++++++-------- Documentation/git-commit-tree.txt | 3 ++- Documentation/git-diff-index.txt | 4 ++-- Documentation/git-diff-tree.txt | 14 +++++++------- Documentation/git-grep.txt | 4 ++-- Documentation/git-ls-files.txt | 6 +++--- Documentation/git-ls-tree.txt | 6 +++--- Documentation/git-merge-tree.txt | 2 +- Documentation/git-read-tree.txt | 10 +++++----- Documentation/git-svn.txt | 6 +++--- Documentation/git-tar-tree.txt | 4 ++-- Documentation/git.txt | 11 ++++------- Documentation/gitcli.txt | 4 ++-- Documentation/gittutorial-2.txt | 6 ++---- archive.c | 4 ++-- builtin/diff-index.c | 2 +- builtin/diff-tree.c | 2 +- builtin/ls-files.c | 4 ++-- builtin/ls-tree.c | 2 +- builtin/read-tree.c | 2 +- builtin/tar-tree.c | 2 +- git-svn.perl | 6 +++--- t/t4100/t-apply-3.patch | 8 ++++---- t/t4100/t-apply-7.patch | 8 ++++---- 29 files changed, 76 insertions(+), 80 deletions(-)
Documentation/RelNotes/1.6.2.4.txt +1 -1
@@ -13,7 +13,7 @@ Fixes since v1.6.2.3 * "git-add -p" lacked a way to say "q"uit to refuse staging any hunks for the remaining paths. You had to say "d" and then ^C. -* "git-checkout <tree-ish> <submodule>" did not update the index entry at +* "git-checkout <tree> <submodule>" did not update the index entry at the named path; it now does. * "git-fast-export" choked when seeing a tag that does not point at commit.
Documentation/diff-format.txt +5 -5
@@ -7,13 +7,13 @@ The raw output format from "git-diff-index", "git-diff-tree", These commands all compare two sets of things; what is compared differs: -git-diff-index <tree-ish>:: - compares the <tree-ish> and the files on the filesystem. +git-diff-index <tree>:: + compares the <tree> and the files on the filesystem. -git-diff-index --cached <tree-ish>:: - compares the <tree-ish> and the index. +git-diff-index --cached <tree>:: + compares the <tree> and the index. -git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>...]:: +git-diff-tree [-r] <tree-1> <tree-2> [<pattern>...]:: compares the trees named by the two arguments. git-diff-files [<pattern>...]::
Documentation/diff-generate-patch.txt +1 -1
@@ -131,7 +131,7 @@ The `mode <mode>,<mode>..<mode>` line appears only if at least one of the <mode> is different from the rest. Extended headers with information about detected contents movement (renames and copying detection) are designed to work with diff of two -<tree-ish> and are not used by combined diff format. +<tree> and are not used by combined diff format. 3. It is followed by two-line from-file/to-file header
Documentation/git-archive.txt +2 -2
@@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git archive' [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>] [-o | --output=<file>] [--worktree-attributes] - [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish> + [--remote=<repo> [--exec=<git-upload-archive>]] <tree> [<path>...] DESCRIPTION
@@ -70,7 +70,7 @@ OPTIONS Used with --remote to specify the path to the 'git-upload-archive' on the remote side. -<tree-ish>:: +<tree>:: The tree or commit to produce an archive for. <path>::
Documentation/git-cat-file.txt +1 -1
@@ -54,7 +54,7 @@ OPTIONS --textconv:: Show the content as transformed by a textconv filter. In this case, - <object> has be of the form <treeish>:<path>, or :<path> in order + <object> has be of the form <tree>:<path>, or :<path> in order to apply the filter to the content recorded in the index at <path>. --batch::
Documentation/git-checkout.txt +8 -8
@@ -10,8 +10,8 @@ SYNOPSIS [verse] 'git checkout' [-q] [-f] [-m] [<branch>] 'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>] -'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>... -'git checkout' --patch [<tree-ish>] [--] [<paths>...] +'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree>] [--] <paths>... +'git checkout' --patch [<tree>] [--] [<paths>...] DESCRIPTION -----------
@@ -43,14 +43,14 @@ $ git checkout <branch> that is to say, the branch is not reset/created unless "git checkout" is successful. -'git checkout' [--patch] [<tree-ish>] [--] <pathspec>...:: +'git checkout' [--patch] [<tree>] [--] <pathspec>...:: When <paths> or `--patch` are given, 'git checkout' does *not* switch branches. It updates the named paths in the working tree - from the index file or from a named <tree-ish> (most often a + from the index file or from a named <tree> (most often a commit). In this case, the `-b` and `--track` options are meaningless and giving either of them results in an error. The - <tree-ish> argument can be used to specify a specific tree-ish + <tree> argument can be used to specify a specific tree-ish (i.e. commit, tag or tree) to update the index for the given paths before updating the working tree. +
@@ -169,9 +169,9 @@ the conflicted merge in the specified paths. -p:: --patch:: Interactively select hunks in the difference between the - <tree-ish> (or the index, if unspecified) and the working + <tree> (or the index, if unspecified) and the working tree. The chosen hunks are then applied in reverse to the - working tree (and if a <tree-ish> was specified, the index). + working tree (and if a <tree> was specified, the index). + This means that you can use `git checkout -p` to selectively discard edits from your current working tree.
@@ -198,7 +198,7 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`. The name of a commit at which to start the new branch; see linkgit:git-branch[1] for details. Defaults to HEAD. -<tree-ish>:: +<tree>:: Tree to checkout from (when paths are given). If not specified, the index will be used.
Documentation/git-commit-tree.txt +2 -1
@@ -36,7 +36,8 @@ state was. OPTIONS ------- <tree>:: - An existing tree object + An existing tree object. Unlike other git commands, this must + be an actual tree object, not a commit or tag. -p <parent commit>:: Each '-p' indicates the id of a parent commit object.
Documentation/git-diff-index.txt +2 -2
@@ -8,7 +8,7 @@ git-diff-index - Compares content and mode of blobs between the index and reposi SYNOPSIS -------- -'git diff-index' [-m] [--cached] [<common diff options>] <tree-ish> [<path>...] +'git diff-index' [-m] [--cached] [<common diff options>] <tree> [<path>...] DESCRIPTION -----------
@@ -22,7 +22,7 @@ OPTIONS ------- include::diff-options.txt[] -<tree-ish>:: +<tree>:: The id of a tree object to diff against. --cached::
Documentation/git-diff-tree.txt +7 -7
@@ -11,13 +11,13 @@ SYNOPSIS [verse] 'git diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r] [-c | --cc] [--root] [<common diff options>] - <tree-ish> [<tree-ish>] [<path>...] + <tree> [<tree>] [<path>...] DESCRIPTION ----------- Compares the content and mode of the blobs found via two tree objects. -If there is only one <tree-ish> given, the commit is compared with its parents +If there is only one <tree> given, the commit is compared with its parents (see --stdin below). Note that 'git diff-tree' can use the tree encapsulated in a commit object.
@@ -26,7 +26,7 @@ OPTIONS ------- include::diff-options.txt[] -<tree-ish>:: +<tree>:: The id of a tree object. <path>...::
@@ -48,7 +48,7 @@ include::diff-options.txt[] --stdin:: When '--stdin' is specified, the command does not take - <tree-ish> arguments from the command line. Instead, it + <tree> arguments from the command line. Instead, it reads lines containing <sha1>s: either two trees, one commit, or multiple commits from its standard input. (Use a single space as separator.)
@@ -91,7 +91,7 @@ include::pretty-options.txt[] -c:: This flag changes the way a merge commit is displayed (which means it is useful only when the command is given - one <tree-ish>, or '--stdin'). It shows the differences + one <tree>, or '--stdin'). It shows the differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time (which is what the '-m' option does).
@@ -121,13 +121,13 @@ Limiting Output If you're only interested in differences in a subset of files, for example some architecture-specific files, you might do: - git diff-tree -r <tree-ish> <tree-ish> arch/ia64 include/asm-ia64 + git diff-tree -r <tree> <tree> arch/ia64 include/asm-ia64 and it will only show you what changed in those two directories. Or if you are searching for what changed in just `kernel/sched.c`, just do - git diff-tree -r <tree-ish> <tree-ish> kernel/sched.c + git diff-tree -r <tree> <tree> kernel/sched.c and it will ignore all differences to other files.
Documentation/git-grep.txt +2 -2
@@ -22,7 +22,7 @@ SYNOPSIS [-A <post-context>] [-B <pre-context>] [-C <context>] [-f <file>] [-e] <pattern> [--and|--or|--not|(|)|-e <pattern>...] - [--cached | --no-index | <tree-ish>...] + [--cached | --no-index | <tree>...] [--] [<pathspec>...] DESCRIPTION
@@ -176,7 +176,7 @@ OPTIONS Do not output matched lines; instead, exit with status 0 when there is a match and with non-zero status when there isn't. -<tree-ish>...:: +<tree>...:: Instead of searching tracked files in the working tree, search blobs in the given trees.
Documentation/git-ls-files.txt +3 -3
@@ -16,7 +16,7 @@ SYNOPSIS [-X <file>|--exclude-from=<file>] [--exclude-per-directory=<file>] [--exclude-standard] - [--error-unmatch] [--with-tree=<tree-ish>] + [--error-unmatch] [--with-tree=<tree>] [--full-name] [--abbrev] [--] [<file>...] DESCRIPTION
@@ -99,11 +99,11 @@ OPTIONS If any <file> does not appear in the index, treat this as an error (return 1). ---with-tree=<tree-ish>:: +--with-tree=<tree>:: When using --error-unmatch to expand the user supplied <file> (i.e. path pattern) arguments to paths, pretend that paths which were removed in the index since the - named <tree-ish> are still present. Using this option + named <tree> are still present. Using this option with `-s` or `-u` options does not make any sense. -t::
Documentation/git-ls-tree.txt +3 -3
@@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git ls-tree' [-d] [-r] [-t] [-l] [-z] [--name-only] [--name-status] [--full-name] [--full-tree] [--abbrev[=<n>]] - <tree-ish> [<path>...] + <tree> [<path>...] DESCRIPTION -----------
@@ -35,8 +35,8 @@ in the current working directory. Note that: OPTIONS ------- -<tree-ish>:: - Id of a tree-ish. +<tree>:: + The id of a tree object. -d:: Show only the named tree entry itself, not its children.
Documentation/git-merge-tree.txt +1 -1
@@ -12,7 +12,7 @@ SYNOPSIS DESCRIPTION ----------- -Reads three treeish, and output trivial merge results and +Reads three <tree>s, and output trivial merge results and conflicting stages to the standard output. This is similar to what three-way 'git read-tree -m' does, but instead of storing the results in the index, the command outputs the entries to the
Documentation/git-read-tree.txt +5 -5
@@ -11,12 +11,12 @@ SYNOPSIS 'git read-tree' [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--index-output=<file>] [--no-sparse-checkout] - (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]]) + (--empty | <tree-1> [<tree-2> [<tree-3>]]) DESCRIPTION ----------- -Reads the tree information given by <tree-ish> into the index, +Reads the tree information given by <tree> into the index, but does not actually *update* any of the files it "caches". (see: linkgit:git-checkout-index[1])
@@ -77,7 +77,7 @@ OPTIONS --prefix=<prefix>/:: Keep the current index contents, and read the contents - of named tree-ish under directory at `<prefix>`. The + of named tree under directory at `<prefix>`. The original index file cannot have anything at the path `<prefix>` itself, and have nothing in `<prefix>/` directory. Note that the `<prefix>/` value must end
@@ -118,7 +118,7 @@ OPTIONS Instead of reading tree object(s) into the index, just empty it. -<tree-ish#>:: +<tree-#>:: The id of the tree object(s) to be read/merged.
@@ -278,7 +278,7 @@ merge. The different stages represent the "result tree" (stage 0, aka you are trying to merge (stage 2 and 3 respectively). The order of stages 1, 2 and 3 (hence the order of three -<tree-ish> command line arguments) are significant when you +<tree> command line arguments) are significant when you start a 3-way merge with an index file that is already populated. Here is an outline of how the algorithm works:
Documentation/git-svn.txt +3 -3
@@ -314,8 +314,8 @@ Any other arguments are passed directly to 'git log' 'find-rev':: When given an SVN revision number of the form 'rN', returns the corresponding git commit hash (this can optionally be followed by a - tree-ish to specify which branch should be searched). When given a - tree-ish, returns the corresponding SVN revision number. + <tree> to specify which branch should be searched). When given a + <tree>, returns the corresponding SVN revision number. 'set-tree':: You should consider using 'dcommit' instead of this command.
@@ -345,7 +345,7 @@ Any other arguments are passed directly to 'git log' for use after commands like "git checkout" or "git reset". 'commit-diff':: - Commits the diff of two tree-ish arguments from the + Commits the diff of two <tree> arguments from the command-line. This command does not rely on being inside an `git svn init`-ed repository. This command takes three arguments, (a) the original tree to diff against, (b) the new tree result, (c) the
Documentation/git-tar-tree.txt +2 -2
@@ -8,7 +8,7 @@ git-tar-tree - Create a tar archive of the files in the named tree object SYNOPSIS -------- -'git tar-tree' [--remote=<repo>] <tree-ish> [ <base> ] +'git tar-tree' [--remote=<repo>] <tree> [ <base> ] DESCRIPTION -----------
@@ -29,7 +29,7 @@ It can be extracted using 'git get-tar-commit-id'. OPTIONS ------- -<tree-ish>:: +<tree>:: The tree or commit to produce tar archive for. If it is the object name of a commit object.
Documentation/git.txt +4 -7
@@ -469,17 +469,14 @@ Identifier Terminology Indicates a blob object name. <tree>:: - Indicates a tree object name. + Indicates a tree object name, or the name of tag or commit that points + at a tree. A command that takes a <tree> argument ultimately + wants to operate on a tree object but automatically dereferences + tag and commit objects until it finds a tree. <commit>:: Indicates a commit object name. -<tree-ish>:: - Indicates a tree, commit or tag object name. A - command that takes a <tree-ish> argument ultimately wants to - operate on a <tree> object but automatically dereferences - <commit> and <tag> objects that point at a <tree>. - <commit-ish>:: Indicates a commit or tag object name. A command that takes a <commit-ish> argument ultimately wants to
Documentation/gitcli.txt +2 -2
@@ -15,8 +15,8 @@ DESCRIPTION This manual describes the convention used throughout git CLI. -Many commands take revisions (most often "commits", but sometimes -"tree-ish", depending on the context and command) and paths as their +Many commands take revisions (most often <commit>s, but sometimes +<tree>s, depending on the context and command) and paths as their arguments. Here are the rules: * Revisions come first and then paths.
Documentation/gittutorial-2.txt +2 -4
@@ -209,10 +209,8 @@ Note, by the way, that lots of commands take a tree as an argument. But as we can see above, a tree can be referred to in many different ways--by the SHA1 name for that tree, by the name of a commit that refers to the tree, by the name of a branch whose head refers to that -tree, etc.--and most such commands can accept any of these names. - -In command synopses, the word "tree-ish" is sometimes used to -designate such an argument. +tree, etc.--and all such commands can accept any of these names unless +otherwise stated. The index file --------------
archive.c +2 -2
@@ -7,9 +7,9 @@#include "unpack-trees.h" static char const *const archive_usage[] = { -"git archive [options] <tree-ish> [<path>...]" , +"git archive [options] <tree> [<path>...]" ,"git archive --list" , -"git archive --remote <repo> [--exec <cmd>] [options] <tree-ish> [<path>...]" , +"git archive --remote <repo> [--exec <cmd>] [options] <tree> [<path>...]" ,"git archive --remote <repo> [--exec <cmd>] --list" ,NULL };
builtin/diff-index.c +1 -1
@@ -7,7 +7,7 @@static const char diff_cache_usage[] ="git diff-index [-m] [--cached] " -"[<common diff options>] <tree-ish> [<path>...]" +"[<common diff options>] <tree> [<path>...]" COMMON_DIFF_OPTIONS_HELP ;int cmd_diff_index (int argc,const char **argv,const char *prefix)
builtin/diff-tree.c +1 -1
@@ -88,7 +88,7 @@ static int diff_tree_stdin(char *line)static const char diff_tree_usage[] ="git diff-tree [--stdin] [-m] [-c] [--cc] [-s] [-v] [--pretty] [-t] [-r] [--root] " -"[<common diff options>] <tree-ish> [<tree-ish>] [<path>...]\n" +"[<common diff options>] <tree> [<tree>] [<path>...]\n" " -r diff recursively\n" " --root include the initial commit as diff against /dev/null\n" COMMON_DIFF_OPTIONS_HELP ;
builtin/ls-files.c +2 -2
@@ -523,8 +523,8 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix) PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL },OPT_BOOLEAN (0 ,"error-unmatch" , &error_unmatch,"if any <file> is not in the index, treat this as an error" ), -OPT_STRING (0 ,"with-tree" , &with_tree,"tree-ish" , -"pretend that paths removed since <tree-ish> are still present" ), +OPT_STRING (0 ,"with-tree" , &with_tree,"tree" , +"pretend that paths removed since <tree> are still present" ),OPT__ABBREV (&abbrev),OPT_BOOLEAN (0 ,"debug" , &debug_mode,"show debugging data" ),OPT_END ()
builtin/ls-tree.c +1 -1
@@ -24,7 +24,7 @@ static int chomp_prefix;static const char *ls_tree_prefix;static const char *const ls_tree_usage[] = { -"git ls-tree [<options>] <tree-ish> [<path>...]" , +"git ls-tree [<options>] <tree> [<path>...]" ,NULL };
builtin/read-tree.c +1 -1
@@ -33,7 +33,7 @@ static int list_tree(unsigned char *sha1) }static const char *const read_tree_usage[] = { -"git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])" , +"git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-1> [<tree-2> [<tree-3>]])" ,NULL };
builtin/tar-tree.c +1 -1
@@ -8,7 +8,7 @@#include "quote.h" static const char tar_tree_usage[] = -"git tar-tree [--remote=<repo>] <tree-ish> [basedir]\n" +"git tar-tree [--remote=<repo>] <tree> [basedir]\n" "*** Note that this command is now deprecated; use \"git archive\" instead." ; static const char builtin_get_tar_commit_id_usage[] =
git-svn.perl +3 -3
@@ -172,7 +172,7 @@ my %cmd = ( 'username=s' => \$Git::SVN::Prompt::_username, 'commit-url=s' => \$_commit_url } ], 'set-tree' => [ \&cmd_set_tree, - "Set an SVN repository to a git tree-ish", + "Set an SVN repository to a git tree", { 'stdin' => \$_stdin, %cmt_opts, %fc_opts, } ], 'create-ignore' => [ \&cmd_create_ignore, 'Create a .gitignore per svn:ignore',
@@ -215,7 +215,7 @@ my %cmd = ( 'pager=s' => \$Git::SVN::Log::pager } ], 'find-rev' => [ \&cmd_find_rev, - "Translate between SVN revision numbers and tree-ish", + "Translate between SVN revision numbers and trees", {} ], 'rebase' => [ \&cmd_rebase, "Fetch and rebase your working directory", { 'merge|m|M' => \$_merge,
@@ -1002,7 +1002,7 @@ sub cmd_multi_fetch { sub cmd_commit_diff { my ($ta, $tb, $url) = @_; my $usage = "Usage: $0 commit-diff -r<revision> ". - "<tree-ish> <tree-ish> [<URL>]"; + "<tree> <tree> [<URL>]"; fatal($usage) if (!defined $ta || !defined $tb); my $svn_path = ''; if (!defined $url) {
t/t4100/t-apply-3.patch +4 -4
@@ -12,8 +12,8 @@ diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt SYNOPSIS -------- --'git-ls-tree' [-r] [-z] <tree-ish> [paths...] -+'git-ls-tree' [-d] [-r] [-z] <tree-ish> [paths...] +-'git-ls-tree' [-r] [-z] <tree> [paths...] ++'git-ls-tree' [-d] [-r] [-z] <tree> [paths...] DESCRIPTION -----------
@@ -24,7 +24,7 @@ diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt OPTIONS ------- - <tree-ish>:: + <tree>:: Id of a tree. +-d::
@@ -485,7 +485,7 @@ dissimilarity index 82% +} + +static const char *ls_tree_usage = -+ "git-ls-tree [-d] [-r] [-z] <tree-ish> [path...]"; ++ "git-ls-tree [-d] [-r] [-z] <tree> [path...]"; + +int main(int argc, char **argv) +{
t/t4100/t-apply-7.patch +4 -4
@@ -11,8 +11,8 @@ diff a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt SYNOPSIS -------- --'git-ls-tree' [-r] [-z] <tree-ish> [paths...] -+'git-ls-tree' [-d] [-r] [-z] <tree-ish> [paths...] +-'git-ls-tree' [-r] [-z] <tree> [paths...] ++'git-ls-tree' [-d] [-r] [-z] <tree> [paths...] DESCRIPTION -----------
@@ -23,7 +23,7 @@ diff a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt OPTIONS ------- - <tree-ish>:: + <tree>:: Id of a tree. +-d::
@@ -415,7 +415,7 @@ diff a/ls-tree.c b/ls-tree.c -static const char *ls_tree_usage = "git-ls-tree [-r] [-z] <key> [paths...]"; +static const char *ls_tree_usage = -+ "git-ls-tree [-d] [-r] [-z] <tree-ish> [path...]"; ++ "git-ls-tree [-d] [-r] [-z] <tree> [path...]"; int main(int argc, char **argv) {
Signature · 1 line
1.7.3.2
Re: [PATCH 6/8] docs: use <tree> instead of <tree-ish>
Quoted 4 lines · Mark Lodato
The term "tree-ish" was left in the following situations:
- all comments in the code
- situations where "tree-ish" is being contrasted to "tree"
- error messages, to prevent porcelains from changing
Nit: to prevent plumbing from changing? Or to prevent porcelains from having to change in response to changes in plumbing?
Documentation/RelNotes/1.6.2.4.txt Fixes since v1.6.2.3 · line 17
Quoted 9 lines
Documentation/RelNotes/1.6.2.4.txt +1
-1@@ -13,7 +13,7 @@ Fixes since v1.6.2.3 * "git-add -p" lacked a way to say "q"uit to refuse staging any hunks for the remaining paths. You had to say "d" and then ^C. -* "git-checkout <tree-ish> <submodule>" did not update the index entry at +* "git-checkout <tree> <submodule>" did not update the index entry at the named path; it now does.
Is changing release notes for historical releases like this a good idea? (It not clear to me either way.)
Documentation/diff-format.txt The raw output format from "git-diff-index", "git-diff-tree", · line 11
Quoted 10 lines
Documentation/diff-format.txt +2
-2@@ -7,13 +7,13 @@ The raw output format from "git-diff-index", "git-diff-tree", These commands all compare two sets of things; what is compared differs: -git-diff-index <tree-ish>:: - compares the <tree-ish> and the files on the filesystem. +git-diff-index <tree>:: + compares the <tree> and the files on the filesystem.
Unrelated: we ought to remove the dash after "git" here. (Thanks for a reminder.)
Quoted 12 lines
Documentation/git-archive.txt +1
-1@@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git archive' [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>] [-o | --output=<file>] [--worktree-attributes] - [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish> + [--remote=<repo> [--exec=<git-upload-archive>]] <tree> [<path>...] DESCRIPTION
Documentation/git-archive.txt OPTIONS · line 74
Quoted 6 lines
Documentation/git-archive.txt +1
-1@@ -70,7 +70,7 @@ OPTIONS Used with --remote to specify the path to the 'git-upload-archive' on the remote side. -<tree-ish>:: +<tree>:: The tree or commit to produce an archive for.
In this case, it might be less confusing to explicitly say (<commit> | <tree>), since the behavior is:
. commit id and timestamp recorded from commit if a commit is
used
. no commit id and time of invocation (!) recorded if a tree is
used directly
meaning "git archive commit" and "git archive commit^{tree}" do not always have the same behavior.
Documentation/git-commit-tree.txt state was. · line 40
Quoted 9 lines
Documentation/git-commit-tree.txt +2
-1@@ -36,7 +36,8 @@ state was. OPTIONS ------- <tree>:: - An existing tree object + An existing tree object. Unlike other git commands, this must + be an actual tree object, not a commit or tag.
Maybe it would be worth dropping that constraint (in the code) for simplicity?
If not, it would be nice to give a fuller explanation, something to this effect:
An existing tree object. To [reason here], the argument will not be automatically dereferenced to a tree if it names a commit or tag; you must instead specify the tree explicitly, for example by ending the argument with ^{tree}.
Wording could surely be improved.
Quoted 12 lines
Documentation/git-diff-index.txt +1
-1@@ -8,7 +8,7 @@ git-diff-index - Compares content and mode of blobs between the index and reposi SYNOPSIS -------- -'git diff-index' [-m] [--cached] [<common diff options>] <tree-ish> [<path>...] +'git diff-index' [-m] [--cached] [<common diff options>] <tree> [<path>...] DESCRIPTION -----------
Documentation/git-diff-index.txt OPTIONS · line 26
Quoted 6 lines
Documentation/git-diff-index.txt +1
-1@@ -22,7 +22,7 @@ OPTIONS ------- include::diff-options.txt[] -<tree-ish>:: +<tree>:: The id of a tree object to diff against.
Is an arbitrary tree name okay, or only tree ids?
Documentation/git-ls-tree.txt in the current working directory. Note that: · line 39
Quoted 10 lines
Documentation/git-ls-tree.txt +2
-2@@ -35,8 +35,8 @@ in the current working directory. Note that: OPTIONS ------- -<tree-ish>:: - Id of a tree-ish. +<tree>:: + The id of a tree object.
Likewise.
Documentation/git-merge-tree.txt SYNOPSIS · line 15
Quoted 8 lines
Documentation/git-merge-tree.txt +1
-1@@ -12,7 +12,7 @@ SYNOPSIS DESCRIPTION ----------- -Reads three treeish, and output trivial merge results and +Reads three <tree>s, and output trivial merge results and
Since the string "<tree>" does not appear in the synopsis, it seems odd to mention it here. Maybe it would be clearer to say:
SYNOPSIS
git merge-tree <base-tree> <branch1> <branch2>
DESCRIPTION
Reads three trees and outputs trivial merge results and conflicting entries to the standard output. This
or (though I like the previous synopsis much more)
SYNOPSIS
git merge-tree <tree> <tree> <tree>
DESCRIPTION
Reads three trees and outputs trivial merge results and conflicting entries to the standard output. The arguments are in the same order as those for "git read-tree": the first represents the original (basis) state and the other two represent versions with improvements that need to be merged. This
Documentation/git-read-tree.txt OPTIONS · line 122
Quoted 9 lines
Documentation/git-read-tree.txt +1
-1@@ -118,7 +118,7 @@ OPTIONS Instead of reading tree object(s) into the index, just empty it. -<tree-ish#>:: +<tree-#>:: The id of the tree object(s) to be read/merged.
Just "The tree objects to be read or merged", not necessarily named by id, right?
Documentation/git-svn.txt Any other arguments are passed directly to 'git log' · line 318
Quoted 10 lines
Documentation/git-svn.txt +2
-2@@ -314,8 +314,8 @@ Any other arguments are passed directly to 'git log' 'find-rev':: When given an SVN revision number of the form 'rN', returns the corresponding git commit hash (this can optionally be followed by a - tree-ish to specify which branch should be searched). When given a - tree-ish, returns the corresponding SVN revision number. + <tree> to specify which branch should be searched). When given a + <tree>, returns the corresponding SVN revision number.
The placeholder <tree> sounds odd in descriptive text like this. Maybe:
If the first argument is of the form 'rN', prints the corresponding git commit id. An optional second argument can name a commit, to limit the search to commits accessible from that commit.
Otherwise, the first (and only) argument is interpreted as a git tree name and this subcommand prints the corresponding SVN revision number.
Documentation/git-svn.txt Any other arguments are passed directly to 'git log' · line 348
Quoted 6 lines
Documentation/git-svn.txt +1
-1@@ -345,7 +345,7 @@ Any other arguments are passed directly to 'git log' for use after commands like "git checkout" or "git reset". 'commit-diff':: - Commits the diff of two tree-ish arguments from the + Commits the diff of two <tree> arguments from the
Likewise. "Two trees named on the command line" should be clear.
Documentation/git-tar-tree.txt It can be extracted using 'git get-tar-commit-id'. · line 34
Quoted 10 lines
Documentation/git-tar-tree.txt +1
-1@@ -29,7 +29,7 @@ It can be extracted using 'git get-tar-commit-id'. OPTIONS ------- -<tree-ish>:: +<tree>:: The tree or commit to produce tar archive for. If it is the object name of a commit object.
Huh? (Not a problem introduced by this patch, but...)
Quoted 11 lines
Documentation/git.txt +4
-1@@ -469,17 +469,14 @@ Identifier Terminology Indicates a blob object name. <tree>:: - Indicates a tree object name. + Indicates a tree object name, or the name of tag or commit that points + at a tree. A command that takes a <tree> argument ultimately + wants to operate on a tree object but automatically dereferences + tag and commit objects until it finds a tree.
Documentation/git.txt Identifier Terminology · line 482
Quoted 10 lines
Documentation/git.txt +0
-6<commit>:: Indicates a commit object name. -<tree-ish>:: - Indicates a tree, commit or tag object name. A - command that takes a <tree-ish> argument ultimately wants to - operate on a <tree> object but automatically dereferences - <commit> and <tag> objects that point at a <tree>. -
I first read the new description as
Indicates a tree name, or the name of a tag or commit ...
which seemed odd --- this always is a tree name. Maybe
<tree>::
Indicates a parameter specifying a tree, commit, or tag object. A command that takes a <tree> argument ultimately wants to operate on a tree object so it automatically dereferences tag and commit objects until it finds a tree.
Thanks for eliminating the confusing <commit>, <tag>, etc markup.
Documentation/gitcli.txt DESCRIPTION · line 19
Quoted 10 lines
Documentation/gitcli.txt +2
-2@@ -15,8 +15,8 @@ DESCRIPTION This manual describes the convention used throughout git CLI. -Many commands take revisions (most often "commits", but sometimes -"tree-ish", depending on the context and command) and paths as their +Many commands take revisions (most often <commit>s, but sometimes +<tree>s, depending on the context and command) and paths as their
Maybe
Many commands take revisions (most often commits but sometimes trees, depending on the context and command) and paths as their arguments. Here are the rules:
to avoid emphasizing a technicality.
Documentation/gittutorial-2.txt Note, by the way, that lots of commands take a tree as an argument. · line 213
Quoted 12 lines
Documentation/gittutorial-2.txt +2
-4@@ -209,10 +209,8 @@ Note, by the way, that lots of commands take a tree as an argument. But as we can see above, a tree can be referred to in many different ways--by the SHA1 name for that tree, by the name of a commit that refers to the tree, by the name of a branch whose head refers to that -tree, etc.--and most such commands can accept any of these names. - -In command synopses, the word "tree-ish" is sometimes used to -designate such an argument. +tree, etc.--and all such commands can accept any of these names unless +otherwise stated.
... otherwise stated in the manual pages?
Quoted 2 lines
t/t4100/t-apply-3.patch +0
-0
[...]
t/t4100/t-apply-7.patch
Quoted 2 lines
t/t4100/t-apply-7.patch +0
-0
[...]
These last two aren't worth it, I think. :)
I very much like this change. Ideally it should be possible to deal with some of the nontrivial parts first in separate patches before a last trivial one that does not do much more than change tree-ish -> tree.
PATCH v2 7/8 docs: use <commit> instead of <commit-ish>
In reply to Mark LodatoNo git command accepts only a commit and not a commit-ish, so let us remove the latter term from common usage in the documentation in order to reduce the amount of jargon. Note that the terms committish' and commit-ish' were both previously used.
The "ish" terms were left in comments and were added to the glossary.
--- Documentation/git-describe.txt | 14 +++++++------- Documentation/git-fast-import.txt | 22 +++++++++++----------- Documentation/git-name-rev.txt | 2 +- Documentation/git-rebase.txt | 2 +- Documentation/git.txt | 11 ++++------- Documentation/gitcli.txt | 2 +- Documentation/glossary-content.txt | 4 ++++ builtin/describe.c | 4 ++-- builtin/revert.c | 4 ++-- contrib/examples/git-reset.sh | 2 +- contrib/examples/git-revert.sh | 4 ++-- 11 files changed, 36 insertions(+), 35 deletions(-)
Documentation/git-describe.txt +7 -7
@@ -9,7 +9,7 @@ git-describe - Show the most recent tag that is reachable from a commit SYNOPSIS -------- [verse] -'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] <committish>... +'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] <commit>... 'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>] DESCRIPTION
@@ -26,8 +26,8 @@ see the -a and -s options to linkgit:git-tag[1]. OPTIONS ------- -<committish>...:: - Committish object names to describe. +<commit>...:: + Commit object names to describe. --dirty[=<mark>]:: Describe the working tree.
@@ -57,7 +57,7 @@ OPTIONS --candidates=<n>:: Instead of considering only the 10 most recent tags as - candidates to describe the input committish consider + candidates to describe the input commit consider up to <n> candidates. Increasing <n> above 10 will take slightly longer but may produce a more accurate result. An <n> of 0 will cause only exact matches to be output.
@@ -139,7 +139,7 @@ be sufficient to disambiguate these commits. SEARCH STRATEGY --------------- -For each committish supplied, 'git describe' will first look for +For each commit supplied, 'git describe' will first look for a tag which tags exactly that commit. Annotated tags will always be preferred over lightweight tags, and tags with newer dates will always be preferred over tags with older dates. If an exact match
@@ -148,10 +148,10 @@ is found, its name will be output and searching will stop. If an exact match was not found, 'git describe' will walk back through the commit history to locate an ancestor commit which has been tagged. The ancestor's tag will be output along with an -abbreviation of the input committish's SHA1. +abbreviation of the input commit's SHA1. If multiple tags were found during the walk then the tag which -has the fewest commits different from the input committish will be +has the fewest commits different from the input commit will be selected and output. Here fewest commits different is defined as the number of commits which would be shown by `git log tag..input` will be the smallest number of commits possible.
Documentation/git-fast-import.txt +11 -11
@@ -350,8 +350,8 @@ change to the project. ('author' (SP <name>)? SP LT <email> GT SP <when> LF)? 'committer' (SP <name>)? SP LT <email> GT SP <when> LF data - ('from' SP <committish> LF)? - ('merge' SP <committish> LF)? + ('from' SP <commit> LF)? + ('merge' SP <commit> LF)? (filemodify | filedelete | filecopy | filerename | filedeleteall | notemodify)* LF? ....
@@ -428,9 +428,9 @@ as the current commit on that branch is automatically assumed to be the first ancestor of the new commit. As `LF` is not valid in a Git refname or SHA-1 expression, no -quoting or escaping syntax is supported within `<committish>`. +quoting or escaping syntax is supported within `<commit>`. -Here `<committish>` is any of the following: +Here `<commit>` is any of the following: * The name of an existing branch already in fast-import's internal branch table. If fast-import doesn't know the name, it's treated as a SHA-1
@@ -475,7 +475,7 @@ additional ancestors (forming a 16-way merge). For this reason it is suggested that frontends do not use more than 15 `merge` commands per commit; 16, if starting a new, empty branch. -Here `<committish>` is any of the commit specification expressions +Here `<commit>` is any of the commit specification expressions also accepted by `from` (see above). `filemodify`
@@ -649,7 +649,7 @@ External data format:: commit that is to be annotated. + .... - 'N' SP <dataref> SP <committish> LF + 'N' SP <dataref> SP <commit> LF .... + Here `<dataref>` can be either a mark reference (`:<idnum>`)
@@ -662,13 +662,13 @@ Inline data format:: command. + .... - 'N' SP 'inline' SP <committish> LF + 'N' SP 'inline' SP <commit> LF data .... + See below for a detailed description of the `data` command. -In both formats `<committish>` is any of the commit specification +In both formats `<commit>` is any of the commit specification expressions also accepted by `from` (see above). `mark`
@@ -699,7 +699,7 @@ lightweight (non-annotated) tags see the `reset` command below. .... 'tag' SP <name> LF - 'from' SP <committish> LF + 'from' SP <commit> LF 'tagger' (SP <name>)? SP LT <email> GT SP <when> LF data ....
@@ -744,11 +744,11 @@ branch from an existing commit without creating a new commit. .... 'reset' SP <ref> LF - ('from' SP <committish> LF)? + ('from' SP <commit> LF)? LF? .... -For a detailed description of `<ref>` and `<committish>` see above +For a detailed description of `<ref>` and `<commit>` see above under `commit` and `from`. The `LF` after the command is optional (it used to be required).
Documentation/git-name-rev.txt +1 -1
@@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git name-rev' [--tags] [--refs=<pattern>] - ( --all | --stdin | <committish>... ) + ( --all | --stdin | <commit>... ) DESCRIPTION -----------
Documentation/git-rebase.txt +1 -1
@@ -168,7 +168,7 @@ would result in the removal of commits F and G: This is useful if F and G were flawed in some way, or should not be part of topicA. Note that the argument to --onto and the <upstream> -parameter can be any valid commit-ish. +parameter can be any valid <commit>. In case of conflict, 'git rebase' will stop at the first problematic commit and leave conflict markers in the tree. You can use 'git diff' to locate
Documentation/git.txt +4 -7
@@ -475,13 +475,10 @@ Identifier Terminology tag and commit objects until it finds a tree. <commit>:: - Indicates a commit object name. - -<commit-ish>:: - Indicates a commit or tag object name. A - command that takes a <commit-ish> argument ultimately wants to - operate on a <commit> object but automatically dereferences - <tag> objects that point at a <commit>. + Indicates a commit object name, or the name of a tag object that + points at a commit. A command that takes a <commit> argument + ultimately wants to operate on a commit object but automatically + dereferences tag objects until it finds a commit. <type>:: Indicates that an object type is required.
Documentation/gitcli.txt +1 -1
@@ -81,7 +81,7 @@ couple of magic command line options: + --------------------------------------------- $ git describe -h -usage: git describe [options] <committish>... +usage: git describe [options] <commit>... --contains find the tag that comes after the commit --debug debug search strategy on stderr
Documentation/glossary-content.txt +4 -0
@@ -82,6 +82,10 @@ to point at the new commit. to the top <<def_directory,directory>> of the stored revision. +[[def_commit-ish]][[def_committish]]commit-ish / committish:: + A <<def_ref,ref>> pointing to either a <<def_commit_object,commit + object>>, or a <<def_tag_object,tag object>> pointing to a tag or commit object. + [[def_core_git]]core git:: Fundamental data structures and utilities of git. Exposes only limited source code management tools.
builtin/describe.c +2 -2
@@ -12,7 +12,7 @@#define MAX_TAGS (FLAG_BITS - 1)static const char *const describe_usage[] = { -"git describe [options] <committish>..." , +"git describe [options] <commit>..." ,"git describe [options] --dirty" ,NULL };
@@ -462,7 +462,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix) dirty =NULL ;describe ("HEAD" ,1 ); }else if (dirty) { -die ("--dirty is incompatible with committishes" ); +die ("--dirty is incompatible with commits" ); }else {while (argc-- >0 ) {describe (*argv++, argc ==0 );
builtin/revert.c +2 -2
@@ -27,12 +27,12 @@*/ static const char *const revert_usage[] = { -"git revert [options] <commit-ish>" , +"git revert [options] <commit>" ,NULL };static const char *const cherry_pick_usage[] = { -"git cherry-pick [options] <commit-ish>" , +"git cherry-pick [options] <commit>" ,NULL };
contrib/examples/git-reset.sh +1 -1
@@ -2,7 +2,7 @@ # # Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano # -USAGE='[--mixed | --soft | --hard] [<commit-ish>] [ [--] <paths>...]' +USAGE='[--mixed | --soft | --hard] [<commit>] [ [--] <paths>...]' SUBDIRECTORY_OK=Yes . git-sh-setup set_reflog_action "reset $*"
contrib/examples/git-revert.sh +2 -2
@@ -9,12 +9,12 @@ case "$0" in test -t 0 && edit=-e replay= me=revert - USAGE='[--edit | --no-edit] [-n] <commit-ish>' ;; + USAGE='[--edit | --no-edit] [-n] <commit>' ;; *-cherry-pick* ) replay=t edit= me=cherry-pick - USAGE='[--edit] [-n] [-r] [-x] <commit-ish>' ;; + USAGE='[--edit] [-n] [-r] [-x] <commit>' ;; * ) echo >&2 "What are you talking about?" exit 1 ;;
Signature · 1 line
1.7.3.2
Re: [PATCH 7/8] docs: use <commit> instead of <commit-ish>
Documentation/git-describe.txt see the -a and -s options to linkgit:git-tag[1]. · line 30
Quoted 10 lines · Mark Lodato
Documentation/git-describe.txt +2
-2@@ -26,8 +26,8 @@ see the -a and -s options to linkgit:git-tag[1]. OPTIONS ------- -<committish>...:: - Committish object names to describe. +<commit>...:: + Commit object names to describe.
Or even
Commits to describe.
:)
Documentation/git-fast-import.txt change to the project. · line 354
Quoted 10 lines
Documentation/git-fast-import.txt +2
-2@@ -350,8 +350,8 @@ change to the project. ('author' (SP <name>)? SP LT <email> GT SP <when> LF)? 'committer' (SP <name>)? SP LT <email> GT SP <when> LF data - ('from' SP <committish> LF)? - ('merge' SP <committish> LF)? + ('from' SP <commit> LF)? + ('merge' SP <commit> LF)?
As the audience of this manual page is people mostly familiar with other version control systems, it needs to be very explicit. Not sure what the best solution is, just pointing out the worry.
PATCH v2 8/8 describe docs: note that <commit> is optional
In reply to Mark Lodato--- Documentation/git-describe.txt | 3 ++- Documentation/gitcli.txt | 2 +- builtin/describe.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
Documentation/git-describe.txt +2 -1
@@ -9,7 +9,7 @@ git-describe - Show the most recent tag that is reachable from a commit SYNOPSIS -------- [verse] -'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] <commit>... +'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] [<commit>...] 'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>] DESCRIPTION
@@ -28,6 +28,7 @@ OPTIONS ------- <commit>...:: Commit object names to describe. + If not given, defaults to HEAD. --dirty[=<mark>]:: Describe the working tree.
Documentation/gitcli.txt +1 -1
@@ -81,7 +81,7 @@ couple of magic command line options: + --------------------------------------------- $ git describe -h -usage: git describe [options] <commit>... +usage: git describe [options] [<commit>...] --contains find the tag that comes after the commit --debug debug search strategy on stderr
builtin/describe.c +1 -1
@@ -12,7 +12,7 @@#define MAX_TAGS (FLAG_BITS - 1)static const char *const describe_usage[] = { -"git describe [options] <commit>..." , +"git describe [options] [<commit>...]" ,"git describe [options] --dirty" ,NULL };
Signature · 1 line
1.7.3.2
Quoted 3 lines · Mark Lodato
The biggest change is to drop the <tree-ish> and
<commit-ish> (or <committish>) notation and just use <tree> or <commit>, since every command but commit-tree accepts tree-ishes and commit-ishes.
Thanks. I think this will encourage UI consistency ("where you accept a tree, accepts commits and tags, too") as a side effect.
Quoted 4 lines
This is a rework of my earlier patch set from March [1], with the following differences:
- Drop the patch to commit-tree that makes it accept a tree-ish.
Ah, missed this before. It is not clear to me why this difference --- is it just to be conservative about changing behavior?
Quoted 1 line
http://thread.gmane.org/gmane.comp.version-control.git/142078
Quoted 2 lines · Jonathan Nieder
Ah, missed this before. It is not clear to me why this difference --- is it just to be conservative about changing behavior?
Yes. It is clear from the context you mean its tree if you feed a commit to commit-tree, but the original intent of not dereferncing was to avoid mistakes by scripts and people, so you need to make a convincing argument that not derefencing does not help avoiding mistakes, and prove that nobody's script is relying on the current behaviour for type-checking purposes.
Quoted 8 lines · Jonathan Nieder
Quoted 4 lines · Mark Lodato
This is a rework of my earlier patch set from March [1], with the following differences:
- Drop the patch to commit-tree that makes it accept a tree-ish.
Ah, missed this before. It is not clear to me why this difference --- is it just to be conservative about changing behavior?
Exactly. Junio replied to my original email saying he did not think this patch was unsafe, so if you think the patch is a good idea, I'll re-send it.
Quoted 2 lines
Quoted 1 line
http://thread.gmane.org/gmane.comp.version-control.git/142078
As an aside, how do you actually find threads on gmane? I can't find anything on Google.