From bbb1b8a35a06203020f7ab6d1ad58bcb4afe8e93 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 28 Jun 2010 04:59:07 -0400 Subject: [PATCH 1/3] notes: check number of parameters to "git notes copy" Otherwise we may segfault with too few parameters. Signed-off-by: Jeff King Tested-by: Bert Wesarg Signed-off-by: Junio C Hamano --- builtin/notes.c | 4 ++++ t/t3301-notes.sh | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/builtin/notes.c b/builtin/notes.c index da504ee0af..f678f9cb52 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -614,6 +614,10 @@ static int copy(int argc, const char **argv, const char *prefix) } } + if (argc < 2) { + error("too few parameters"); + usage_with_options(git_notes_copy_usage, options); + } if (2 < argc) { error("too many parameters"); usage_with_options(git_notes_copy_usage, options); diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index 64f32ad94d..2d67a40fc1 100755 --- a/t/t3301-notes.sh +++ b/t/t3301-notes.sh @@ -1044,4 +1044,10 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' ' git log -1 > output && test_cmp expect output ' + +test_expect_success 'git notes copy diagnoses too many or too few parameters' ' + test_must_fail git notes copy && + test_must_fail git notes copy one two three +' + test_done From 89fe121d5fd808391ee38b7f39b88cb3f912776f Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Mon, 21 Jun 2010 19:52:29 +0100 Subject: [PATCH 2/3] notes: Initialise variable to appease gcc gcc version 3.4.4 thinks that the 'cmp' variable could be used while uninitialised and complains thus: notes.c: In function `write_each_non_note_until': notes.c:719: warning: 'cmp' might be used uninitialized in \ this function Note that gcc versions 4.1.2 and 4.4.0 do not issue this warning. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- notes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes.c b/notes.c index e425e19827..cc92cf351a 100644 --- a/notes.c +++ b/notes.c @@ -716,7 +716,7 @@ static int write_each_non_note_until(const char *note_path, struct write_each_note_data *d) { struct non_note *n = d->next_non_note; - int cmp, ret; + int cmp = 0, ret; while (n && (!note_path || (cmp = strcmp(n->path, note_path)) <= 0)) { if (note_path && cmp == 0) ; /* do nothing, prefer note to non-note */ From edac1883dc5fbadbc2d7d7cf975ed347eaef0702 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 28 Jun 2010 17:42:18 -0700 Subject: [PATCH 3/3] Update draft release notes to 1.7.1.1 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.7.1.1.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Documentation/RelNotes-1.7.1.1.txt b/Documentation/RelNotes-1.7.1.1.txt index bfdb5ba064..1f94db8bdd 100644 --- a/Documentation/RelNotes-1.7.1.1.txt +++ b/Documentation/RelNotes-1.7.1.1.txt @@ -17,6 +17,13 @@ Fixes since v1.7.1 * We didn't recognize timezone "Z" as a synonym for "UTC" (75b37e70). + * In 1.7.0, read-tree and user commands that use the mechanism such as + checkout and merge were fixed to handle switching between branches one + of which has a file while the other has a directory at the same path + correctly even when there are some "confusing" pathnames in them. But + the algorithm used for this fix was suboptimal and had a terrible + performance degradation especially in larger trees. + * "git am -3" did not show diagnosis when the patch in the message was corrupt. * After "git apply --whitespace=fix" removed trailing blank lines in an @@ -57,10 +64,15 @@ Fixes since v1.7.1 * "git merge --log" used to replace the custom message given by "-m" with the shortlog, instead of appending to it. + * "git notes copy" without any other argument segfaulted. + * "git pull" accepted "--dry-run", gave it to underlying "git fetch" but ignored the option itself, resulting in a bogus attempt to merge unrelated commit. + * "git rebase" did not faithfully reproduce a malformed author ident, that + is often seen in a repository converted from foreign SCMs. + * "git reset --hard" started from a wrong directory and a working tree in a nonstandard location is in use got confused. @@ -68,6 +80,9 @@ Fixes since v1.7.1 EHLO/HELO exchange, causing rejected connection from picky servers. It learned --smtp-domain option to solve this issue. + * "git send-email" did not declare a content-transfer-encoding and + content-type even when its payload needs to be sent in 8-bit. + * "git show -C -C" and other corner cases lost diff metainfo output in 1.7.0. @@ -83,6 +98,6 @@ And other minor fixes and documentation updates. -- exec >/var/tmp/1 -O=v1.7.1-195-gb2ebbd8 +O=v1.7.1-211-g54fcb21 echo O=$(git describe HEAD) git shortlog --no-merges HEAD ^$O