From 720c9f7bda20d8f307745772374647c1a2076b3d Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Mon, 8 Feb 2010 10:39:01 -0500 Subject: [PATCH 01/19] Revert "pack-objects: fix pack generation when using pack_size_limit" This reverts most of commit a2430dde8ceaaaabf05937438249397b883ca77a. That commit made the situation better for repositories with relatively small number of objects. However with many objects and a small pack size limit, the time required to complete the repack tends towards O(n^2), or even much worse with long delta chains. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- builtin-pack-objects.c | 20 +++++++++----------- t/t5300-pack-object.sh | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index dcfe62aa02..e1d3adf405 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -445,13 +445,9 @@ static int write_one(struct sha1file *f, if (e->idx.offset || e->preferred_base) return -1; - /* - * If we are deltified, attempt to write out base object first. - * If that fails due to the pack size limit then the current - * object might still possibly fit undeltified within that limit. - */ - if (e->delta) - write_one(f, e->delta, offset); + /* if we are deltified, write out base object first. */ + if (e->delta && !write_one(f, e->delta, offset)) + return 0; e->idx.offset = *offset; size = write_object(f, e, *offset); @@ -505,9 +501,11 @@ static void write_pack_file(void) sha1write(f, &hdr, sizeof(hdr)); offset = sizeof(hdr); nr_written = 0; - for (i = 0; i < nr_objects; i++) - if (write_one(f, objects + i, &offset) == 1) - display_progress(progress_state, written); + for (; i < nr_objects; i++) { + if (!write_one(f, objects + i, &offset)) + break; + display_progress(progress_state, written); + } /* * Did we write the wrong # entries in the header? @@ -582,7 +580,7 @@ static void write_pack_file(void) written_list[j]->offset = (off_t)-1; } nr_remaining -= nr_written; - } while (nr_remaining); + } while (nr_remaining && i < nr_objects); free(written_list); stop_progress(&progress_state); diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 1058d981dc..7649b810b1 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -389,7 +389,7 @@ test_expect_success 'verify resulting packs' ' test_expect_success 'tolerate packsizelimit smaller than biggest object' ' git config pack.packSizeLimit 1 && packname_11=$(git pack-objects test-11 Date: Mon, 8 Feb 2010 12:12:41 -0800 Subject: [PATCH 02/19] git-add documentation: Fix shell quoting example When 921177f (Documentation: improve "add", "pull" and "format-patch" examples, 2008-05-07) converted this from enumeration header to displayed text, it failed to adjust for the AsciiDoc's rule to quote backslashes. In displayed text, backslash is shown verbatim, while in enumeration header, we need to double it. We have a similar construct in git-rm.txt documentation, and need to be careful when somebody wants to update it to match the style of the "git add" example. Noticed by: Greg Bacon Signed-off-by: Junio C Hamano --- Documentation/git-add.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 2eabbc8f7c..f14319a740 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -103,7 +103,7 @@ EXAMPLES and its subdirectories: + ------------ -$ git add Documentation/\\*.txt +$ git add Documentation/\*.txt ------------ + Note that the asterisk `\*` is quoted from the shell in this From ace706e2a6213d4252b6862786dd93c71bcbd69f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 6 Feb 2010 11:26:35 -0800 Subject: [PATCH 03/19] Fix parsing of imap.preformattedHTML and imap.sslverify These two variables are boolean and can lack "= value" in the configuration file. Do not reject such input early in the parser callback function. Also the key are downcased before being given to the callback, so we should run strcmp() with keyword spelled in all-lowercase. Signed-off-by: Junio C Hamano --- imap-send.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/imap-send.c b/imap-send.c index cb518eb613..77acd68506 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1399,11 +1399,16 @@ static int git_imap_config(const char *key, const char *val, void *cb) if (strncmp(key, imap_key, sizeof imap_key - 1)) return 0; - if (!val) - return config_error_nonbool(key); - key += sizeof imap_key - 1; + /* check booleans first, and barf on others */ + if (!strcmp("sslverify", key)) + server.ssl_verify = git_config_bool(key, val); + else if (!strcmp("preformattedhtml", key)) + server.use_html = git_config_bool(key, val); + else if (!val) + return config_error_nonbool(key); + if (!strcmp("folder", key)) { imap_folder = xstrdup(val); } else if (!strcmp("host", key)) { @@ -1424,10 +1429,6 @@ static int git_imap_config(const char *key, const char *val, void *cb) server.port = git_config_int(key, val); else if (!strcmp("tunnel", key)) server.tunnel = xstrdup(val); - else if (!strcmp("sslverify", key)) - server.ssl_verify = git_config_bool(key, val); - else if (!strcmp("preformattedHTML", key)) - server.use_html = git_config_bool(key, val); return 0; } From b7047abc1213719c225a481f9618ca5a250e6fe9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 8 Feb 2010 16:45:21 -0800 Subject: [PATCH 04/19] git-push: document all the status flags used in the output We didn't talk about '-' (deletion), '*' (addition), nor '+' (forced). Signed-off-by: Junio C Hamano --- Documentation/git-push.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 2653388fd8..5d21ca8850 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -159,12 +159,17 @@ If --porcelain is used, then each line of the output is of the form: \t : \t () ------------------------------- +The status of up-to-date refs is shown only if --porcelain or --verbose +option is used. + flag:: - A single character indicating the status of the ref. This is - blank for a successfully pushed ref, `!` for a ref that was - rejected or failed to push, and '=' for a ref that was up to - date and did not need pushing (note that the status of up to - date refs is shown only when `git push` is running verbosely). + A single character indicating the status of the ref: +(space);; for a successfully pushed fast-forward; +`{plus}`;; for a successful forced update; +`-`;; for a successfully deleted ref; +`*`;; for a successfully pushed new ref; +`!`;; for a ref that was rejected or failed to push; and +`=`;; for a ref that was up to date and did not need pushing. summary:: For a successfully pushed ref, the summary shows the old and new From 92f9e273e86d505e4c2a28bc053eb514ca2cc552 Mon Sep 17 00:00:00 2001 From: Jay Soffian Date: Mon, 8 Feb 2010 22:48:13 -0500 Subject: [PATCH 05/19] blame: prevent a segv when -L given start > EOF blame would segv if given -L with past the end of the file. While we're fixing the bug, add test cases for an invalid when called as -L , or -L. Signed-off-by: Jay Soffian Signed-off-by: Junio C Hamano --- builtin-blame.c | 2 +- t/t8003-blame.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/builtin-blame.c b/builtin-blame.c index 98e818ce6a..4094f3c061 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -2432,7 +2432,7 @@ parse_done: if (top < 1) top = lno; bottom--; - if (lno < top) + if (lno < top || lno < bottom) die("file %s has only %lu lines", path, lno); ent = xcalloc(1, sizeof(*ent)); diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh index ad834f200a..4a8db74f7e 100755 --- a/t/t8003-blame.sh +++ b/t/t8003-blame.sh @@ -157,4 +157,12 @@ EOF git --no-pager blame $COMMIT -- uno >/dev/null ' +test_expect_success 'blame -L with invalid start' ' + test_must_fail git blame -L5 tres 2>&1 | grep "has only 2 lines" +' + +test_expect_success 'blame -L with invalid end' ' + git blame -L1,5 tres 2>&1 | grep "has only 2 lines" +' + test_done From 8b2337a5893479ee18dfb21a1d4aa5fc1608872d Mon Sep 17 00:00:00 2001 From: Brian Gernhardt Date: Mon, 8 Feb 2010 23:07:25 -0500 Subject: [PATCH 06/19] t3902: Protect against OS X normalization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8424981: "Fix invalid read in quote_c_style_counted" introduced a test that used "caractère spécial" as a directory name. Git creates it as "caract\303\250re sp\303\251cial" OS X stores it as "caracte\314\200re spe\314\201cial" To work around this problem, use the already introduced $FN as the directory name. Signed-off-by: Brian Gernhardt Signed-off-by: Junio C Hamano --- t/t3902-quoted.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t3902-quoted.sh b/t/t3902-quoted.sh index 14da45fe5a..29103f65dc 100755 --- a/t/t3902-quoted.sh +++ b/t/t3902-quoted.sh @@ -25,7 +25,7 @@ for_each_name () { for name in \ Name "Name and a${LF}LF" "Name and an${HT}HT" "Name${DQ}" \ "$FN$HT$GN" "$FN$LF$GN" "$FN $GN" "$FN$GN" "$FN$DQ$GN" \ - "With SP in it" "caractère spécial/file" + "With SP in it" "$FN/file" do eval "$1" done @@ -33,7 +33,7 @@ for_each_name () { test_expect_success setup ' - mkdir "caractère spécial" && + mkdir "$FN" && for_each_name "echo initial >\"\$name\"" git add . && git commit -q -m Initial && @@ -51,11 +51,11 @@ Name "Name and an\tHT" "Name\"" With SP in it -"caract\303\250re sp\303\251cial/file" "\346\277\261\351\207\216\t\347\264\224" "\346\277\261\351\207\216\n\347\264\224" "\346\277\261\351\207\216 \347\264\224" "\346\277\261\351\207\216\"\347\264\224" +"\346\277\261\351\207\216/file" "\346\277\261\351\207\216\347\264\224" EOF @@ -65,11 +65,11 @@ Name "Name and an\tHT" "Name\"" With SP in it -caractère spécial/file "濱野\t純" "濱野\n純" 濱野 純 "濱野\"純" +濱野/file 濱野純 EOF From 3c651491f28e01a9ee0ddaecd05fb7a211d218c3 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Wed, 10 Feb 2010 17:30:29 +0100 Subject: [PATCH 07/19] Documentation: quote braces in {upstream} notation The lack of quoting made the entire line disappear. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- Documentation/git-rev-parse.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index fc731525da..d677c72d5e 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -244,7 +244,7 @@ when you run 'git merge'. * The special construct '@\{-\}' means the th branch checked out before the current one. -* The suffix '@{upstream}' to a ref (short form 'ref@{u}') refers to +* The suffix '@\{upstream\}' to a ref (short form 'ref@\{u\}') refers to the branch the ref is set to build on top of. Missing ref defaults to the current branch. From 8ff883029a97b38b893b15199393d0e4e7190c0d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 10 Feb 2010 10:18:55 -0800 Subject: [PATCH 08/19] check-ref-format documentation: fix enumeration mark-up The last item in the enumerated refname rule was mistakenly made into a sub-item of the 7th one. It should be the 8th one in the list on its own. Signed-off-by: Junio C Hamano --- Documentation/git-check-ref-format.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt index 0aeef24780..3f7835f4a7 100644 --- a/Documentation/git-check-ref-format.txt +++ b/Documentation/git-check-ref-format.txt @@ -43,7 +43,7 @@ imposes the following rules on how references are named: . They cannot contain a sequence `@{`. -- They cannot contain a `\\`. +. They cannot contain a `\\`. These rules make it easy for shell script based tools to parse reference names, pathname expansion by the shell when a reference name is used From 33f0ea42e12d3f54ef8ff53580649885c1503d05 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 9 Feb 2010 10:06:33 -0800 Subject: [PATCH 09/19] t8003: check exit code of command and error message separately Shell reports exit status only from the most downstream command in a pipeline. In these tests, we want to make sure that the command fails in a controlled way, and produces a correct error message. This issue was known by Jay who submitted the patch, and also was pointed out by Hannes during the review process, but I forgot to fix it up before applying. Sorry about that. Signed-off-by: Junio C Hamano --- t/t8003-blame.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh index 4a8db74f7e..3bbddd03cb 100755 --- a/t/t8003-blame.sh +++ b/t/t8003-blame.sh @@ -158,11 +158,13 @@ EOF ' test_expect_success 'blame -L with invalid start' ' - test_must_fail git blame -L5 tres 2>&1 | grep "has only 2 lines" + test_must_fail git blame -L5 tres 2>errors && + grep "has only 2 lines" errors ' test_expect_success 'blame -L with invalid end' ' - git blame -L1,5 tres 2>&1 | grep "has only 2 lines" + test_must_fail git blame -L1,5 tres 2>errors && + grep "has only 2 lines" errors ' test_done From 4133fd25525022f99d2c7ba339618433bdd919fe Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 10 Feb 2010 13:44:11 -0800 Subject: [PATCH 10/19] Git 1.6.6.2 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.6.6.2.txt | 46 ++++++++++++++++++++++++++++++ Documentation/git.txt | 3 +- GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 Documentation/RelNotes-1.6.6.2.txt diff --git a/Documentation/RelNotes-1.6.6.2.txt b/Documentation/RelNotes-1.6.6.2.txt new file mode 100644 index 0000000000..1a0ba377cf --- /dev/null +++ b/Documentation/RelNotes-1.6.6.2.txt @@ -0,0 +1,46 @@ +Git v1.6.6.2 Release Notes +========================== + +Fixes since v1.6.6.2 +-------------------- + + * recursive merge didn't correctly diagnose its own programming errors, + and instead caused the caller to segfault. + + * The new "smart http" aware clients probed the web servers to see if + they support smart http, but did not fall back to dumb http transport + correctly with some servers. + + * Time based reflog syntax e.g. "@{yesterday}" didn't diagnose a misspelled + time specification and instead assumed "@{now}". + + * "git archive HEAD -- no-such-directory" produced an empty archive + without complaining. + + * "git blame -L start,end -- file" misbehaved when given a start that is + larger than the number of lines in the file. + + * "git checkout -m" didn't correctly call custom merge backend supplied + by the end user. + + * "git config -f " misbehaved when run from a subdirectory. + + * "git cvsserver" didn't like having regex metacharacters (e.g. '+') in + CVSROOT environment. + + * "git fast-import" did not correctly handle large blobs that may + bust the pack size limit. + + * "git gui" is supposed to work even when launched from inside a .git + directory. + + * "git gui" misbehaved when applying a hunk that ends with deletion. + + * "git imap-send" did not honor imap.preformattedHTML as documented. + + * "git log" family incorrectly showed the commit notes unconditionally by + mistake, which was especially irritating when running "git log --oneline". + + * "git status" shouldn't require an write access to the repository. + +Other minor documentation updates are included. diff --git a/Documentation/git.txt b/Documentation/git.txt index b6df39ba36..b4c2bcc45b 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master' branch of the `git.git` repository. Documentation for older releases are available here: -* link:v1.6.6.1/git.html[documentation for release 1.6.6.1] +* link:v1.6.6.2/git.html[documentation for release 1.6.6.2] * release notes for + link:RelNotes-1.6.6.2.txt[1.6.6.2], link:RelNotes-1.6.6.1.txt[1.6.6.1], link:RelNotes-1.6.6.txt[1.6.6]. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 4e0adcade9..081be51a9e 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.6.6.1 +DEF_VER=v1.6.6.2 LF=' ' diff --git a/RelNotes b/RelNotes index d57124075c..692968f170 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes-1.6.6.1.txt \ No newline at end of file +Documentation/RelNotes-1.6.6.2.txt \ No newline at end of file From f476c0b7b30b26157b4a12b565a08a3c015edf6d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 10 Feb 2010 13:47:46 -0800 Subject: [PATCH 11/19] Update draft release notes to 1.7.0 one more time Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.7.0.txt | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Documentation/RelNotes-1.7.0.txt b/Documentation/RelNotes-1.7.0.txt index 0897287979..2fedb6656a 100644 --- a/Documentation/RelNotes-1.7.0.txt +++ b/Documentation/RelNotes-1.7.0.txt @@ -63,7 +63,7 @@ Updates since v1.6.6 * "git svn" support of subversion "merge tickets" and miscellaneous fixes. - * "gitk" updates. + * "gitk" and "git gui" translation updates. * "gitweb" updates (code clean-up, load checking etc.) @@ -200,14 +200,6 @@ release, unless otherwise noted. the branch is fully merged to its upstream branch if it is not merged to the current branch. It now deletes it in such a case. - * "git config -f " run from a subdirectory misbehaved. - 65807ee (builtin-config: Fix crash when using "-f " - from non-root dir, 2010-01-26) may be merged to older maintenance - branches. - - * "git fast-import" did not correctly handle large blobs that may - bust the pack size limit. - * When using "git status" or asking "git diff" to compare the work tree with something, they used to consider that a checked-out submodule with uncommitted changes is not modified; this could cause people to forget @@ -215,9 +207,3 @@ release, unless otherwise noted. superproject. They now consider such a change as a modification and "git diff" will append a "-dirty" to the work tree side when generating patch output or when used with the --submodule option. - --- -exec >/var/tmp/1 -O=v1.7.0-rc1-42-g3bd8de5 -echo O=$(git describe master) -git shortlog --no-merges $O..master ^maint From c8089af6c6754153d75de74d0f147adcd46a6b59 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 11 Feb 2010 17:27:14 -0500 Subject: [PATCH 12/19] am: switch --resolved to --continue Rebase calls this same function "--continue", which means users may be trained to type it. There is no reason to deprecate --resolved (or -r), so we will keep it as a synonym. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/git-am.txt | 3 ++- git-am.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index c3e4f12c44..c66c565bbe 100644 --- a/Documentation/git-am.txt +++ b/Documentation/git-am.txt @@ -15,7 +15,7 @@ SYNOPSIS [--whitespace=