From 2454ac7b9fbc12db5cca8cd388422360528d7d6f Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Fri, 16 Jan 2009 20:40:05 +0100 Subject: [PATCH 1/4] builtin-commit.c: do not remove COMMIT_EDITMSG git-commit tries to remove the file ./COMMIT_EDITMSG instead of $GIT_DIR/COMMIT_EDITMSG after commit preparation (e.g. running hooks, launching editor). This behavior exists since f5bbc3225c4b07 "Port git commit to C". Some test cases (e.g. t/t7502-commit.sh) rely on the existence of $GIT_DIR/COMMIT_EDITMSG after committing and, I guess, many people are used to it. So it is best not to remove it. This patch just removes the removal of COMMIT_EDITMSG. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- builtin-commit.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin-commit.c b/builtin-commit.c index 1e08399919..6cbdd55f16 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -625,7 +625,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix) if (!commitable && !in_merge && !allow_empty && !(amend && is_a_merge(head_sha1))) { run_status(stdout, index_file, prefix, 0); - unlink(commit_editmsg); return 0; } From 996869601594ffefb67238175055922340ced6f8 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Fri, 16 Jan 2009 21:36:06 +0100 Subject: [PATCH 2/4] githooks.txt: add missing word Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 5faaaa5fed..024abb2ff1 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -86,7 +86,7 @@ This hook is invoked by 'git-commit' 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 -that the commit log message. The second is the source of the commit +that contains 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 From bf474e2402e51843e8230c064da6ccfdf3a8ff54 Mon Sep 17 00:00:00 2001 From: Markus Heidelberg Date: Fri, 16 Jan 2009 22:42:33 +0100 Subject: [PATCH 3/4] Documentation: let asciidoc align related options Command line options can share the same paragraph of description, if they are related or synonymous. In these cases they should be written among each other, so that asciidoc can format them itself. Signed-off-by: Markus Heidelberg Signed-off-by: Junio C Hamano --- Documentation/git-diff-files.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt index 5c8c1d95a8..c526141564 100644 --- a/Documentation/git-diff-files.txt +++ b/Documentation/git-diff-files.txt @@ -21,7 +21,10 @@ OPTIONS ------- include::diff-options.txt[] --1 -2 -3 or --base --ours --theirs, and -0:: +-1 --base:: +-2 --ours:: +-3 --theirs:: +-0:: Diff against the "base" version, "our branch" or "their branch" respectively. With these options, diffs for merged entries are not shown. From 3aed2fda6f8233895be0d1142c4c4b407fb692c3 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 18 Jan 2009 04:46:09 +0100 Subject: [PATCH 4/4] builtin-fsck: fix off by one head count According to the man page, if "git fsck" is passed one or more heads, it should verify connectivity and validity of only objects reachable from the heads it is passed. However, since 5ac0a20 (Make builtin-fsck.c use parse_options., 2007-10-15) the command behaved as if no heads were passed, when given only one argument. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- builtin-fsck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-fsck.c b/builtin-fsck.c index 30971ce0ad..aa4b239e42 100644 --- a/builtin-fsck.c +++ b/builtin-fsck.c @@ -624,7 +624,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) } heads = 0; - for (i = 1; i < argc; i++) { + for (i = 0; i < argc; i++) { const char *arg = argv[i]; if (!get_sha1(arg, head_sha1)) { struct object *obj = lookup_object(head_sha1);