From 76bf488e61b8a87191a1779b79820545e64ef275 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 2 Dec 2009 09:59:35 -0800 Subject: [PATCH 1/3] Do not misidentify "git merge foo HEAD" as an old-style invocation This was misinterpreted as an ancient style "git merge HEAD ..." that merges one (or more) into the current branch and record the resulting commit with the given message. Then a later sanity check found that there is no specified and gave a usage message. Tested-by: Nanako Shiraishi Signed-off-by: Junio C Hamano --- builtin-merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-merge.c b/builtin-merge.c index e95c5dc717..e5cf795307 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -792,7 +792,7 @@ static int suggest_conflicts(void) static struct commit *is_old_style_invocation(int argc, const char **argv) { struct commit *second_token = NULL; - if (argc > 1) { + if (argc > 2) { unsigned char second_sha1[20]; if (get_sha1(argv[1], second_sha1)) From ce9d823b9141756b5e60aa6c62653adb08e7213b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 2 Dec 2009 10:00:58 -0800 Subject: [PATCH 2/3] merge: do not add standard message when message is given with -m option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even if the user explicitly gave her own message to "git merge", the command still added its standard merge message. It resulted in a useless repetition like this: % git merge -m "Merge early part of side branch" `git rev-parse side~2` % git show -s commit 37217141e7519629353738d5e4e677a15096206f Merge: e68e646 a1d2374 Author: しらいし ななこ Date: Wed Dec 2 14:33:20 2009 +0900 Merge early part of side branch Merge commit 'a1d2374f8f52f4e8a53171601a920b538a6cec23' The gave her own message because she didn't want git to add the standard message (if she wanted to, she wouldn't have given one, or she would have prepared it using git-fmt-merge-msg command). Noticed by Nanako Shiraishi Signed-off-by: Junio C Hamano --- builtin-merge.c | 14 ++++++++------ t/t7604-merge-custom-message.sh | 7 ++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/builtin-merge.c b/builtin-merge.c index e5cf795307..2871419143 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -70,7 +70,7 @@ static int option_parse_message(const struct option *opt, if (unset) strbuf_setlen(buf, 0); else if (arg) { - strbuf_addf(buf, "%s\n\n", arg); + strbuf_addf(buf, "%s%s", buf->len ? "\n\n" : "", arg); have_message = 1; } else return error("switch `m' requires a value"); @@ -927,11 +927,13 @@ int cmd_merge(int argc, const char **argv, const char *prefix) * codepath so we discard the error in this * loop. */ - for (i = 0; i < argc; i++) - merge_name(argv[i], &msg); - fmt_merge_msg(option_log, &msg, &merge_msg); - if (merge_msg.len) - strbuf_setlen(&merge_msg, merge_msg.len-1); + if (!have_message) { + for (i = 0; i < argc; i++) + merge_name(argv[i], &msg); + fmt_merge_msg(option_log, &msg, &merge_msg); + if (merge_msg.len) + strbuf_setlen(&merge_msg, merge_msg.len-1); + } } if (head_invalid || !argc) diff --git a/t/t7604-merge-custom-message.sh b/t/t7604-merge-custom-message.sh index de977c5e2f..269cfdf267 100755 --- a/t/t7604-merge-custom-message.sh +++ b/t/t7604-merge-custom-message.sh @@ -22,15 +22,12 @@ test_expect_success 'setup' ' git tag c2 ' -cat >expected <<\EOF -custom message -Merge commit 'c2' -EOF test_expect_success 'merge c2 with a custom message' ' git reset --hard c1 && + echo >expected "custom message" && git merge -m "custom message" c2 && - git cat-file commit HEAD | sed -e "1,/^$/d" > actual && + git cat-file commit HEAD | sed -e "1,/^$/d" >actual && test_cmp expected actual ' From 28044baba6d268d91057398ffa041ee1b931a5e0 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 2 Dec 2009 10:29:00 -0800 Subject: [PATCH 3/3] Prepare for 1.6.5.4 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.6.5.4.txt | 32 ++++++++++++++++++++++++++++++ RelNotes | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Documentation/RelNotes-1.6.5.4.txt diff --git a/Documentation/RelNotes-1.6.5.4.txt b/Documentation/RelNotes-1.6.5.4.txt new file mode 100644 index 0000000000..e42f8b2397 --- /dev/null +++ b/Documentation/RelNotes-1.6.5.4.txt @@ -0,0 +1,32 @@ +Git v1.6.5.4 Release Notes +========================== + +Fixes since v1.6.5.3 +-------------------- + + * "git help" (without argument) used to check if you are in a directory + under git control. There was no breakage in behaviour per-se, but this + was unnecessary. + + * "git prune-packed" gave progress output even when its standard error is + not connected to a terminal; this caused cron jobs that run it to + produce crufts. + + * "git pack-objects --all-progress" is an option to ask progress output + from write-object phase _if_ progress output were to be produced, and + shouldn't have forced the progress output. + + * "git apply -p --directory=" did not work well for a + non-default value of n. + + * "git merge foo HEAD" was misparsed as an old-style invocation of the + command and produced a confusing error message. As it does not specify + any other branch to merge, it shouldn't be mistaken as such. We will + remove the old style "git merge HEAD ..." syntax in + future versions, but not in this release, + + * "git merge -m ..." added the standard merge message + on its own after user-supplied message, which should have overrided the + standard one. + +Other minor documentation updates are included. diff --git a/RelNotes b/RelNotes index a6a1c01f73..918bab855c 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes-1.6.5.3.txt \ No newline at end of file +Documentation/RelNotes-1.6.5.4.txt \ No newline at end of file