From 97e9a2216f33d1b6cff312f9535b6cf0d0ba4f16 Mon Sep 17 00:00:00 2001 From: Jing Xue Date: Sun, 11 Nov 2007 23:43:00 -0500 Subject: replace reference to git-rm with git-reset in git-commit doc The message in git-commit suggesting to use 'git rm --cached' to unstage is just plain wrong. It really should mention 'git reset'. Suggested by Jan Hudec. Signed-off-by: Jing Xue Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index e54fb12103..d4bfd49ce1 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -154,10 +154,13 @@ EXAMPLES -------- When recording your own work, the contents of modified files in your working tree are temporarily stored to a staging area -called the "index" with gitlink:git-add[1]. Removal -of a file is staged with gitlink:git-rm[1]. After building the -state to be committed incrementally with these commands, `git -commit` (without any pathname parameter) is used to record what +called the "index" with gitlink:git-add[1]. A file can be +reverted back, only in the index but not in the working tree, +to that of the last commit with `git-reset HEAD -- `, +which effectively reverts `git-add` and prevents the changes to +this file from participating in the next commit. After building +the state to be committed incrementally with these commands, +`git commit` (without any pathname parameter) is used to record what has been staged so far. This is the most basic form of the command. An example: -- cgit v1.2.3 From 36863af16e91aebc87696209f4f4780cf4c4059f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 3 Dec 2007 00:03:10 -0800 Subject: git-commit --allow-empty It does not usually make sense to record a commit that has the exact same tree as its sole parent commit and that is why git-commit prevents you from making such a mistake, but when data from foreign scm is involved, it is a different story. We are equipped to represent such an (perhaps insane, perhaps by mistake, or perhaps done on purpose) empty change, and it is better to represent it bypassing the safety valve for native use. This is primarily for use by foreign scm interface scripts. Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index d4bfd49ce1..a7ef71ff99 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git-commit' [-a | --interactive] [-s] [-v] [-u] [(-c | -C) | -F | -m | --amend] - [--no-verify] [-e] [--author ] + [--allow-empty] [--no-verify] [-e] [--author ] [--] [[-i | -o ]...] DESCRIPTION @@ -89,6 +89,12 @@ OPTIONS This option bypasses the pre-commit hook. See also link:hooks.html[hooks]. +--allow-empty:: + Usually recording a commit that has the exact same tree as its + sole parent commit and the command prevents you from making such + a mistake. This option bypasses the safety, and is primarily + for use by foreign scm interface scripts. + -e|--edit:: The message taken from file with `-F`, command line with `-m`, and from file with `-C` are usually used as the -- cgit v1.2.3 From 17ef10d0558d9622884e5b5930cee2569e40a4e4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 3 Dec 2007 13:35:26 -0800 Subject: git-commit documentation: fix unfinished sentence. Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index a7ef71ff99..4bb2791550 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -91,9 +91,9 @@ OPTIONS --allow-empty:: Usually recording a commit that has the exact same tree as its - sole parent commit and the command prevents you from making such - a mistake. This option bypasses the safety, and is primarily - for use by foreign scm interface scripts. + sole parent commit is a mistake, and the command prevents you + from making such a commit. This option bypasses the safety, and + is primarily for use by foreign scm interface scripts. -e|--edit:: The message taken from file with `-F`, command line with -- cgit v1.2.3 From aa6da6cddb65c3889751d0b06a7e3d339e303b1b Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Sat, 8 Dec 2007 12:38:08 +0100 Subject: Documentation: fix --no-verify documentation for "git commit" The documentation for the --no-verify switch should mention the commit-msg hook, not just the pre-commit hook. Signed-off-by: Wincent Colaiuta Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 4bb2791550..4261384158 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -86,7 +86,7 @@ OPTIONS Add Signed-off-by line at the end of the commit message. --no-verify:: - This option bypasses the pre-commit hook. + This option bypasses the pre-commit and commit-msg hooks. See also link:hooks.html[hooks]. --allow-empty:: -- cgit v1.2.3 From 5f0657374344a5d8cf5ce5a9920a08c0be422194 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Sat, 22 Dec 2007 19:46:24 +0100 Subject: Allow selection of different cleanup modes for commit messages Although we traditionally stripped away excess blank lines, trailing whitespaces and lines that begin with "#" from the commit log message, sometimes the message just has to be the way user wants it. For instance, a commit message template can contain lines that begin with "#", the message must be kept as close to its original source as possible if you are converting from a foreign SCM, or maybe the message has a shell script including its comments for future reference. The cleanup modes are default, verbatim, whitespace and strip. The default mode depends on if the message is being edited and will either strip whitespace and comments (if editor active) or just strip the whitespace (for where the message is given explicitely). Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 4261384158..96383b6543 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -11,7 +11,7 @@ SYNOPSIS 'git-commit' [-a | --interactive] [-s] [-v] [-u] [(-c | -C) | -F | -m | --amend] [--allow-empty] [--no-verify] [-e] [--author ] - [--] [[-i | -o ]...] + [--cleanup=] [--] [[-i | -o ]...] DESCRIPTION ----------- @@ -95,6 +95,16 @@ OPTIONS from making such a commit. This option bypasses the safety, and is primarily for use by foreign scm interface scripts. +--cleanup=:: + This option sets how the commit message is cleaned up. + The '' can be one of 'verbatim', 'whitespace', 'strip', + and 'default'. The 'default' mode will strip leading and + trailing empty lines and #commentary from the commit message + only if the message is to be edited. Otherwise only whitespace + removed. The 'verbatim' mode does not change message at all, + 'whitespace' removes just leading/trailing whitespace lines + and 'strip' removes both whitespace and commentary. + -e|--edit:: The message taken from file with `-F`, command line with `-m`, and from file with `-C` are usually used as the -- cgit v1.2.3 From 5162e69732d13dd079919a389a6ace8878aad716 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 29 Dec 2007 00:20:38 -0600 Subject: Documentation: rename gitlink macro to linkgit Between AsciiDoc 8.2.2 and 8.2.3, the following change was made to the stock Asciidoc configuration: @@ -149,7 +153,10 @@ # Inline macros. # Backslash prefix required for escape processing. # (?s) re flag for line spanning. -(?su)[\\]?(?P\w(\w|-)*?):(?P\S*?)(\[(?P.*?)\])= + +# Explicit so they can be nested. +(?su)[\\]?(?P(http|https|ftp|file|mailto|callto|image|link)):(?P\S*?)(\[(?P.*?)\])= + # Anchor: [[[id]]]. Bibliographic anchor. (?su)[\\]?\[\[\[(?P[\w][\w-]*?)\]\]\]=anchor3 # Anchor: [[id,xreflabel]] This default regex now matches explicit values, and unfortunately in this case gitlink was being matched by just 'link', causing the wrong inline macro template to be applied. By renaming the macro, we can avoid being matched by the wrong regex. Signed-off-by: Dan McGee Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 96383b6543..c3725b2ed9 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -20,11 +20,11 @@ commit along with a log message describing the changes you have made. The content to be added can be specified in several ways: -1. by using gitlink:git-add[1] to incrementally "add" changes to the +1. by using linkgit:git-add[1] to incrementally "add" changes to the index before using the 'commit' command (Note: even modified files must be "added"); -2. by using gitlink:git-rm[1] to remove files from the working tree +2. by using linkgit:git-rm[1] to remove files from the working tree and the index, again before using the 'commit' command; 3. by listing files as arguments to the 'commit' command, in which @@ -41,13 +41,13 @@ The content to be added can be specified in several ways: by one which files should be part of the commit, before finalizing the operation. Currently, this is done by invoking `git-add --interactive`. -The gitlink:git-status[1] command can be used to obtain a +The linkgit:git-status[1] command can be used to obtain a summary of what is included by any of the above for the next commit by giving the same set of parameters you would give to this command. If you make a commit and then found a mistake immediately after -that, you can recover from it with gitlink:git-reset[1]. +that, you can recover from it with linkgit:git-reset[1]. OPTIONS @@ -170,7 +170,7 @@ EXAMPLES -------- When recording your own work, the contents of modified files in your working tree are temporarily stored to a staging area -called the "index" with gitlink:git-add[1]. A file can be +called the "index" with linkgit:git-add[1]. A file can be reverted back, only in the index but not in the working tree, to that of the last commit with `git-reset HEAD -- `, which effectively reverts `git-add` and prevents the changes to @@ -229,13 +229,13 @@ $ git commit this second commit would record the changes to `hello.c` and `hello.h` as expected. -After a merge (initiated by either gitlink:git-merge[1] or -gitlink:git-pull[1]) stops because of conflicts, cleanly merged +After a merge (initiated by either linkgit:git-merge[1] or +linkgit:git-pull[1]) stops because of conflicts, cleanly merged paths are already staged to be committed for you, and paths that conflicted are left in unmerged state. You would have to first -check which paths are conflicting with gitlink:git-status[1] +check which paths are conflicting with linkgit:git-status[1] and after fixing them manually in your working tree, you would -stage the result as usual with gitlink:git-add[1]: +stage the result as usual with linkgit:git-add[1]: ------------ $ git status | grep unmerged @@ -287,11 +287,11 @@ information. SEE ALSO -------- -gitlink:git-add[1], -gitlink:git-rm[1], -gitlink:git-mv[1], -gitlink:git-merge[1], -gitlink:git-commit-tree[1] +linkgit:git-add[1], +linkgit:git-rm[1], +linkgit:git-mv[1], +linkgit:git-merge[1], +linkgit:git-commit-tree[1] Author ------ @@ -301,4 +301,4 @@ Junio C Hamano GIT --- -Part of the gitlink:git[7] suite +Part of the linkgit:git[7] suite -- cgit v1.2.3 From 8089c85bcba89464b9b2a32fa948ed85eb367e70 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 5 Feb 2008 08:04:18 +0100 Subject: git-commit: add a prepare-commit-msg hook The prepare-commit-msg hook is run whenever a "fresh" commit message is prepared, just before it is shown in the editor (if it is). Its purpose is to modify the commit message in-place. It takes one to three parameters. The first is the name of the file that the commit log message. The second is the source of the commit message, and can be: "message" (if a -m or -F option was given); "template" (if a -t option was given or the configuration option commit.template is set); "merge" (if the 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 SHA1 as the third parameter (if a -c, -C or --amend option was given). If its exit status is non-zero, git-commit will abort. The hook is not suppressed by the --no-verify option, so it should not be used as a replacement for the pre-commit hook. The sample prepare-commit-msg comments out the `Conflicts:` part of a merge's commit message; other examples are commented out, including adding a Signed-off-by line at the bottom of the commit messsage, that the user can then edit or discard altogether. Signed-off-by: Paolo Bonzini Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index c3725b2ed9..b4ae61ff46 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -280,8 +280,8 @@ order). HOOKS ----- -This command can run `commit-msg`, `pre-commit`, and -`post-commit` hooks. See link:hooks.html[hooks] for more +This command can run `commit-msg`, `prepare-commit-msg`, `pre-commit`, +and `post-commit` hooks. See link:hooks.html[hooks] for more information. -- cgit v1.2.3