From 3a5d13a3c32e0f39d8fc83330255fac27af5d853 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 7 Aug 2009 23:03:36 -0700 Subject: commit: --dry-run This teaches --dry-run option to "git commit". It is the same as "git status", but in the longer term we would want to change the semantics of "git status" not to be the preview of commit, and this is the first step for doing so. Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index b5d81be7ec..d01ff5adae 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -8,7 +8,7 @@ git-commit - Record changes to the repository SYNOPSIS -------- [verse] -'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] +'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] [--dry-run] [(-c | -C) ] [-F | -m ] [--allow-empty] [--no-verify] [-e] [--author=] [--cleanup=] [--] [[-i | -o ]...] @@ -198,6 +198,11 @@ specified. --quiet:: Suppress commit summary message. +--dry-run:: + Do not create a commit, but show a list of paths that are + to be committed, paths with local changes that will be left + uncommitted and paths that are untracked. + \--:: Do not interpret any more arguments as options. -- cgit v1.2.3 From 60c2993c92fa1aa7f4d4aab7de6d8769052ced6f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 15 Aug 2009 01:58:37 -0700 Subject: Documentation/git-commit.txt: describe --dry-run Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index d01ff5adae..64f94cfe12 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] [--dry-run] - [(-c | -C) ] [-F | -m ] + [(-c | -C) ] [-F | -m ] [--dry-run] [--allow-empty] [--no-verify] [-e] [--author=] [--cleanup=] [--] [[-i | -o ]...] @@ -42,10 +42,9 @@ 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 'git-status' command can be used to obtain a +The `--dry-run` option 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. +commit by giving the same set of parameters (options and paths). If you make a commit and then find a mistake immediately after that, you can recover from it with 'git-reset'. @@ -70,6 +69,12 @@ OPTIONS Like '-C', but with '-c' the editor is invoked, so that the user can further edit the commit message. +--dry-run:: + Do not actually make a commit, but show the list of paths + with updates in the index, paths with changes in the work tree, + and paths that are untracked, similar to the one that is given + in the commit log editor. + -F :: --file=:: Take the commit message from the given file. Use '-' to -- cgit v1.2.3 From 7c9f7038e923e6eb135b27c6fca9a010b034bc27 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 5 Sep 2009 04:59:56 -0400 Subject: commit: support alternate status formats The status command recently grew "short" and "porcelain" options for alternate output formats. Since status is no longer "commit --dry-run", these formats are inaccessible to people who do want to see a dry-run in a parseable form. This patch makes those formats available to "git commit", implying the "dry-run" option when they are used. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 64f94cfe12..c45fbe4f97 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -75,6 +75,20 @@ OPTIONS and paths that are untracked, similar to the one that is given in the commit log editor. +--short:: + When doing a dry-run, give the output in the short-format. See + linkgit:git-status[1] for details. Implies `--dry-run`. + +--porcelain:: + When doing a dry-run, give the output in a porcelain-ready + format. See linkgit:git-status[1] for details. Implies + `--dry-run`. + +-z:: + When showing `short` or `porcelain` status output, terminate + entries in the status output with NUL, instead of LF. If no + format is given, implies the `--porcelain` output format. + -F :: --file=:: Take the commit message from the given file. Use '-' to -- cgit v1.2.3 From 12efe45a3363ebecd8954d04caadb23eba2e5020 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 13 Sep 2009 11:23:34 -0700 Subject: git-commit doc: remove duplicated --dry-run description 60c2993 (Documentation/git-commit.txt: describe --dry-run, 2009-08-15) wanted to update the documentation to say that "git status" is not the same as "git commit --dry-run" anymore, but it screwed up and also added the description of --dry-run that was already present. Noticed by Johannes Gilger. Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 64f94cfe12..0578a40d84 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] [--dry-run] - [(-c | -C) ] [-F | -m ] [--dry-run] + [(-c | -C) ] [-F | -m ] [--allow-empty] [--no-verify] [-e] [--author=] [--cleanup=] [--] [[-i | -o ]...] @@ -69,12 +69,6 @@ OPTIONS Like '-C', but with '-c' the editor is invoked, so that the user can further edit the commit message. ---dry-run:: - Do not actually make a commit, but show the list of paths - with updates in the index, paths with changes in the work tree, - and paths that are untracked, similar to the one that is given - in the commit log editor. - -F :: --file=:: Take the commit message from the given file. Use '-' to -- cgit v1.2.3 From c51f6ceed6a9a436f16f8b4f17eab1a3d17cffed Mon Sep 17 00:00:00 2001 From: Erick Mattos Date: Wed, 4 Nov 2009 01:20:11 -0200 Subject: commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author When we use -c, -C, or --amend, we are trying one of two things: using the source as a template or modifying a commit with corrections. When these options are used, the authorship and timestamp recorded in the newly created commit are always taken from the original commit. This is inconvenient when we just want to borrow the commit log message or when our change to the code is so significant that we should take over the authorship (with the blame for bugs we introduce, of course). The new --reset-author option is meant to solve this need by regenerating the timestamp and setting the committer as the new author. Signed-off-by: Erick Mattos Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 0578a40d84..f89db9a0ff 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] [--dry-run] - [(-c | -C) ] [-F | -m ] + [(-c | -C) ] [-F | -m ] [--reset-author] [--allow-empty] [--no-verify] [-e] [--author=] [--cleanup=] [--] [[-i | -o ]...] @@ -69,6 +69,11 @@ OPTIONS Like '-C', but with '-c' the editor is invoked, so that the user can further edit the commit message. +--reset-author:: + When used with -C/-c/--amend options, declare that the + authorship of the resulting commit now belongs of the committer. + This also renews the author timestamp. + -F :: --file=:: Take the commit message from the given file. Use '-' to -- cgit v1.2.3 From b4479f074760a788dd4e353b8c86a7d735afc53e Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Fri, 30 Oct 2009 20:42:34 -0500 Subject: add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR" Use the new "git var GIT_EDITOR" feature to decide what editor to use, instead of duplicating its logic elsewhere. This should make the behavior of commands in edge cases (e.g., editor names with spaces) a little more consistent. Signed-off-by: Jonathan Nieder 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 0578a40d84..3ea80c820f 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -323,7 +323,7 @@ ENVIRONMENT AND CONFIGURATION VARIABLES The editor used to edit the commit log message will be chosen from the GIT_EDITOR environment variable, the core.editor configuration variable, the VISUAL environment variable, or the EDITOR environment variable (in that -order). +order). See linkgit:git-var[1] for details. HOOKS ----- -- cgit v1.2.3 From 02b47cd77e4af40da95a74c90846965a2ea6999b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 2 Dec 2009 23:16:18 +0100 Subject: builtin-commit: add --date option This is like --author: allow a user to specify a given date without using the GIT_AUTHOR_DATE environment variable. Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index d227cec9ba..c37c21e4e3 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -11,7 +11,7 @@ SYNOPSIS 'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] [--dry-run] [(-c | -C) ] [-F | -m ] [--reset-author] [--allow-empty] [--no-verify] [-e] [--author=] - [--cleanup=] [--] [[-i | -o ]...] + [--date=] [--cleanup=] [--] [[-i | -o ]...] DESCRIPTION ----------- @@ -85,6 +85,9 @@ OPTIONS an existing commit that matches the given string and its author name is used. +--date=:: + Override the author date used in the commit. + -m :: --message=:: Use the given as the commit message. -- cgit v1.2.3 From 788070a261ecc3a37a7e0ed9301ecec4a333586d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 3 Dec 2009 00:49:19 +0100 Subject: Document date formats accepted by parse_date() Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index c37c21e4e3..de3435d397 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -220,6 +220,8 @@ specified. these files are also staged for the next commit on top of what have been staged before. +:git-commit: 1 +include::date-formats.txt[] EXAMPLES -------- -- cgit v1.2.3 From 0b444cdb19bcfcc7f59b7b00783cbfbbc5ddcf63 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sun, 10 Jan 2010 00:33:00 +0100 Subject: Documentation: spell 'git cmd' without dash throughout The documentation was quite inconsistent when spelling 'git cmd' if it only refers to the program, not to some specific invocation syntax: both 'git-cmd' and 'git cmd' spellings exist. The current trend goes towards dashless forms, and there is precedent in 647ac70 (git-svn.txt: stop using dash-form of commands., 2009-07-07) to actively eliminate the dashed variants. Replace 'git-cmd' with 'git cmd' throughout, except where git-shell, git-cvsserver, git-upload-pack, git-receive-pack, and git-upload-archive are concerned, because those really live in the $PATH. --- Documentation/git-commit.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 5fb43f9320..c322c759fd 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -20,11 +20,11 @@ with a log message from the user describing the changes. The content to be added can be specified in several ways: -1. by using 'git-add' to incrementally "add" changes to the +1. by using 'git add' to incrementally "add" changes to the index before using the 'commit' command (Note: even modified files must be "added"); -2. by using 'git-rm' to remove files from the working tree +2. by using 'git rm' 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 @@ -40,14 +40,14 @@ The content to be added can be specified in several ways: 5. by using the --interactive switch with the 'commit' command to decide one by one which files should be part of the commit, before finalizing the - operation. Currently, this is done by invoking 'git-add --interactive'. + operation. Currently, this is done by invoking 'git add --interactive'. The `--dry-run` option 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 (options and paths). If you make a commit and then find a mistake immediately after -that, you can recover from it with 'git-reset'. +that, you can recover from it with 'git reset'. OPTIONS @@ -184,7 +184,7 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].) Make a commit only from the paths specified on the command line, disregarding any contents that have been staged so far. This is the default mode of operation of - 'git-commit' if any paths are given on the command line, + 'git commit' if any paths are given on the command line, in which case this option can be omitted. If this option is specified together with '--amend', then no paths need to be specified, which can be used to amend @@ -241,10 +241,10 @@ 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 'git-add'. A file can be +called the "index" with 'git add'. 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 +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 @@ -300,13 +300,13 @@ $ git commit this second commit would record the changes to `hello.c` and `hello.h` as expected. -After a merge (initiated by 'git-merge' or 'git-pull') stops +After a merge (initiated by 'git merge' or 'git pull') 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 'git-status' +check which paths are conflicting with 'git status' and after fixing them manually in your working tree, you would -stage the result as usual with 'git-add': +stage the result as usual with 'git add': ------------ $ git status | grep unmerged -- cgit v1.2.3 From bed575e4002cfa1dfa7d87b9db38e69c6f600e2e Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 7 Dec 2009 17:45:27 -0500 Subject: commit: support commit.status, --status, and --no-status A new configuration variable commit.status, and new command line options --status, and --no-status control whether or not the git status information is included in the commit message template when using an editor to prepare the commit message. It does not affect the effects of a user's commit.template settings. Signed-off-by: James P. Howard, II Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index d227cec9ba..0e535184b1 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -11,7 +11,8 @@ SYNOPSIS 'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] [--dry-run] [(-c | -C) ] [-F | -m ] [--reset-author] [--allow-empty] [--no-verify] [-e] [--author=] - [--cleanup=] [--] [[-i | -o ]...] + [--cleanup=] [--status | --no-status] [--] + [[-i | -o ]...] DESCRIPTION ----------- @@ -207,6 +208,17 @@ specified. to be committed, paths with local changes that will be left uncommitted and paths that are untracked. +--status:: + Include the output of linkgit:git-status[1] in the commit + message template when using an editor to prepare the commit + message. Defaults to on, but can be used to override + configuration variable commit.status. + +--no-status:: + Do not include the output of linkgit:git-status[1] in the + commit message template when using an editor to prepare the + default commit message. + \--:: Do not interpret any more arguments as options. -- cgit v1.2.3 From e9e921981d10554a325f4a1e67e920947e0e4800 Mon Sep 17 00:00:00 2001 From: Jacob Helwig Date: Mon, 15 Feb 2010 04:33:06 -0800 Subject: Documentation: Fix indentation problem in git-commit(1) Ever since the "See linkgit:git-config[1]..." paragraph was added to the description for --untracked-files (d6293d1), the paragraphs for the following options were indented at the same level as the "See linkgit:git-config[1]" paragraph. This problem showed up in the manpages, but not in the HTML documentation. While this does fix the alignment of the options following --untracked-files in the manpage, the "See linkgit..." portion of the description does not retain its previous indentation level in the manpages, or HTML documentation. Signed-off-by: Jacob Helwig Acked-by: Thomas Rast 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 e99bb14754..64fb458b45 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -197,13 +197,13 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].) Show untracked files (Default: 'all'). + The mode parameter is optional, and is used to specify -the handling of untracked files. The possible options are: +the handling of untracked files. ++ +The possible options are: + --- - 'no' - Show no untracked files - 'normal' - Shows untracked files and directories - 'all' - Also shows individual files in untracked directories. --- + See linkgit:git-config[1] for configuration variable used to change the default for when the option is not -- cgit v1.2.3 From c9b5fde7593ac88b1c475bea51d21ba1a1d57d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 6 Apr 2010 08:40:35 +0000 Subject: Add option to git-commit to allow empty log messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change git-commit(1) to accept the --allow-empty-message option to allow a commit with an empty message. This is analogous to the existing --allow-empty option which allows a commit that records no changes. As these are mainly for interoperating with foreign SCM systems, and are not meant for normal use, ensure that "git commit -h" does not talk about them. Signed-off-by: Ævar Arnfjörð Bjarmason 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 64fb458b45..32c482f33f 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git commit' [-a | --interactive] [-s] [-v] [-u] [--amend] [--dry-run] [(-c | -C) ] [-F | -m ] [--reset-author] - [--allow-empty] [--no-verify] [-e] [--author=] + [--allow-empty] [--allow-empty-message] [--no-verify] [-e] [--author=] [--date=] [--cleanup=] [--status | --no-status] [--] [[-i | -o ]...] @@ -131,6 +131,12 @@ OPTIONS from making such a commit. This option bypasses the safety, and is primarily for use by foreign scm interface scripts. +--allow-empty-message:: + Like --allow-empty this command is primarily for use by foreign + scm interface scripts. It allows you to create a commit with an + empty commit message without using plumbing commands like + linkgit:git-commit-tree[1]. + --cleanup=:: This option sets how the commit message is cleaned up. The '' can be one of 'verbatim', 'whitespace', 'strip', -- cgit v1.2.3 From 3334729cf29605389b51effc1f311656f3fd8086 Mon Sep 17 00:00:00 2001 From: Jay Soffian Date: Sun, 6 Jun 2010 19:31:34 -0400 Subject: commit.txt: clarify how --author argument is used commit --author was added by 146ea06 (git commit --author=$name: look $name up in existing commits), but its documentation was sorely lacking compared to its excellent commit message. This commit tries to improve the documentation. Signed-off-by: Jay Soffian Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Documentation/git-commit.txt') diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 64fb458b45..69eb86e450 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -95,10 +95,11 @@ OPTIONS read the message from the standard input. --author=:: - Override the author name used in the commit. You can use the - standard `A U Thor ` format. Otherwise, - an existing commit that matches the given string and its author - name is used. + Override the commit author. Specify an explicit author using the + standard `A U Thor ` format. Otherwise + is assumed to be a pattern and is used to search for an existing + commit by that author (i.e. rev-list --all -i --author=); + the commit author is then copied from the first such commit found. --date=:: Override the author date used in the commit. -- cgit v1.2.3