Some doc-fixes
cover Some doc-fixes
I'm flushing a queue of small fixes to the docs. Handling these indiviually is just to much hassle - at least I hope so :-)
Andreas Heiduk (6):
doc: fix formatting inconsistency in githooks.txt
doc: align 'diff --no-index' in text with synopsis
doc: clarify ignore rules for git ls-files
doc: added '-d' and '-q' for 'git push'
git-svn: commit-diff does not support --add-author-from
doc: add note about shell quoting to revision.txt
Documentation/git-diff.txt | 2 +- Documentation/git-ls-files.txt | 3 ++- Documentation/git-push.txt | 3 ++- Documentation/git-svn.txt | 2 +- Documentation/githooks.txt | 4 ++-- Documentation/revisions.txt | 6 ++++++ 6 files changed, 14 insertions(+), 6 deletions(-)
Signature · 1 line
2.16.2
PATCH 1/6 doc: fix formatting inconsistency in githooks.txt
The section 'post-rewrite' in 'githooks.txt' renders only one command using backticks (git commit) but the other commands using single quotes ('git-rebase'). Align this formatting to use single quotes.
--- Documentation/githooks.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/githooks.txt +2 -2
@@ -417,8 +417,8 @@ to abort. post-rewrite ~~~~~~~~~~~~ -This hook is invoked by commands that rewrite commits (`git commit ---amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call +This hook is invoked by commands that rewrite commits ('git commit +--amend', 'git-rebase'; currently 'git-filter-branch' does 'not' call it!). Its first argument denotes the command it was invoked by: currently one of `amend` or `rebase`. Further command-dependent arguments may be passed in the future.
Signature · 1 line
2.16.2
Re: [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
Quoted 14 lines · Andreas Heiduk
The section 'post-rewrite' in 'githooks.txt' renders only one command using backticks (
git commit) but the other commands using single quotes ('git-rebase'). Align this formatting to use single quotes.Signed-off-by Andreas Heiduk <[email protected]>--- Documentation/githooks.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/githooks.txt +0
-0
Documentation/githooks.txt to abort. · line 424
Quoted 10 lines
Documentation/githooks.txt +2
-2@@ -417,8 +417,8 @@ to abort. post-rewrite ~~~~~~~~~~~~ -This hook is invoked by commands that rewrite commits (`git commit ---amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call +This hook is invoked by commands that rewrite commits ('git commit +--amend', 'git-rebase'; currently 'git-filter-branch' does 'not' call it!). Its first argument denotes the command it was invoked by: currently one of `amend` or `rebase`. Further command-dependent arguments may be passed in the future.
Hmm, I wonder if that is actually intentional. git commit --amend could be run exactly like that and would do what this paragraph expects of it. The 'git-rebase' is a Git subcommand name, i.e., not some copy-paste command-line ready for use. If it were something like git rebase -i HEAD~5, I would expect the backticks.
A second discrepancy is the dash in "git commit" vs "git-rebase" and "git-ls-remote". That could perhaps be explained by the same reasoning.
Martin
Re: [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
Am 10.04.2018 um 21:13 schrieb Martin Ågren:
Quoted 18 lines · Andreas Heiduk
Quoted 17 lines
The section 'post-rewrite' in 'githooks.txt' renders only one command using backticks (
git commit) but the other commands using single quotes ('git-rebase'). Align this formatting to use single quotes.Signed-off-by Andreas Heiduk <[email protected]>--- Documentation/githooks.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/githooks.txt +0
-0@@ -417,8 +417,8 @@ to abort. post-rewrite ~~~~~~~~~~~~
Quoted 13 lines
Documentation/githooks.txt to abort. · line 424
Quoted 7 lines
Documentation/githooks.txt +2
-2-This hook is invoked by commands that rewrite commits (`git commit ---amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call +This hook is invoked by commands that rewrite commits ('git commit +--amend', 'git-rebase'; currently 'git-filter-branch' does 'not' call it!). Its first argument denotes the command it was invoked by: currently one of `amend` or `rebase`. Further command-dependent arguments may be passed in the future.Hmm, I wonder if that is actually intentional.
git commit --amendcould be run exactly like that and would do what this paragraph expects of it. The 'git-rebase' is a Git subcommand name, i.e., not some copy-paste command-line ready for use. If it were something likegit rebase -i HEAD~5, I would expect the backticks.
That page mostly uses single quotes and no dash ('git send-email')for formatting. Reading 'CodingGuidelines' my understanding is, that git commands should be typeset with backticks, no dash (git send-email). So 'git-rebase' (an similar) *should* be typeset as git rebase. But doing so consistently would be a full-diff for this manual page.
Should I do this?
Quoted 6 lines
A second discrepancy is the dash in "git commit" vs "git-rebase" and "git-ls-remote". That could perhaps be explained by the same reasoning.
Martin
Re: [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
Quoted 8 lines · Andreas Heiduk
Am 10.04.2018 um 21:13 schrieb Martin Ågren:
Quoted 6 lines · Andreas Heiduk
Hmm, I wonder if that is actually intentional.
git commit --amendcould be run exactly like that and would do what this paragraph expects of it. The 'git-rebase' is a Git subcommand name, i.e., not some copy-paste command-line ready for use. If it were something likegit rebase -i HEAD~5, I would expect the backticks.
Quoted 7 lines
That page mostly uses single quotes and no dash ('git send-email')for formatting. Reading 'CodingGuidelines' my understanding is, that git commands should be typeset with backticks, no dash (
git send-email). So 'git-rebase' (an similar) *should* be typeset asgit rebase. But doing so consistently would be a full-diff for this manual page.Should I do this?
Your reading seems correct, so I was wrong in my speculation. My guess is such a patch would be welcome. I checked a couple of man-pages and this one seems particularly heavy on 'git foo' as opposed to git foo. I think that's a reason to fix it, not to leave it behind.
Martin
Re: [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
Quoted 4 lines · Martin Ågren
Your reading seems correct, so I was wrong in my speculation. My guess is such a patch would be welcome. I checked a couple of man-pages and this one seems particularly heavy on 'git foo' as opposed to
git foo. I think that's a reason to fix it, not to leave it behind.
Sounds sensible. Hopefully there isn't a topic in flight that wants to change this file, so it may be a good time to do a wholesale cleanup of it.
Re: [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
So the following two fixups should cleanup that page considerably.
fixup! [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
- add linkgit: to callers of hooks
- change 'git-foo' and similar to git foo
- add some more `` for fsmonitor
--- Documentation/githooks.txt | 101 +++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 50 deletions(-)
Documentation/githooks.txt +51 -50
@@ -31,7 +31,7 @@ Hooks can get their arguments via the environment, command-line arguments, and stdin. See the documentation for each hook below for details. -'git init' may copy hooks to the new repository, depending on its +`git init` may copy hooks to the new repository, depending on its configuration. See the "TEMPLATE DIRECTORY" section in linkgit:git-init[1] for details. When the rest of this document refers to "default hooks" it's talking about the default template shipped
@@ -45,9 +45,9 @@ HOOKS applypatch-msg ~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes a single +This hook is invoked by linkgit:git-am[1]. It takes a single parameter, the name of the file that holds the proposed commit -log message. Exiting with a non-zero status causes 'git am' to abort +log message. Exiting with a non-zero status causes `git am` to abort before applying the patch. The hook is allowed to edit the message file in place, and can
@@ -61,7 +61,7 @@ The default 'applypatch-msg' hook, when enabled, runs the pre-applypatch ~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes no parameter, and is +This hook is invoked by linkgit:git-am[1]. It takes no parameter, and is invoked after the patch is applied, but before a commit is made. If it exits with non-zero status, then the working tree will not be
@@ -76,7 +76,7 @@ The default 'pre-applypatch' hook, when enabled, runs the post-applypatch ~~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes no parameter, +This hook is invoked by linkgit:git-am[1]. It takes no parameter, and is invoked after the patch is applied and a commit is made. This hook is meant primarily for notification, and cannot affect
@@ -85,24 +85,24 @@ the outcome of 'git am'. pre-commit ~~~~~~~~~~ -This hook is invoked by 'git commit', and can be bypassed +This hook is invoked by linkgit:git-commit[1], and can be bypassed with the `--no-verify` option. It takes no parameters, and is invoked before obtaining the proposed commit log message and making a commit. Exiting with a non-zero status from this script -causes the 'git commit' command to abort before creating a commit. +causes the `git commit` command to abort before creating a commit. The default 'pre-commit' hook, when enabled, catches introduction of lines with trailing whitespaces and aborts the commit when such a line is found. -All the 'git commit' hooks are invoked with the environment +All the `git commit` hooks are invoked with the environment variable `GIT_EDITOR=:` if the command will not bring up an editor to modify the commit message. prepare-commit-msg ~~~~~~~~~~~~~~~~~~ -This hook is invoked by 'git commit' right after preparing the +This hook is invoked by linkgit:git-commit[1] right after preparing the default log message, and before the editor is started. It takes one to three parameters. The first is the name of the file
@@ -114,7 +114,7 @@ commit is a merge or a `.git/MERGE_MSG` file exists); `squash` (if a `.git/SQUASH_MSG` file exists); or `commit`, followed by a commit SHA-1 (if a `-c`, `-C` or `--amend` option was given). -If the exit status is non-zero, 'git commit' will abort. +If the exit status is non-zero, `git commit` will abort. The purpose of the hook is to edit the message file in place, and it is not suppressed by the `--no-verify` option. A non-zero exit
@@ -127,7 +127,7 @@ help message found in the commented portion of the commit template. commit-msg ~~~~~~~~~~ -This hook is invoked by 'git commit' and 'git merge', and can be +This hook is invoked by linkgit:git-commit[1] and linkgit:git-merge[1], and can be bypassed with the `--no-verify` option. It takes a single parameter, the name of the file that holds the proposed commit log message. Exiting with a non-zero status causes the command to abort.
@@ -143,16 +143,16 @@ The default 'commit-msg' hook, when enabled, detects duplicate post-commit ~~~~~~~~~~~ -This hook is invoked by 'git commit'. It takes no parameters, and is +This hook is invoked by linkgit:git-commit[1]. It takes no parameters, and is invoked after a commit is made. This hook is meant primarily for notification, and cannot affect -the outcome of 'git commit'. +the outcome of `git commit`. pre-rebase ~~~~~~~~~~ -This hook is called by 'git rebase' and can be used to prevent a +This hook is called by linkgit:git-rebase[1] and can be used to prevent a branch from getting rebased. The hook may be called with one or two parameters. The first parameter is the upstream from which the series was forked. The second parameter is the branch being
@@ -161,17 +161,17 @@ rebased, and is not set when rebasing the current branch. post-checkout ~~~~~~~~~~~~~ -This hook is invoked when a 'git checkout' is run after having updated the +This hook is invoked when a linkgit:git-checkout[1] is run after having updated the worktree. The hook is given three parameters: the ref of the previous HEAD, the ref of the new HEAD (which may or may not have changed), and a flag indicating whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). -This hook cannot affect the outcome of 'git checkout'. +This hook cannot affect the outcome of `git checkout`. -It is also run after 'git clone', unless the --no-checkout (-n) option is +It is also run after linkgit:git-clone[1], unless the `--no-checkout` (`-n`) option is used. The first parameter given to the hook is the null-ref, the second the -ref of the new HEAD and the flag is always 1. Likewise for 'git worktree add' -unless --no-checkout is used. +ref of the new HEAD and the flag is always 1. Likewise for `git worktree add` +unless `--no-checkout` is used. This hook can be used to perform repository validity checks, auto-display differences from the previous HEAD if different, or set working dir metadata
@@ -180,10 +180,10 @@ properties. post-merge ~~~~~~~~~~ -This hook is invoked by 'git merge', which happens when a 'git pull' +This hook is invoked by linkgit:git-merge[1], which happens when a `git pull` is done on a local repository. The hook takes a single parameter, a status flag specifying whether or not the merge being done was a squash merge. -This hook cannot affect the outcome of 'git merge' and is not executed, +This hook cannot affect the outcome of `git merge` and is not executed, if the merge failed due to conflicts. This hook can be used in conjunction with a corresponding pre-commit hook to
@@ -194,7 +194,7 @@ for an example of how to do this. pre-push ~~~~~~~~ -This hook is called by 'git push' and can be used to prevent a push from taking +This hook is called by linkgit:git-push[1] and can be used to prevent a push from taking place. The hook is called with two parameters which provide the name and location of the destination remote, if a named remote is not being used both values will be the same.
@@ -216,7 +216,7 @@ SHA-1>` will be 40 `0`. If the local commit was specified by something other than a name which could be expanded (such as `HEAD~`, or a SHA-1) it will be supplied as it was originally given. -If this hook exits with a non-zero status, 'git push' will abort without +If this hook exits with a non-zero status, `git push` will abort without pushing anything. Information about why the push is rejected may be sent to the user by writing to standard error.
@@ -224,8 +224,8 @@ to the user by writing to standard error. pre-receive ~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. Just before starting to update refs on the remote repository, the pre-receive hook is invoked. Its exit status determines the success or failure of the update.
@@ -246,7 +246,7 @@ updated. If the hook exits with zero, updating of individual refs can still be prevented by the <<update,'update'>> hook. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The number of push options given on the command line of
@@ -265,8 +265,8 @@ linkgit:git-receive-pack[1] for some caveats. update ~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. Just before updating the ref on the remote repository, the update hook is invoked. Its exit status determines the success or failure of the ref update.
@@ -279,7 +279,7 @@ three parameters: - and the new object name to be stored in the ref. A zero exit from the update hook allows the ref to be updated. -Exiting with a non-zero status prevents 'git-receive-pack' +Exiting with a non-zero status prevents `git receive-pack` from updating that ref. This hook can be used to prevent 'forced' update on certain refs by
@@ -299,7 +299,7 @@ membership. See linkgit:git-shell[1] for how you might use the login shell to restrict the user's access to only git commands. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The default 'update' hook, when enabled--and with
@@ -310,8 +310,8 @@ unannotated tags to be pushed. post-receive ~~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. It executes on the remote repository once after all the refs have been updated.
@@ -320,7 +320,7 @@ arguments, but gets the same information as the <<pre-receive,'pre-receive'>> hook does on its standard input. -This hook does not affect the outcome of 'git-receive-pack', as it +This hook does not affect the outcome of `git receive-pack`, as it is called after the real work is done. This supersedes the <<post-update,'post-update'>> hook in that it gets
@@ -328,7 +328,7 @@ both old and new values of all the refs in addition to their names. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The default 'post-receive' hook is empty, but there is
@@ -349,8 +349,8 @@ will be set to zero, `GIT_PUSH_OPTION_COUNT=0`. post-update ~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. It executes on the remote repository once after all the refs have been updated.
@@ -358,7 +358,7 @@ It takes a variable number of parameters, each of which is the name of ref that was actually updated. This hook is meant primarily for notification, and cannot affect -the outcome of 'git-receive-pack'. +the outcome of `git receive-pack`. The 'post-update' hook can tell what are the heads that were pushed, but it does not know what their original and updated values are,
@@ -368,20 +368,20 @@ updated values of the refs. You might consider it instead if you need them. When enabled, the default 'post-update' hook runs -'git update-server-info' to keep the information used by dumb +`git update-server-info` to keep the information used by dumb transports (e.g., HTTP) up to date. If you are publishing a Git repository that is accessible via HTTP, you should probably enable this hook. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. push-to-checkout ~~~~~~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository, and when +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository, and when the push tries to update the branch that is currently checked out and the `receive.denyCurrentBranch` configuration variable is set to `updateInstead`. Such a push by default is refused if the working
@@ -410,15 +410,16 @@ with the difference between the branches. pre-auto-gc ~~~~~~~~~~~ -This hook is invoked by 'git gc --auto'. It takes no parameter, and -exiting with non-zero status from this script causes the 'git gc --auto' +This hook is invoked by `git gc --auto` (see linkgit:git-gc[1]). It takes no parameter, and +exiting with non-zero status from this script causes the `git gc --auto` to abort. post-rewrite ~~~~~~~~~~~~ -This hook is invoked by commands that rewrite commits ('git commit ---amend', 'git-rebase'; currently 'git-filter-branch' does 'not' call +This hook is invoked by commands that rewrite commits +(linkgit:git-commit[1] when called with `--amend` and +linkgit:git-rebase[1]; currently `git filter-branch` does 'not' call it!). Its first argument denotes the command it was invoked by: currently one of `amend` or `rebase`. Further command-dependent arguments may be passed in the future.
@@ -450,16 +451,16 @@ processed by rebase. sendemail-validate ~~~~~~~~~~~~~~~~~~ -This hook is invoked by 'git send-email'. It takes a single parameter, +This hook is invoked by linkgit:git-send-email[1]. It takes a single parameter, the name of the file that holds the e-mail to be sent. Exiting with a -non-zero status causes 'git send-email' to abort before sending any +non-zero status causes `git send-email` to abort before sending any e-mails. fsmonitor-watchman ~~~~~~~~~~~~~~~~~~ -This hook is invoked when the configuration option core.fsmonitor is -set to .git/hooks/fsmonitor-watchman. It takes two arguments, a version +This hook is invoked when the configuration option `core.fsmonitor` is +set to `.git/hooks/fsmonitor-watchman`. It takes two arguments, a version (currently 1) and the time in elapsed nanoseconds since midnight, January 1, 1970.
@@ -478,7 +479,7 @@ directories are checked for untracked files based on the path names given. An optimized way to tell git "all files have changed" is to return -the filename '/'. +the filename `/`. The exit status determines whether git will use the data from the hook to limit its search. On error, it will fall back to verifying
Signature · 1 line
2.16.2
fixup! [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
- reflow some paragraphs
--- Documentation/githooks.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Documentation/githooks.txt +7 -7
@@ -194,10 +194,10 @@ for an example of how to do this. pre-push ~~~~~~~~ -This hook is called by linkgit:git-push[1] and can be used to prevent a push from taking -place. The hook is called with two parameters which provide the name and -location of the destination remote, if a named remote is not being used both -values will be the same. +This hook is called by linkgit:git-push[1] and can be used to prevent +a push from taking place. The hook is called with two parameters +which provide the name and location of the destination remote, if a +named remote is not being used both values will be the same. Information about what is to be pushed is provided on the hook's standard input with lines of the form:
@@ -410,9 +410,9 @@ with the difference between the branches. pre-auto-gc ~~~~~~~~~~~ -This hook is invoked by `git gc --auto` (see linkgit:git-gc[1]). It takes no parameter, and -exiting with non-zero status from this script causes the `git gc --auto` -to abort. +This hook is invoked by `git gc --auto` (see linkgit:git-gc[1]). It +takes no parameter, and exiting with non-zero status from this script +causes the `git gc --auto` to abort. post-rewrite ~~~~~~~~~~~~
Signature · 1 line
2.16.2
Re: fixup! [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
Quoted 4 lines · Andreas Heiduk
- reflow some paragraphs
--- Documentation/githooks.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
I have reviewed the resulting githooks.txt. See the diff below for two more instances that I found. For the second hunk, I have difficulties parsing that paragraph, but I still claim those should be backticks and *git* read-tree...
Martin
Documentation/githooks.txt +0 -0
@@ -80,7 +80,7 @@ This hook is invoked by linkgit:git-am[1]. It takes
no parameter,
and is invoked after the patch is applied and a commit is made.
This hook is meant primarily for notification, and cannot affect
-the outcome of 'git am'.
+the outcome of git am.
pre-commit
~~~~~~~~~~
@@ -400,8 +400,8 @@ when the tip of the current branch is updated to the new commit, and
exit with a zero status.
For example, the hook can simply run git read-tree -u -m HEAD "$1"
-in order to emulate 'git fetch' that is run in the reverse direction -with git push, as the two-tree form of read-tree -u -m is +in order to emulate git fetch that is run in the reverse direction +with git push, as the two-tree form of git read-tree -u -m is
essentially the same as git checkout that switches branches while keeping the local changes in the working tree that do not interfere with the difference between the branches.
Re: fixup! [PATCH 1/6] doc: fix formatting inconsistency in githooks.txt
Am 12.04.2018 um 21:36 schrieb Martin Ågren:
Quoted 6 lines · Andreas Heiduk
Quoted 4 lines
- reflow some paragraphs
--- Documentation/githooks.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Quoted 6 lines
I have reviewed the resulting githooks.txt. See the diff below for two more instances that I found. For the second hunk, I have difficulties parsing that paragraph, but I still claim those should be backticks and *git* read-tree...
Martin
I've added the fixes for the next reroll and put you into a Reviewed-by Trailer :-)
Andreas
PATCH 2/6 doc: align 'diff --no-index' in text with synopsis
In reply to Andreas HeidukComparing
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the --options part to the same place where the other variants show them.
All three items are already correct in the synopsis.
--- Documentation/git-diff.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-diff.txt +1 -1
@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. -'git diff' --no-index [--options] [--] [<path>...]:: +'git diff' [--options] [--no-index] [--] <path> <path>:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when
Signature · 1 line
2.16.2
Re: [PATCH 2/6] doc: align 'diff --no-index' in text with synopsis
Quoted 4 lines · Andreas Heiduk
Comparing
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the--optionspart to the same place where the other variants show them.
That first line should probably not be there. The diff LGTM.
Martin
Re: [PATCH 2/6] doc: align 'diff --no-index' in text with synopsis
Am 10.04.2018 um 21:14 schrieb Martin Ågren:
Quoted 7 lines · Andreas Heiduk
Quoted 1 line
Comparing
That first line should probably not be there. The diff LGTM.
Martin
ACK, Thanks
Re: [PATCH 2/6] doc: align 'diff --no-index' in text with synopsis
In reply to Andreas HeidukDocumentation/git-diff.txt two blob objects, or changes between two files on disk. · line 35
Quoted 6 lines · Andreas Heiduk
-'git diff' --no-index [--options] [--] [<path>...]::
+'git diff' [--options] [--no-index] [--] <path> <path>::Documentation/git-diff.txt +0
-0This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when
It definitely is a good change to show two (and only two) <path> on the command line as non-optional arguments.
I however find the change to mark that -"-no-index" is optional is inviting more confusion in the form presented in this patch. It is optional under specific conditions, and that is not conveyed with these two path arguments named very genericly (as opposed to making it clear that they are paths that are not managed by Git) on the example command line.
I have a suspicion that it would be safer to have the description say under what condition "--no-index" becomes optional (which our text already does), without marking it as if it is always optional like this patch does (i.e. do not lose [] around it from this line). I dunno.
fixup! [PATCH 2/6] doc: align 'diff --no-index' in text with synopsis
--- Documentation/git-diff.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/git-diff.txt +2 -2
@@ -13,7 +13,7 @@ SYNOPSIS 'git diff' [options] --cached [<commit>] [--] [<path>...] 'git diff' [options] <commit> <commit> [--] [<path>...] 'git diff' [options] <blob> <blob> -'git diff' [options] [--no-index] [--] <path> <path> +'git diff' [options] --no-index [--] <path> <path> DESCRIPTION -----------
@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. -'git diff' [--options] [--no-index] [--] <path> <path>:: +'git diff' [--options] --no-index [--] <path> <path>:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when
Signature · 1 line
2.16.2
PATCH 3/6 doc: clarify ignore rules for git ls-files
In reply to Andreas HeidukExplain that git ls-files --ignored requires at least one of the --exclude* options to do its job.
--- Documentation/git-ls-files.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/git-ls-files.txt +2 -1
@@ -53,7 +53,8 @@ OPTIONS Show only ignored files in the output. When showing files in the index, print only those matched by an exclude pattern. When showing "other" files, show only those matched by an exclude - pattern. + pattern. Standard ignore rules are not automatically activated, + therefore at least one of the `--exclude*` options is required. -s:: --stage::
Signature · 1 line
2.16.2
PATCH 4/6 doc: added '-d' and '-q' for 'git push'
In reply to Andreas HeidukAdd the missing -o shortcut for --push-option to the synposis. Add the missing -d shortcut for --delete in the main section.
--- Documentation/git-push.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/git-push.txt +2 -1
@@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git push' [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose] - [-u | --set-upstream] [--push-option=<string>] + [-u | --set-upstream] [-o <string> | --push-option=<string>] [--[no-]signed|--signed=(true|false|if-asked)] [--force-with-lease[=<refname>[:<expect>]]] [--no-verify] [<repository> [<refspec>...]]
@@ -123,6 +123,7 @@ already exists on the remote side. will be tab-separated and sent to stdout instead of stderr. The full symbolic names of the refs will be given. +-d:: --delete:: All listed refs are deleted from the remote repository. This is the same as prefixing all refs with a colon.
Signature · 1 line
2.16.2
Re: [PATCH 4/6] doc: added '-d' and '-q' for 'git push'
Quoted 2 lines · Andreas Heiduk
Add the missing
-oshortcut for--push-optionto the synposis. Add the missing-dshortcut for--deletein the main section.
s/synposis/synopsis/
The subject of this patch says -q, which should be -o. The subject could also be in imperative ("doc: add ...", or "doc: add missing ..."). The diff LGTM.
Martin
Re: [PATCH 4/6] doc: added '-d' and '-q' for 'git push'
Am 10.04.2018 um 21:17 schrieb Martin Ågren:
Quoted 12 lines · Andreas Heiduk
Quoted 2 lines
Add the missing
-oshortcut for--push-optionto the synposis. Add the missing-dshortcut for--deletein the main section.s/synposis/synopsis/
The subject of this patch says -q, which should be -o. The subject could also be in imperative ("doc: add ...", or "doc: add missing ..."). The diff LGTM.
Martin
ACK & Thanks,
Can I add "Reviewed-by: $YOU" to this one and 2/6?
Andreas
Re: [PATCH 4/6] doc: added '-d' and '-q' for 'git push'
Quoted 1 line · Andreas Heiduk
Can I add "Reviewed-by: $YOU" to this one and 2/6?
Sure!
PATCH 5/6 git-svn: commit-diff does not support --add-author-from
In reply to Andreas Heiduk--- Documentation/git-svn.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-svn.txt +1 -1
@@ -700,7 +700,7 @@ creating the branch or tag. config key: svn.useLogAuthor --add-author-from:: - When committing to svn from Git (as part of 'commit-diff', 'set-tree' or 'dcommit' + When committing to svn from Git (as part of 'set-tree' or 'dcommit' operations), if the existing log message doesn't already have a `From:` or `Signed-off-by:` line, append a `From:` line based on the Git commit's author string. If you use this, then `--use-log-author`
Signature · 1 line
2.16.2
Re: [PATCH 5/6] git-svn: commit-diff does not support --add-author-from
Quoted 1 line · Andreas Heiduk
Signed-off-by Andreas Heiduk <[email protected]>
Thanks.
And pushed for Junio:
The following changes since commit fe0a9eaf31dd0c349ae4308498c33a5c3794b293:
Merge branch 'svn/authors-prog-2' of git://bogomips.org/git-svn (2018-04-12 08:05:28 +0900)
are available in the Git repository at:
git://bogomips.org/git-svn.git svn/doc
for you to fetch changes up to ceb4d16198586f110aad5fbbd7eb68eec7a0c5cd:
git-svn: commit-diff does not support --add-author-from (2018-04-16 21:24:30 +0000)
----------------------------------------------------------------
Andreas Heiduk (1):
git-svn: commit-diff does not support --add-author-from
Documentation/git-svn.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH 5/6] git-svn: commit-diff does not support --add-author-from
Am 17.04.2018 um 08:18 schrieb Eric Wong:
Quoted 7 lines
Quoted 1 line · Andreas Heiduk
Signed-off-by Andreas Heiduk <[email protected]>Thanks.
Signed-off-by Eric Wong <[email protected]>And pushed for Junio:
[...]
I'd like to keep the patches together, so I borrow your 'Signed-off-By' from the commit and do a complete reroll of this mini-series.
PATCH 6/6 doc: add note about shell quoting to revision.txt
In reply to Andreas Heiduk--- Documentation/revisions.txt | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/revisions.txt +6 -0
@@ -7,6 +7,10 @@ syntax. Here are various ways to spell object names. The ones listed near the end of this list name trees and blobs contained in a commit. +NOTE: This document shows the "raw" syntax as seen by git. The shell +and other UIs might require additional quoting to protect special +characters and to avoid word splitting. + '<sha1>', e.g. 'dae86e1950b1277e545cee180551750029cfe735', 'dae86e':: The full SHA-1 object name (40-byte hexadecimal string), or a leading substring that is unique within the repository.
@@ -186,6 +190,8 @@ existing tag object. is matched. ':/!-foo' performs a negative match, while ':/!!foo' matches a literal '!' character, followed by 'foo'. Any other sequence beginning with ':/!' is reserved for now. + Depending on the given text the shell's word splitting rules might + require additional quoting. '<rev>:<path>', e.g. 'HEAD:README', ':README', 'master:./README':: A suffix ':' followed by a path names the blob or tree
Signature · 1 line
2.16.2
Re: [PATCH 6/6] doc: add note about shell quoting to revision.txt
Quoted 21 lines · Andreas Heiduk
Signed-off-by Andreas Heiduk <[email protected]>--- Documentation/revisions.txt | 6 ++++++ 1 file changed, 6 insertions(+)Documentation/revisions.txt +4
-0@@ -7,6 +7,10 @@ syntax. Here are various ways to spell object names. The ones listed near the end of this list name trees and blobs contained in a commit. +NOTE: This document shows the "raw" syntax as seen by git. The shell +and other UIs might require additional quoting to protect special +characters and to avoid word splitting. + '<sha1>', e.g. 'dae86e1950b1277e545cee180551750029cfe735', 'dae86e':: The full SHA-1 object name (40-byte hexadecimal string), or a leading substring that is unique within the repository.
Documentation/revisions.txt existing tag object. · line 197
Quoted 8 lines
Documentation/revisions.txt +2
-0@@ -186,6 +190,8 @@ existing tag object. is matched. ':/!-foo' performs a negative match, while ':/!!foo' matches a literal '!' character, followed by 'foo'. Any other sequence beginning with ':/!' is reserved for now. + Depending on the given text the shell's word splitting rules might + require additional quoting. '<rev>:<path>', e.g. 'HEAD:README', ':README', 'master:./README':: A suffix ':' followed by a path names the blob or tree
I've seen this suggested before and thought it is a good idea. GOod to see it is finally happening ;-) Thanks.
v2 cover Some doc-fixes
In reply to Andreas HeidukThis reroll incorporates the comments of the first version, including a "large scale" rewrtie of githooks.txt. I'v added "Reviewed-by" and "Signed-off-by" as appropriate.
Andreas Heiduk (6):
doc: improve formatting in githooks.txt
doc: align 'diff --no-index' in text with synopsis
doc: clarify ignore rules for git ls-files
doc: add '-d' and '-o' for 'git push'
git-svn: remove ''--add-author-from' for 'commit-diff'
doc: add note about shell quoting to revision.txt
Documentation/git-diff.txt | 4 +- Documentation/git-ls-files.txt | 3 +- Documentation/git-push.txt | 3 +- Documentation/git-svn.txt | 2 +- Documentation/githooks.txt | 115 +++++++++++++++++++++-------------------- Documentation/revisions.txt | 6 +++ 6 files changed, 71 insertions(+), 62 deletions(-)
Signature · 1 line
2.16.2
PATCH v2 1/6 doc: improve formatting in githooks.txt
Typeset commands and similar things with as git foo instead of 'git foo' or 'git-foo' and add linkgit to the commands which run the hooks.
--- Documentation/githooks.txt | 115 +++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 57 deletions(-)
Documentation/githooks.txt +58 -57
@@ -31,7 +31,7 @@ Hooks can get their arguments via the environment, command-line arguments, and stdin. See the documentation for each hook below for details. -'git init' may copy hooks to the new repository, depending on its +`git init` may copy hooks to the new repository, depending on its configuration. See the "TEMPLATE DIRECTORY" section in linkgit:git-init[1] for details. When the rest of this document refers to "default hooks" it's talking about the default template shipped
@@ -45,9 +45,9 @@ HOOKS applypatch-msg ~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes a single +This hook is invoked by linkgit:git-am[1]. It takes a single parameter, the name of the file that holds the proposed commit -log message. Exiting with a non-zero status causes 'git am' to abort +log message. Exiting with a non-zero status causes `git am` to abort before applying the patch. The hook is allowed to edit the message file in place, and can
@@ -61,7 +61,7 @@ The default 'applypatch-msg' hook, when enabled, runs the pre-applypatch ~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes no parameter, and is +This hook is invoked by linkgit:git-am[1]. It takes no parameter, and is invoked after the patch is applied, but before a commit is made. If it exits with non-zero status, then the working tree will not be
@@ -76,33 +76,33 @@ The default 'pre-applypatch' hook, when enabled, runs the post-applypatch ~~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes no parameter, +This hook is invoked by linkgit:git-am[1]. It takes no parameter, and is invoked after the patch is applied and a commit is made. This hook is meant primarily for notification, and cannot affect -the outcome of 'git am'. +the outcome of `git am`. pre-commit ~~~~~~~~~~ -This hook is invoked by 'git commit', and can be bypassed +This hook is invoked by linkgit:git-commit[1], and can be bypassed with the `--no-verify` option. It takes no parameters, and is invoked before obtaining the proposed commit log message and making a commit. Exiting with a non-zero status from this script -causes the 'git commit' command to abort before creating a commit. +causes the `git commit` command to abort before creating a commit. The default 'pre-commit' hook, when enabled, catches introduction of lines with trailing whitespaces and aborts the commit when such a line is found. -All the 'git commit' hooks are invoked with the environment +All the `git commit` hooks are invoked with the environment variable `GIT_EDITOR=:` if the command will not bring up an editor to modify the commit message. prepare-commit-msg ~~~~~~~~~~~~~~~~~~ -This hook is invoked by 'git commit' right after preparing the +This hook is invoked by linkgit:git-commit[1] right after preparing the default log message, and before the editor is started. It takes one to three parameters. The first is the name of the file
@@ -114,7 +114,7 @@ commit is a merge or a `.git/MERGE_MSG` file exists); `squash` (if a `.git/SQUASH_MSG` file exists); or `commit`, followed by a commit SHA-1 (if a `-c`, `-C` or `--amend` option was given). -If the exit status is non-zero, 'git commit' will abort. +If the exit status is non-zero, `git commit` will abort. The purpose of the hook is to edit the message file in place, and it is not suppressed by the `--no-verify` option. A non-zero exit
@@ -127,7 +127,7 @@ help message found in the commented portion of the commit template. commit-msg ~~~~~~~~~~ -This hook is invoked by 'git commit' and 'git merge', and can be +This hook is invoked by linkgit:git-commit[1] and linkgit:git-merge[1], and can be bypassed with the `--no-verify` option. It takes a single parameter, the name of the file that holds the proposed commit log message. Exiting with a non-zero status causes the command to abort.
@@ -143,16 +143,16 @@ The default 'commit-msg' hook, when enabled, detects duplicate post-commit ~~~~~~~~~~~ -This hook is invoked by 'git commit'. It takes no parameters, and is +This hook is invoked by linkgit:git-commit[1]. It takes no parameters, and is invoked after a commit is made. This hook is meant primarily for notification, and cannot affect -the outcome of 'git commit'. +the outcome of `git commit`. pre-rebase ~~~~~~~~~~ -This hook is called by 'git rebase' and can be used to prevent a +This hook is called by linkgit:git-rebase[1] and can be used to prevent a branch from getting rebased. The hook may be called with one or two parameters. The first parameter is the upstream from which the series was forked. The second parameter is the branch being
@@ -161,17 +161,17 @@ rebased, and is not set when rebasing the current branch. post-checkout ~~~~~~~~~~~~~ -This hook is invoked when a 'git checkout' is run after having updated the +This hook is invoked when a linkgit:git-checkout[1] is run after having updated the worktree. The hook is given three parameters: the ref of the previous HEAD, the ref of the new HEAD (which may or may not have changed), and a flag indicating whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). -This hook cannot affect the outcome of 'git checkout'. +This hook cannot affect the outcome of `git checkout`. -It is also run after 'git clone', unless the --no-checkout (-n) option is +It is also run after linkgit:git-clone[1], unless the `--no-checkout` (`-n`) option is used. The first parameter given to the hook is the null-ref, the second the -ref of the new HEAD and the flag is always 1. Likewise for 'git worktree add' -unless --no-checkout is used. +ref of the new HEAD and the flag is always 1. Likewise for `git worktree add` +unless `--no-checkout` is used. This hook can be used to perform repository validity checks, auto-display differences from the previous HEAD if different, or set working dir metadata
@@ -180,10 +180,10 @@ properties. post-merge ~~~~~~~~~~ -This hook is invoked by 'git merge', which happens when a 'git pull' +This hook is invoked by linkgit:git-merge[1], which happens when a `git pull` is done on a local repository. The hook takes a single parameter, a status flag specifying whether or not the merge being done was a squash merge. -This hook cannot affect the outcome of 'git merge' and is not executed, +This hook cannot affect the outcome of `git merge` and is not executed, if the merge failed due to conflicts. This hook can be used in conjunction with a corresponding pre-commit hook to
@@ -194,10 +194,10 @@ for an example of how to do this. pre-push ~~~~~~~~ -This hook is called by 'git push' and can be used to prevent a push from taking -place. The hook is called with two parameters which provide the name and -location of the destination remote, if a named remote is not being used both -values will be the same. +This hook is called by linkgit:git-push[1] and can be used to prevent +a push from taking place. The hook is called with two parameters +which provide the name and location of the destination remote, if a +named remote is not being used both values will be the same. Information about what is to be pushed is provided on the hook's standard input with lines of the form:
@@ -216,7 +216,7 @@ SHA-1>` will be 40 `0`. If the local commit was specified by something other than a name which could be expanded (such as `HEAD~`, or a SHA-1) it will be supplied as it was originally given. -If this hook exits with a non-zero status, 'git push' will abort without +If this hook exits with a non-zero status, `git push` will abort without pushing anything. Information about why the push is rejected may be sent to the user by writing to standard error.
@@ -224,8 +224,8 @@ to the user by writing to standard error. pre-receive ~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. Just before starting to update refs on the remote repository, the pre-receive hook is invoked. Its exit status determines the success or failure of the update.
@@ -246,7 +246,7 @@ updated. If the hook exits with zero, updating of individual refs can still be prevented by the <<update,'update'>> hook. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The number of push options given on the command line of
@@ -265,8 +265,8 @@ linkgit:git-receive-pack[1] for some caveats. update ~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. Just before updating the ref on the remote repository, the update hook is invoked. Its exit status determines the success or failure of the ref update.
@@ -279,7 +279,7 @@ three parameters: - and the new object name to be stored in the ref. A zero exit from the update hook allows the ref to be updated. -Exiting with a non-zero status prevents 'git-receive-pack' +Exiting with a non-zero status prevents `git receive-pack` from updating that ref. This hook can be used to prevent 'forced' update on certain refs by
@@ -299,7 +299,7 @@ membership. See linkgit:git-shell[1] for how you might use the login shell to restrict the user's access to only git commands. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The default 'update' hook, when enabled--and with
@@ -310,8 +310,8 @@ unannotated tags to be pushed. post-receive ~~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. It executes on the remote repository once after all the refs have been updated.
@@ -320,7 +320,7 @@ arguments, but gets the same information as the <<pre-receive,'pre-receive'>> hook does on its standard input. -This hook does not affect the outcome of 'git-receive-pack', as it +This hook does not affect the outcome of `git receive-pack`, as it is called after the real work is done. This supersedes the <<post-update,'post-update'>> hook in that it gets
@@ -328,7 +328,7 @@ both old and new values of all the refs in addition to their names. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The default 'post-receive' hook is empty, but there is
@@ -349,8 +349,8 @@ will be set to zero, `GIT_PUSH_OPTION_COUNT=0`. post-update ~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. It executes on the remote repository once after all the refs have been updated.
@@ -358,7 +358,7 @@ It takes a variable number of parameters, each of which is the name of ref that was actually updated. This hook is meant primarily for notification, and cannot affect -the outcome of 'git-receive-pack'. +the outcome of `git receive-pack`. The 'post-update' hook can tell what are the heads that were pushed, but it does not know what their original and updated values are,
@@ -368,20 +368,20 @@ updated values of the refs. You might consider it instead if you need them. When enabled, the default 'post-update' hook runs -'git update-server-info' to keep the information used by dumb +`git update-server-info` to keep the information used by dumb transports (e.g., HTTP) up to date. If you are publishing a Git repository that is accessible via HTTP, you should probably enable this hook. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. push-to-checkout ~~~~~~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository, and when +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository, and when the push tries to update the branch that is currently checked out and the `receive.denyCurrentBranch` configuration variable is set to `updateInstead`. Such a push by default is refused if the working
@@ -400,8 +400,8 @@ when the tip of the current branch is updated to the new commit, and exit with a zero status. For example, the hook can simply run `git read-tree -u -m HEAD "$1"` -in order to emulate 'git fetch' that is run in the reverse direction -with `git push`, as the two-tree form of `read-tree -u -m` is +in order to emulate `git fetch` that is run in the reverse direction +with `git push`, as the two-tree form of `git read-tree -u -m` is essentially the same as `git checkout` that switches branches while keeping the local changes in the working tree that do not interfere with the difference between the branches.
@@ -410,15 +410,16 @@ with the difference between the branches. pre-auto-gc ~~~~~~~~~~~ -This hook is invoked by 'git gc --auto'. It takes no parameter, and -exiting with non-zero status from this script causes the 'git gc --auto' -to abort. +This hook is invoked by `git gc --auto` (see linkgit:git-gc[1]). It +takes no parameter, and exiting with non-zero status from this script +causes the `git gc --auto` to abort. post-rewrite ~~~~~~~~~~~~ -This hook is invoked by commands that rewrite commits (`git commit ---amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call +This hook is invoked by commands that rewrite commits +(linkgit:git-commit[1] when called with `--amend` and +linkgit:git-rebase[1]; currently `git filter-branch` does 'not' call it!). Its first argument denotes the command it was invoked by: currently one of `amend` or `rebase`. Further command-dependent arguments may be passed in the future.
@@ -450,16 +451,16 @@ processed by rebase. sendemail-validate ~~~~~~~~~~~~~~~~~~ -This hook is invoked by 'git send-email'. It takes a single parameter, +This hook is invoked by linkgit:git-send-email[1]. It takes a single parameter, the name of the file that holds the e-mail to be sent. Exiting with a -non-zero status causes 'git send-email' to abort before sending any +non-zero status causes `git send-email` to abort before sending any e-mails. fsmonitor-watchman ~~~~~~~~~~~~~~~~~~ -This hook is invoked when the configuration option core.fsmonitor is -set to .git/hooks/fsmonitor-watchman. It takes two arguments, a version +This hook is invoked when the configuration option `core.fsmonitor` is +set to `.git/hooks/fsmonitor-watchman`. It takes two arguments, a version (currently 1) and the time in elapsed nanoseconds since midnight, January 1, 1970.
@@ -478,7 +479,7 @@ directories are checked for untracked files based on the path names given. An optimized way to tell git "all files have changed" is to return -the filename '/'. +the filename `/`. The exit status determines whether git will use the data from the hook to limit its search. On error, it will fall back to verifying
Signature · 1 line
2.16.2
Re: [PATCH v2 1/6] doc: improve formatting in githooks.txt
Quoted 6 lines · Andreas Heiduk
Typeset commands and similar things with as
git fooinstead of 'git foo' or 'git-foo' and add linkgit to the commands which run the hooks.Signed-off-by Andreas Heiduk <[email protected]>Reviewed-by Martin Ågren <[email protected]>
Indeed. The difference between last time (the original patch and the two fixups) and this patch is precisely the small tweaks that I suggested.
Thanks
Martin
PATCH v2 2/6 doc: align 'diff --no-index' in text with synopsis
In reply to Andreas HeidukThe two '<path>' parameters are not optional but the option '--no-index' is. Also move the --options part to the same place where the other variants show them.
All three items are already correct in the synopsis.
--- Documentation/git-diff.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/git-diff.txt +2 -2
@@ -13,7 +13,7 @@ SYNOPSIS 'git diff' [options] --cached [<commit>] [--] [<path>...] 'git diff' [options] <commit> <commit> [--] [<path>...] 'git diff' [options] <blob> <blob> -'git diff' [options] [--no-index] [--] <path> <path> +'git diff' [options] --no-index [--] <path> <path> DESCRIPTION -----------
@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. -'git diff' --no-index [--options] [--] [<path>...]:: +'git diff' [--options] --no-index [--] <path> <path>:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when
Signature · 1 line
2.16.2
Re: [PATCH v2 2/6] doc: align 'diff --no-index' in text with synopsis
Quoted 3 lines · Andreas Heiduk
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the
--optionspart to the same place where the other variants show them.
Should this commit message be updated after the changes you did to address Junio's comment? This text suggests you want to place --no-index in [] (and you did in v1) but you do not do that below.
Quoted 1 line
All three items are already correct in the synopsis.
Same here, now you actually do change things there.
Quoted 2 lines
Signed-off-by Andreas Heiduk <[email protected]>Reviewed-by Martin Ågren <[email protected]>
Strictly speaking, my Reviewed-by was on another patch. I do find this one better though thanks to Junio's suggestion (except the mismatch with the commit message).
Thanks for continuing with this series.
Martin
Quoted 26 lines
--- Documentation/git-diff.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/git-diff.txt +2
-2@@ -13,7 +13,7 @@ SYNOPSIS 'git diff' [options] --cached [<commit>] [--] [<path>...] 'git diff' [options] <commit> <commit> [--] [<path>...] 'git diff' [options] <blob> <blob> -'git diff' [options] [--no-index] [--] <path> <path> +'git diff' [options] --no-index [--] <path> <path> DESCRIPTION -----------@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. -'git diff' --no-index [--options] [--] [<path>...]:: +'git diff' [--options] --no-index [--] <path> <path>:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when
Re: [PATCH v2 2/6] doc: align 'diff --no-index' in text with synopsis
Am 27.04.2018 um 19:18 schrieb Martin Ågren:
Quoted 9 lines · Andreas Heiduk
Quoted 3 lines
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the
--optionspart to the same place where the other variants show them.Should this commit message be updated after the changes you did to address Junio's comment? This text suggests you want to place --no-index in [] (and you did in v1) but you do not do that below.
Quoted 8 lines
Quoted 1 line
All three items are already correct in the synopsis.
Same here, now you actually do change things there.
Quoted 2 lines
Signed-off-by Andreas Heiduk <[email protected]>Reviewed-by Martin Ågren <[email protected]>Strictly speaking, my Reviewed-by was on another patch. I do find this
Sorry, I've added that trailer after reading "The diff LGTM.", then applied Junio's changes and forgot to remove the trailer.
Quoted 2 lines
one better though thanks to Junio's suggestion (except the mismatch with the commit message).
I'll fix that with this:
doc: align 'diff --no-index' in text with synopsis
Make the two '<path>' parameters in DESCRIPTION mandatory and move the --options part to the same place where the other variants show them. And finally make --no-index in SYNOPSIS as mandatory as in DESCRIPTION.
Re: [PATCH v2 2/6] doc: align 'diff --no-index' in text with synopsis
Quoted 22 lines · Andreas Heiduk
Am 27.04.2018 um 19:18 schrieb Martin Ågren:
Quoted 9 lines · Andreas Heiduk
Quoted 3 lines
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the
--optionspart to the same place where the other variants show them.Should this commit message be updated after the changes you did to address Junio's comment? This text suggests you want to place --no-index in [] (and you did in v1) but you do not do that below.
Quoted 8 lines
Quoted 1 line
All three items are already correct in the synopsis.
Same here, now you actually do change things there.
Quoted 2 lines
Signed-off-by Andreas Heiduk <[email protected]>Reviewed-by Martin Ågren <[email protected]>Strictly speaking, my Reviewed-by was on another patch. I do find this
Sorry, I've added that trailer after reading "The diff LGTM.", then applied Junio's changes and forgot to remove the trailer.
Quoted 6 lines
Quoted 2 lines
one better though thanks to Junio's suggestion (except the mismatch with the commit message).
I'll fix that with this:
doc: align 'diff --no-index' in text with synopsis
s/with/and/ since they both change? It's not that the first changes to match the second, but they actually both change to match each other (and to be correct, obviously).
Quoted 4 lines
Make the two '<path>' parameters in DESCRIPTION mandatory and move the
--optionspart to the same place where the other variants show them. And finally make--no-indexin SYNOPSIS as mandatory as in DESCRIPTION.
Great! Junio had some good reasoning about how --no-index is sometimes optional, but not always. Not sure if it's worth spelling that out. (Although one could argue that it already did trip us up once. :-))
Eric's point about "--options" vs "options" seemed right to me. If you address that, note that this message says "--options".
Re: [PATCH v2 2/6] doc: align 'diff --no-index' in text with synopsis
Am 27.04.2018 um 20:45 schrieb Martin Ågren:
Quoted 26 lines · Andreas Heiduk
Quoted 25 lines
Am 27.04.2018 um 19:18 schrieb Martin Ågren:
Quoted 9 lines · Andreas Heiduk
Quoted 3 lines
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the
--optionspart to the same place where the other variants show them.Should this commit message be updated after the changes you did to address Junio's comment? This text suggests you want to place --no-index in [] (and you did in v1) but you do not do that below.
Quoted 8 lines
Quoted 1 line
All three items are already correct in the synopsis.
Same here, now you actually do change things there.
Quoted 2 lines
Signed-off-by Andreas Heiduk <[email protected]>Reviewed-by Martin Ågren <[email protected]>Strictly speaking, my Reviewed-by was on another patch. I do find this
Sorry, I've added that trailer after reading "The diff LGTM.", then applied Junio's changes and forgot to remove the trailer.
Quoted 2 lines
one better though thanks to Junio's suggestion (except the mismatch with the commit message).
Quoted 7 lines
Quoted 3 lines
I'll fix that with this:
doc: align 'diff --no-index' in text with synopsis
s/with/and/ since they both change? It's not that the first changes to match the second, but they actually both change to match each other (and to be correct, obviously).
Corrected
Quoted 9 lines
Quoted 5 lines
Make the two '<path>' parameters in DESCRIPTION mandatory and move the
--optionspart to the same place where the other variants show them. And finally make--no-indexin SYNOPSIS as mandatory as in DESCRIPTION.Great! Junio had some good reasoning about how --no-index is sometimes optional, but not always. Not sure if it's worth spelling that out. (Although one could argue that it already did trip us up once. :-))
The post-context already explains that.
Quoted 2 lines
Eric's point about "--options" vs "options" seemed right to me. If you address that, note that this message says "--options".
Re: [PATCH v2 2/6] doc: align 'diff --no-index' in text with synopsis
In reply to Andreas HeidukQuoted 13 lines · Andreas Heiduk
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the
--optionspart to the same place where the other variants show them.All three items are already correct in the synopsis.
Signed-off-by Andreas Heiduk <[email protected]>---
Documentation/git-diff.txt +1
-1@@ -13,7 +13,7 @@ SYNOPSIS -'git diff' [options] [--no-index] [--] <path> <path> +'git diff' [options] --no-index [--] <path> <path>
Documentation/git-diff.txt two blob objects, or changes between two files on disk. · line 29
Quoted 2 lines
Documentation/git-diff.txt +1
-1@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. -'git diff' --no-index [--options] [--] [<path>...]:: +'git diff' [--options] --no-index [--] <path> <path>::
Not a problem introduced by this patch, but shouldn't this say "[options]" rather than "[--options]"? Since the aim of this patch series is to clean up botches and normalize documentation, perhaps it could also fix this oddness(?).
Re: [PATCH v2 2/6] doc: align 'diff --no-index' in text with synopsis
Am 27.04.2018 um 19:33 schrieb Eric Sunshine:
Quoted 7 lines · Andreas Heiduk
Quoted 6 lines
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the
--optionspart to the same place where the other variants show them.All three items are already correct in the synopsis.
Quoted 15 lines
Documentation/git-diff.txt two blob objects, or changes between two files on disk. · line 29
Quoted 9 lines
Signed-off-by Andreas Heiduk <[email protected]>---
Documentation/git-diff.txt +2
-2@@ -13,7 +13,7 @@ SYNOPSIS -'git diff' [options] [--no-index] [--] <path> <path> +'git diff' [options] --no-index [--] <path> <path>@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. -'git diff' --no-index [--options] [--] [<path>...]:: +'git diff' [--options] --no-index [--] <path> <path>::Not a problem introduced by this patch, but shouldn't this say "[options]" rather than "[--options]"? Since the aim of this patch series is to clean up botches and normalize documentation, perhaps it could also fix this oddness(?).
Well, in the SYNOPSIS it is always [options] for all variants but in the DESCRIPTION it is always [--options] for all variants. Fixing the other variants would stretch the "subject" line of the patch a little bit to far ;-)
Re: [PATCH v2 2/6] doc: align 'diff --no-index' in text with synopsis
Quoted 24 lines · Andreas Heiduk
Am 27.04.2018 um 19:33 schrieb Eric Sunshine:
Quoted 7 lines · Andreas Heiduk
Quoted 6 lines
The two '<path>' parameters are not optional but the option '--no-index' is. Also move the
--optionspart to the same place where the other variants show them.All three items are already correct in the synopsis.
Quoted 15 lines
Documentation/git-diff.txt two blob objects, or changes between two files on disk. · line 29
Quoted 9 lines
Signed-off-by Andreas Heiduk <[email protected]>---
Documentation/git-diff.txt +2
-2@@ -13,7 +13,7 @@ SYNOPSIS -'git diff' [options] [--no-index] [--] <path> <path> +'git diff' [options] --no-index [--] <path> <path>@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. -'git diff' --no-index [--options] [--] [<path>...]:: +'git diff' [--options] --no-index [--] <path> <path>::Not a problem introduced by this patch, but shouldn't this say "[options]" rather than "[--options]"? Since the aim of this patch series is to clean up botches and normalize documentation, perhaps it could also fix this oddness(?).
Quoted 4 lines
Well, in the SYNOPSIS it is always
[options]for all variants but in the DESCRIPTION it is always[--options]for all variants. Fixing the other variants would stretch the "subject" line of the patch a little bit to far ;-)
Hmm, I do not think it's always though. It's pretty consistent in its inconsistency, but "git diff [options] <blob> <blob>" goes the other way. Maybe that's patch 1/7...
Re: [PATCH v2 2/6] doc: align 'diff --no-index' in text with synopsis
In reply to Andreas HeidukQuoted 14 lines · Andreas Heiduk
Am 27.04.2018 um 19:33 schrieb Eric Sunshine:
Quoted 12 lines · Andreas Heiduk
Documentation/git-diff.txt two blob objects, or changes between two files on disk. · line 29
Quoted 6 lines
Documentation/git-diff.txt +2
-2@@ -13,7 +13,7 @@ SYNOPSIS -'git diff' [options] [--no-index] [--] <path> <path> +'git diff' [options] --no-index [--] <path> <path>@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. -'git diff' --no-index [--options] [--] [<path>...]:: +'git diff' [--options] --no-index [--] <path> <path>::Not a problem introduced by this patch, but shouldn't this say "[options]" rather than "[--options]"? Since the aim of this patch series is to clean up botches and normalize documentation, perhaps it could also fix this oddness(?).
Quoted 4 lines
Well, in the SYNOPSIS it is always
[options]for all variants but in the DESCRIPTION it is always[--options]for all variants. Fixing the other variants would stretch the "subject" line of the patch a little bit to far ;-)
I wasn't suggesting that this patch should fix that issue (it shouldn't) but that it could/should be done by a separate new patch since it's a distinct change. (That's why I was careful to say "aim of this patch _series_".)
PATCH v2 3/6 doc: clarify ignore rules for git ls-files
In reply to Andreas HeidukExplain that git ls-files --ignored requires at least one of the --exclude* options to do its job.
--- Documentation/git-ls-files.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/git-ls-files.txt +2 -1
@@ -53,7 +53,8 @@ OPTIONS Show only ignored files in the output. When showing files in the index, print only those matched by an exclude pattern. When showing "other" files, show only those matched by an exclude - pattern. + pattern. Standard ignore rules are not automatically activated, + therefore at least one of the `--exclude*` options is required. -s:: --stage::
Signature · 1 line
2.16.2
PATCH v2 4/6 doc: add '-d' and '-o' for 'git push'
In reply to Andreas HeidukAdd the missing -o shortcut for --push-option to the synopsis. Add the missing -d shortcut for --delete in the main section.
--- Documentation/git-push.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/git-push.txt +2 -1
@@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git push' [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose] - [-u | --set-upstream] [--push-option=<string>] + [-u | --set-upstream] [-o <string> | --push-option=<string>] [--[no-]signed|--signed=(true|false|if-asked)] [--force-with-lease[=<refname>[:<expect>]]] [--no-verify] [<repository> [<refspec>...]]
@@ -123,6 +123,7 @@ already exists on the remote side. will be tab-separated and sent to stdout instead of stderr. The full symbolic names of the refs will be given. +-d:: --delete:: All listed refs are deleted from the remote repository. This is the same as prefixing all refs with a colon.
Signature · 1 line
2.16.2
PATCH v2 5/6 git-svn: remove ''--add-author-from' for 'commit-diff'
In reply to Andreas HeidukThe subcommand 'commit-diff' does not support the option '--add-author-from'.
--- Documentation/git-svn.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-svn.txt +1 -1
@@ -707,7 +707,7 @@ creating the branch or tag. config key: svn.useLogAuthor --add-author-from:: - When committing to svn from Git (as part of 'commit-diff', 'set-tree' or 'dcommit' + When committing to svn from Git (as part of 'set-tree' or 'dcommit' operations), if the existing log message doesn't already have a `From:` or `Signed-off-by:` line, append a `From:` line based on the Git commit's author string. If you use this, then `--use-log-author`
Signature · 1 line
2.16.2
PATCH v2 6/6 doc: add note about shell quoting to revision.txt
In reply to Andreas Heiduk--- Documentation/revisions.txt | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/revisions.txt +6 -0
@@ -7,6 +7,10 @@ syntax. Here are various ways to spell object names. The ones listed near the end of this list name trees and blobs contained in a commit. +NOTE: This document shows the "raw" syntax as seen by git. The shell +and other UIs might require additional quoting to protect special +characters and to avoid word splitting. + '<sha1>', e.g. 'dae86e1950b1277e545cee180551750029cfe735', 'dae86e':: The full SHA-1 object name (40-byte hexadecimal string), or a leading substring that is unique within the repository.
@@ -186,6 +190,8 @@ existing tag object. is matched. ':/!-foo' performs a negative match, while ':/!!foo' matches a literal '!' character, followed by 'foo'. Any other sequence beginning with ':/!' is reserved for now. + Depending on the given text the shell's word splitting rules might + require additional quoting. '<rev>:<path>', e.g. 'HEAD:README', ':README', 'master:./README':: A suffix ':' followed by a path names the blob or tree
Signature · 1 line
2.16.2
Re: [PATCH v2 6/6] doc: add note about shell quoting to revision.txt
Documentation/revisions.txt existing tag object. · line 191
Quoted 7 lines · Andreas Heiduk
Signed-off-by Andreas Heiduk <[email protected]>Reviewed-by Junio C Hamano <[email protected]>---
Documentation/revisions.txt +2
-0@@ -186,6 +190,8 @@ existing tag object. + Depending on the given text the shell's word splitting rules might + require additional quoting.
s/text/&,/
Re: [PATCH v2 6/6] doc: add note about shell quoting to revision.txt
Am 27.04.2018 um 19:36 schrieb Eric Sunshine:
Quoted 11 lines · Andreas Heiduk
Documentation/revisions.txt existing tag object. · line 191
Quoted 7 lines
Signed-off-by Andreas Heiduk <[email protected]>Reviewed-by Junio C Hamano <[email protected]>---
Documentation/revisions.txt +2
-0@@ -186,6 +190,8 @@ existing tag object. + Depending on the given text the shell's word splitting rules might + require additional quoting.s/text/&,/
Fixed, Thanks
v3 cover Some doc-fixes
In reply to Andreas HeidukChanges since the last reroll:
- Better commit comment for "doc: align 'diff --no-index' in text and synopsis" This includes Martin's s/with/and/ comment.
- Eric's typo fix in "doc: add note about shell quoting to revision.txt"
- Added new patch for git-diff.txt with s/--options/options/.
This addresses Eric's and Martin's comments.
Andreas Heiduk (7):
doc: improve formatting in githooks.txt
doc: align 'diff --no-index' in text and synopsis
doc: clarify ignore rules for git ls-files
doc: add '-d' and '-o' for 'git push'
git-svn: remove ''--add-author-from' for 'commit-diff'
doc: add note about shell quoting to revision.txt
doc: normalize [--options] to [options] in git-diff
Documentation/git-diff.txt | 16 +++--- Documentation/git-ls-files.txt | 3 +- Documentation/git-push.txt | 3 +- Documentation/git-svn.txt | 2 +- Documentation/githooks.txt | 115 +++++++++++++++++++++-------------------- Documentation/revisions.txt | 6 +++ 6 files changed, 77 insertions(+), 68 deletions(-)
Signature · 1 line
2.16.2
PATCH v3 1/7 doc: improve formatting in githooks.txt
Typeset commands and similar things with as git foo instead of 'git foo' or 'git-foo' and add linkgit to the commands which run the hooks.
--- Documentation/githooks.txt | 115 +++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 57 deletions(-)
Documentation/githooks.txt +58 -57
@@ -31,7 +31,7 @@ Hooks can get their arguments via the environment, command-line arguments, and stdin. See the documentation for each hook below for details. -'git init' may copy hooks to the new repository, depending on its +`git init` may copy hooks to the new repository, depending on its configuration. See the "TEMPLATE DIRECTORY" section in linkgit:git-init[1] for details. When the rest of this document refers to "default hooks" it's talking about the default template shipped
@@ -45,9 +45,9 @@ HOOKS applypatch-msg ~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes a single +This hook is invoked by linkgit:git-am[1]. It takes a single parameter, the name of the file that holds the proposed commit -log message. Exiting with a non-zero status causes 'git am' to abort +log message. Exiting with a non-zero status causes `git am` to abort before applying the patch. The hook is allowed to edit the message file in place, and can
@@ -61,7 +61,7 @@ The default 'applypatch-msg' hook, when enabled, runs the pre-applypatch ~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes no parameter, and is +This hook is invoked by linkgit:git-am[1]. It takes no parameter, and is invoked after the patch is applied, but before a commit is made. If it exits with non-zero status, then the working tree will not be
@@ -76,33 +76,33 @@ The default 'pre-applypatch' hook, when enabled, runs the post-applypatch ~~~~~~~~~~~~~~~ -This hook is invoked by 'git am'. It takes no parameter, +This hook is invoked by linkgit:git-am[1]. It takes no parameter, and is invoked after the patch is applied and a commit is made. This hook is meant primarily for notification, and cannot affect -the outcome of 'git am'. +the outcome of `git am`. pre-commit ~~~~~~~~~~ -This hook is invoked by 'git commit', and can be bypassed +This hook is invoked by linkgit:git-commit[1], and can be bypassed with the `--no-verify` option. It takes no parameters, and is invoked before obtaining the proposed commit log message and making a commit. Exiting with a non-zero status from this script -causes the 'git commit' command to abort before creating a commit. +causes the `git commit` command to abort before creating a commit. The default 'pre-commit' hook, when enabled, catches introduction of lines with trailing whitespaces and aborts the commit when such a line is found. -All the 'git commit' hooks are invoked with the environment +All the `git commit` hooks are invoked with the environment variable `GIT_EDITOR=:` if the command will not bring up an editor to modify the commit message. prepare-commit-msg ~~~~~~~~~~~~~~~~~~ -This hook is invoked by 'git commit' right after preparing the +This hook is invoked by linkgit:git-commit[1] right after preparing the default log message, and before the editor is started. It takes one to three parameters. The first is the name of the file
@@ -114,7 +114,7 @@ commit is a merge or a `.git/MERGE_MSG` file exists); `squash` (if a `.git/SQUASH_MSG` file exists); or `commit`, followed by a commit SHA-1 (if a `-c`, `-C` or `--amend` option was given). -If the exit status is non-zero, 'git commit' will abort. +If the exit status is non-zero, `git commit` will abort. The purpose of the hook is to edit the message file in place, and it is not suppressed by the `--no-verify` option. A non-zero exit
@@ -127,7 +127,7 @@ help message found in the commented portion of the commit template. commit-msg ~~~~~~~~~~ -This hook is invoked by 'git commit' and 'git merge', and can be +This hook is invoked by linkgit:git-commit[1] and linkgit:git-merge[1], and can be bypassed with the `--no-verify` option. It takes a single parameter, the name of the file that holds the proposed commit log message. Exiting with a non-zero status causes the command to abort.
@@ -143,16 +143,16 @@ The default 'commit-msg' hook, when enabled, detects duplicate post-commit ~~~~~~~~~~~ -This hook is invoked by 'git commit'. It takes no parameters, and is +This hook is invoked by linkgit:git-commit[1]. It takes no parameters, and is invoked after a commit is made. This hook is meant primarily for notification, and cannot affect -the outcome of 'git commit'. +the outcome of `git commit`. pre-rebase ~~~~~~~~~~ -This hook is called by 'git rebase' and can be used to prevent a +This hook is called by linkgit:git-rebase[1] and can be used to prevent a branch from getting rebased. The hook may be called with one or two parameters. The first parameter is the upstream from which the series was forked. The second parameter is the branch being
@@ -161,17 +161,17 @@ rebased, and is not set when rebasing the current branch. post-checkout ~~~~~~~~~~~~~ -This hook is invoked when a 'git checkout' is run after having updated the +This hook is invoked when a linkgit:git-checkout[1] is run after having updated the worktree. The hook is given three parameters: the ref of the previous HEAD, the ref of the new HEAD (which may or may not have changed), and a flag indicating whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). -This hook cannot affect the outcome of 'git checkout'. +This hook cannot affect the outcome of `git checkout`. -It is also run after 'git clone', unless the --no-checkout (-n) option is +It is also run after linkgit:git-clone[1], unless the `--no-checkout` (`-n`) option is used. The first parameter given to the hook is the null-ref, the second the -ref of the new HEAD and the flag is always 1. Likewise for 'git worktree add' -unless --no-checkout is used. +ref of the new HEAD and the flag is always 1. Likewise for `git worktree add` +unless `--no-checkout` is used. This hook can be used to perform repository validity checks, auto-display differences from the previous HEAD if different, or set working dir metadata
@@ -180,10 +180,10 @@ properties. post-merge ~~~~~~~~~~ -This hook is invoked by 'git merge', which happens when a 'git pull' +This hook is invoked by linkgit:git-merge[1], which happens when a `git pull` is done on a local repository. The hook takes a single parameter, a status flag specifying whether or not the merge being done was a squash merge. -This hook cannot affect the outcome of 'git merge' and is not executed, +This hook cannot affect the outcome of `git merge` and is not executed, if the merge failed due to conflicts. This hook can be used in conjunction with a corresponding pre-commit hook to
@@ -194,10 +194,10 @@ for an example of how to do this. pre-push ~~~~~~~~ -This hook is called by 'git push' and can be used to prevent a push from taking -place. The hook is called with two parameters which provide the name and -location of the destination remote, if a named remote is not being used both -values will be the same. +This hook is called by linkgit:git-push[1] and can be used to prevent +a push from taking place. The hook is called with two parameters +which provide the name and location of the destination remote, if a +named remote is not being used both values will be the same. Information about what is to be pushed is provided on the hook's standard input with lines of the form:
@@ -216,7 +216,7 @@ SHA-1>` will be 40 `0`. If the local commit was specified by something other than a name which could be expanded (such as `HEAD~`, or a SHA-1) it will be supplied as it was originally given. -If this hook exits with a non-zero status, 'git push' will abort without +If this hook exits with a non-zero status, `git push` will abort without pushing anything. Information about why the push is rejected may be sent to the user by writing to standard error.
@@ -224,8 +224,8 @@ to the user by writing to standard error. pre-receive ~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. Just before starting to update refs on the remote repository, the pre-receive hook is invoked. Its exit status determines the success or failure of the update.
@@ -246,7 +246,7 @@ updated. If the hook exits with zero, updating of individual refs can still be prevented by the <<update,'update'>> hook. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The number of push options given on the command line of
@@ -265,8 +265,8 @@ linkgit:git-receive-pack[1] for some caveats. update ~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. Just before updating the ref on the remote repository, the update hook is invoked. Its exit status determines the success or failure of the ref update.
@@ -279,7 +279,7 @@ three parameters: - and the new object name to be stored in the ref. A zero exit from the update hook allows the ref to be updated. -Exiting with a non-zero status prevents 'git-receive-pack' +Exiting with a non-zero status prevents `git receive-pack` from updating that ref. This hook can be used to prevent 'forced' update on certain refs by
@@ -299,7 +299,7 @@ membership. See linkgit:git-shell[1] for how you might use the login shell to restrict the user's access to only git commands. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The default 'update' hook, when enabled--and with
@@ -310,8 +310,8 @@ unannotated tags to be pushed. post-receive ~~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. It executes on the remote repository once after all the refs have been updated.
@@ -320,7 +320,7 @@ arguments, but gets the same information as the <<pre-receive,'pre-receive'>> hook does on its standard input. -This hook does not affect the outcome of 'git-receive-pack', as it +This hook does not affect the outcome of `git receive-pack`, as it is called after the real work is done. This supersedes the <<post-update,'post-update'>> hook in that it gets
@@ -328,7 +328,7 @@ both old and new values of all the refs in addition to their names. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. The default 'post-receive' hook is empty, but there is
@@ -349,8 +349,8 @@ will be set to zero, `GIT_PUSH_OPTION_COUNT=0`. post-update ~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository. +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository. It executes on the remote repository once after all the refs have been updated.
@@ -358,7 +358,7 @@ It takes a variable number of parameters, each of which is the name of ref that was actually updated. This hook is meant primarily for notification, and cannot affect -the outcome of 'git-receive-pack'. +the outcome of `git receive-pack`. The 'post-update' hook can tell what are the heads that were pushed, but it does not know what their original and updated values are,
@@ -368,20 +368,20 @@ updated values of the refs. You might consider it instead if you need them. When enabled, the default 'post-update' hook runs -'git update-server-info' to keep the information used by dumb +`git update-server-info` to keep the information used by dumb transports (e.g., HTTP) up to date. If you are publishing a Git repository that is accessible via HTTP, you should probably enable this hook. Both standard output and standard error output are forwarded to -'git send-pack' on the other end, so you can simply `echo` messages +`git send-pack` on the other end, so you can simply `echo` messages for the user. push-to-checkout ~~~~~~~~~~~~~~~~ -This hook is invoked by 'git-receive-pack' when it reacts to -'git push' and updates reference(s) in its repository, and when +This hook is invoked by linkgit:git-receive-pack[1] when it reacts to +`git push` and updates reference(s) in its repository, and when the push tries to update the branch that is currently checked out and the `receive.denyCurrentBranch` configuration variable is set to `updateInstead`. Such a push by default is refused if the working
@@ -400,8 +400,8 @@ when the tip of the current branch is updated to the new commit, and exit with a zero status. For example, the hook can simply run `git read-tree -u -m HEAD "$1"` -in order to emulate 'git fetch' that is run in the reverse direction -with `git push`, as the two-tree form of `read-tree -u -m` is +in order to emulate `git fetch` that is run in the reverse direction +with `git push`, as the two-tree form of `git read-tree -u -m` is essentially the same as `git checkout` that switches branches while keeping the local changes in the working tree that do not interfere with the difference between the branches.
@@ -410,15 +410,16 @@ with the difference between the branches. pre-auto-gc ~~~~~~~~~~~ -This hook is invoked by 'git gc --auto'. It takes no parameter, and -exiting with non-zero status from this script causes the 'git gc --auto' -to abort. +This hook is invoked by `git gc --auto` (see linkgit:git-gc[1]). It +takes no parameter, and exiting with non-zero status from this script +causes the `git gc --auto` to abort. post-rewrite ~~~~~~~~~~~~ -This hook is invoked by commands that rewrite commits (`git commit ---amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call +This hook is invoked by commands that rewrite commits +(linkgit:git-commit[1] when called with `--amend` and +linkgit:git-rebase[1]; currently `git filter-branch` does 'not' call it!). Its first argument denotes the command it was invoked by: currently one of `amend` or `rebase`. Further command-dependent arguments may be passed in the future.
@@ -450,16 +451,16 @@ processed by rebase. sendemail-validate ~~~~~~~~~~~~~~~~~~ -This hook is invoked by 'git send-email'. It takes a single parameter, +This hook is invoked by linkgit:git-send-email[1]. It takes a single parameter, the name of the file that holds the e-mail to be sent. Exiting with a -non-zero status causes 'git send-email' to abort before sending any +non-zero status causes `git send-email` to abort before sending any e-mails. fsmonitor-watchman ~~~~~~~~~~~~~~~~~~ -This hook is invoked when the configuration option core.fsmonitor is -set to .git/hooks/fsmonitor-watchman. It takes two arguments, a version +This hook is invoked when the configuration option `core.fsmonitor` is +set to `.git/hooks/fsmonitor-watchman`. It takes two arguments, a version (currently 1) and the time in elapsed nanoseconds since midnight, January 1, 1970.
@@ -478,7 +479,7 @@ directories are checked for untracked files based on the path names given. An optimized way to tell git "all files have changed" is to return -the filename '/'. +the filename `/`. The exit status determines whether git will use the data from the hook to limit its search. On error, it will fall back to verifying
Signature · 1 line
2.16.2
PATCH v3 2/7 doc: align 'diff --no-index' in text and synopsis
In reply to Andreas HeidukMake the two '<path>' parameters in DESCRIPTION mandatory and move the --options part to the same place where the other variants show them. And finally make --no-index in SYNOPSIS as mandatory as in DESCRIPTION.
--- Documentation/git-diff.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/git-diff.txt +2 -2
@@ -13,7 +13,7 @@ SYNOPSIS 'git diff' [options] --cached [<commit>] [--] [<path>...] 'git diff' [options] <commit> <commit> [--] [<path>...] 'git diff' [options] <blob> <blob> -'git diff' [options] [--no-index] [--] <path> <path> +'git diff' [options] --no-index [--] <path> <path> DESCRIPTION -----------
@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. -'git diff' --no-index [--options] [--] [<path>...]:: +'git diff' [--options] --no-index [--] <path> <path>:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when
Signature · 1 line
2.16.2
PATCH v3 3/7 doc: clarify ignore rules for git ls-files
In reply to Andreas HeidukExplain that git ls-files --ignored requires at least one of the --exclude* options to do its job.
--- Documentation/git-ls-files.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/git-ls-files.txt +2 -1
@@ -53,7 +53,8 @@ OPTIONS Show only ignored files in the output. When showing files in the index, print only those matched by an exclude pattern. When showing "other" files, show only those matched by an exclude - pattern. + pattern. Standard ignore rules are not automatically activated, + therefore at least one of the `--exclude*` options is required. -s:: --stage::
Signature · 1 line
2.16.2
PATCH v3 4/7 doc: add '-d' and '-o' for 'git push'
In reply to Andreas HeidukAdd the missing -o shortcut for --push-option to the synopsis. Add the missing -d shortcut for --delete in the main section.
--- Documentation/git-push.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/git-push.txt +2 -1
@@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git push' [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose] - [-u | --set-upstream] [--push-option=<string>] + [-u | --set-upstream] [-o <string> | --push-option=<string>] [--[no-]signed|--signed=(true|false|if-asked)] [--force-with-lease[=<refname>[:<expect>]]] [--no-verify] [<repository> [<refspec>...]]
@@ -123,6 +123,7 @@ already exists on the remote side. will be tab-separated and sent to stdout instead of stderr. The full symbolic names of the refs will be given. +-d:: --delete:: All listed refs are deleted from the remote repository. This is the same as prefixing all refs with a colon.
Signature · 1 line
2.16.2
PATCH v3 5/7 git-svn: remove ''--add-author-from' for 'commit-diff'
In reply to Andreas HeidukThe subcommand 'commit-diff' does not support the option '--add-author-from'.
--- Documentation/git-svn.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-svn.txt +1 -1
@@ -707,7 +707,7 @@ creating the branch or tag. config key: svn.useLogAuthor --add-author-from:: - When committing to svn from Git (as part of 'commit-diff', 'set-tree' or 'dcommit' + When committing to svn from Git (as part of 'set-tree' or 'dcommit' operations), if the existing log message doesn't already have a `From:` or `Signed-off-by:` line, append a `From:` line based on the Git commit's author string. If you use this, then `--use-log-author`
Signature · 1 line
2.16.2
PATCH v3 6/7 doc: add note about shell quoting to revision.txt
In reply to Andreas Heiduk--- Documentation/revisions.txt | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/revisions.txt +6 -0
@@ -7,6 +7,10 @@ syntax. Here are various ways to spell object names. The ones listed near the end of this list name trees and blobs contained in a commit. +NOTE: This document shows the "raw" syntax as seen by git. The shell +and other UIs might require additional quoting to protect special +characters and to avoid word splitting. + '<sha1>', e.g. 'dae86e1950b1277e545cee180551750029cfe735', 'dae86e':: The full SHA-1 object name (40-byte hexadecimal string), or a leading substring that is unique within the repository.
@@ -186,6 +190,8 @@ existing tag object. is matched. ':/!-foo' performs a negative match, while ':/!!foo' matches a literal '!' character, followed by 'foo'. Any other sequence beginning with ':/!' is reserved for now. + Depending on the given text, the shell's word splitting rules might + require additional quoting. '<rev>:<path>', e.g. 'HEAD:README', ':README', 'master:./README':: A suffix ':' followed by a path names the blob or tree
Signature · 1 line
2.16.2
PATCH v3 7/7 doc: normalize [--options] to [options] in git-diff
In reply to Andreas HeidukSYNOPSIS and other manuals use [options] but DESCRIPTION used [--options].
--- Documentation/git-diff.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Documentation/git-diff.txt +7 -7
@@ -21,7 +21,7 @@ Show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees, changes between two blob objects, or changes between two files on disk. -'git diff' [--options] [--] [<path>...]:: +'git diff' [options] [--] [<path>...]:: This form is to view the changes you made relative to the index (staging area for the next commit). In other
@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. -'git diff' [--options] --no-index [--] <path> <path>:: +'git diff' [options] --no-index [--] <path> <path>:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when
@@ -38,7 +38,7 @@ two blob objects, or changes between two files on disk. or when running the command outside a working tree controlled by Git. -'git diff' [--options] --cached [<commit>] [--] [<path>...]:: +'git diff' [options] --cached [<commit>] [--] [<path>...]:: This form is to view the changes you staged for the next commit relative to the named <commit>. Typically you
@@ -48,7 +48,7 @@ two blob objects, or changes between two files on disk. <commit> is not given, it shows all staged changes. --staged is a synonym of --cached. -'git diff' [--options] <commit> [--] [<path>...]:: +'git diff' [options] <commit> [--] [<path>...]:: This form is to view the changes you have in your working tree relative to the named <commit>. You can
@@ -56,18 +56,18 @@ two blob objects, or changes between two files on disk. branch name to compare with the tip of a different branch. -'git diff' [--options] <commit> <commit> [--] [<path>...]:: +'git diff' [options] <commit> <commit> [--] [<path>...]:: This is to view the changes between two arbitrary <commit>. -'git diff' [--options] <commit>..<commit> [--] [<path>...]:: +'git diff' [options] <commit>..<commit> [--] [<path>...]:: This is synonymous to the previous form. If <commit> on one side is omitted, it will have the same effect as using HEAD instead. -'git diff' [--options] <commit>\...<commit> [--] [<path>...]:: +'git diff' [options] <commit>\...<commit> [--] [<path>...]:: This form is to view the changes on the branch containing and up to the second <commit>, starting at a common ancestor
Signature · 1 line
2.16.2
Quoted 7 lines · Andreas Heiduk
Changes since the last reroll:
- Better commit comment for "doc: align 'diff --no-index' in text and synopsis" This includes Martin's
s/with/and/comment.
- Eric's typo fix in "doc: add note about shell quoting to revision.txt"
- Added new patch for git-diff.txt with s/--options/options/.
This addresses Eric's and Martin's comments.
FWIW, this version looks good to me. I was a tiny bit surprised that patch 7/7 was not patch 1/7. Could be just a matter of opinion, probably nothing to reroll for. Thanks for getting back to this.
Martin
[PATCH v2 7/6] doc: normalize [--options] to [options] in git-diff
In reply to Andreas HeidukSYNOPSIS and other manuals use [options] but DESCRIPTION used [--options].
--- Documentation/git-diff.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Documentation/git-diff.txt +7 -7
@@ -21,7 +21,7 @@ Show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees, changes between two blob objects, or changes between two files on disk. -'git diff' [--options] [--] [<path>...]:: +'git diff' [options] [--] [<path>...]:: This form is to view the changes you made relative to the index (staging area for the next commit). In other
@@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. -'git diff' [--options] --no-index [--] <path> <path>:: +'git diff' [options] --no-index [--] <path> <path>:: This form is to compare the given two paths on the filesystem. You can omit the `--no-index` option when
@@ -38,7 +38,7 @@ two blob objects, or changes between two files on disk. or when running the command outside a working tree controlled by Git. -'git diff' [--options] --cached [<commit>] [--] [<path>...]:: +'git diff' [options] --cached [<commit>] [--] [<path>...]:: This form is to view the changes you staged for the next commit relative to the named <commit>. Typically you
@@ -48,7 +48,7 @@ two blob objects, or changes between two files on disk. <commit> is not given, it shows all staged changes. --staged is a synonym of --cached. -'git diff' [--options] <commit> [--] [<path>...]:: +'git diff' [options] <commit> [--] [<path>...]:: This form is to view the changes you have in your working tree relative to the named <commit>. You can
@@ -56,18 +56,18 @@ two blob objects, or changes between two files on disk. branch name to compare with the tip of a different branch. -'git diff' [--options] <commit> <commit> [--] [<path>...]:: +'git diff' [options] <commit> <commit> [--] [<path>...]:: This is to view the changes between two arbitrary <commit>. -'git diff' [--options] <commit>..<commit> [--] [<path>...]:: +'git diff' [options] <commit>..<commit> [--] [<path>...]:: This is synonymous to the previous form. If <commit> on one side is omitted, it will have the same effect as using HEAD instead. -'git diff' [--options] <commit>\...<commit> [--] [<path>...]:: +'git diff' [options] <commit>\...<commit> [--] [<path>...]:: This form is to view the changes on the branch containing and up to the second <commit>, starting at a common ancestor
Signature · 1 line
2.16.2