From 72130808173d3dfee85f2a29548fa9fec33a5351 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 13 Oct 2008 05:35:59 -0400 Subject: tests: shell negation portability fix Commit 969c8775 introduced a test which uses the non-portable construct: command1 && ! command2 | command3 which must be command1 && ! (command2 | command3) to work on bsd shells (this is another example of bbf08124, which fixed several similar cases). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t4128-apply-root.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4128-apply-root.sh b/t/t4128-apply-root.sh index bc7a8a868..8f6aea48d 100755 --- a/t/t4128-apply-root.sh +++ b/t/t4128-apply-root.sh @@ -72,7 +72,7 @@ test_expect_success 'apply --directory (delete file)' ' echo content >some/sub/dir/delfile && git add some/sub/dir/delfile && git apply --directory=some/sub/dir/ --index patch && - ! git ls-files | grep delfile + ! (git ls-files | grep delfile) ' cat > patch << 'EOF' -- cgit v1.2.1 From 1fb23e65503b4927fa1d4b59f9fbe27668ce347d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Sat, 18 Oct 2008 02:37:31 +0200 Subject: force_object_loose: Fix memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit read_packed_sha1 expectes its caller to free the buffer it returns, which force_object_loose didn't do. This leak is eventually triggered by "git gc", when it is manually invoked or there are too many packs around, making gc totally unusable when there are lots of unreachable objects. Signed-off-by: Björn Steinbrink Acked-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- sha1_file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sha1_file.c b/sha1_file.c index e2cb342a3..c78507152 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2322,6 +2322,7 @@ int force_object_loose(const unsigned char *sha1, time_t mtime) enum object_type type; char hdr[32]; int hdrlen; + int ret; if (has_loose_object(sha1)) return 0; @@ -2329,7 +2330,10 @@ int force_object_loose(const unsigned char *sha1, time_t mtime) if (!buf) return error("cannot read sha1_file for %s", sha1_to_hex(sha1)); hdrlen = sprintf(hdr, "%s %lu", typename(type), len) + 1; - return write_loose_object(sha1, hdr, hdrlen, buf, len, mtime); + ret = write_loose_object(sha1, hdr, hdrlen, buf, len, mtime); + free(buf); + + return ret; } int has_pack_index(const unsigned char *sha1) -- cgit v1.2.1 From 3b1eb124932772daee09419a581d418ea2d50045 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 17 Oct 2008 21:41:18 -0500 Subject: contrib: update packinfo.pl to not use dashed commands Signed-off-by: Dan McGee Signed-off-by: Junio C Hamano --- contrib/stats/packinfo.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/stats/packinfo.pl b/contrib/stats/packinfo.pl index f4a7b62cd..be188c0f1 100755 --- a/contrib/stats/packinfo.pl +++ b/contrib/stats/packinfo.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl # # This tool will print vaguely pretty information about a pack. It -# expects the output of "git-verify-pack -v" as input on stdin. +# expects the output of "git verify-pack -v" as input on stdin. # -# $ git-verify-pack -v | packinfo.pl +# $ git verify-pack -v | packinfo.pl # # This prints some full-pack statistics; currently "all sizes", "all # path sizes", "tree sizes", "tree path sizes", and "depths". @@ -20,7 +20,7 @@ # # When run as: # -# $ git-verify-pack -v | packinfo.pl -tree +# $ git verify-pack -v | packinfo.pl -tree # # the trees of objects are output along with the stats. This looks # like: @@ -43,7 +43,7 @@ # # When run as: # -# $ git-verify-pack -v | packinfo.pl -tree -filenames +# $ git verify-pack -v | packinfo.pl -tree -filenames # # it adds filenames to the tree. Getting this information is slow: # @@ -58,7 +58,7 @@ # # When run as: # -# $ git-verify-pack -v | packinfo.pl -dump +# $ git verify-pack -v | packinfo.pl -dump # # it prints out "sha1 size pathsize depth" for each sha1 in lexical # order. @@ -106,7 +106,7 @@ while () { } if ($filenames && ($tree || $dump)) { - open(NAMES, "git-name-rev --all|"); + open(NAMES, "git name-rev --all|"); while () { if (/^(\S+)\s+(.*)$/) { my ($sha1, $name) = ($1, $2); @@ -117,7 +117,7 @@ if ($filenames && ($tree || $dump)) { for my $commit (@commits) { my $name = $names{$commit}; - open(TREE, "git-ls-tree -t -r $commit|"); + open(TREE, "git ls-tree -t -r $commit|"); print STDERR "Plumbing tree $name\n"; while () { if (/^(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/) { -- cgit v1.2.1 From f07c3c53f8e7f243730de74918abcc72bd85c2ef Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 18 Oct 2008 08:20:51 -0700 Subject: diff(1): clarify what "T"ypechange status means Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 746646bb3..45885bbbb 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -134,7 +134,8 @@ endif::git-format-patch[] --diff-filter=[ACDMRTUXB*]:: Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their - type (mode) changed (`T`), are Unmerged (`U`), are + type (i.e. regular file, symlink, submodule, ...) changed (`T`), + are Unmerged (`U`), are Unknown (`X`), or have had their pairing Broken (`B`). Any combination of the filter characters may be used. When `*` (All-or-none) is added to the combination, all -- cgit v1.2.1 From f430c8e44d0548e844d817fc32be7c38b2b6856c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 18 Oct 2008 08:26:39 -0700 Subject: Hopefully the final draft release notes update before 1.6.0.3 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.6.0.3.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/RelNotes-1.6.0.3.txt b/Documentation/RelNotes-1.6.0.3.txt index 214a400aa..c0f037d6d 100644 --- a/Documentation/RelNotes-1.6.0.3.txt +++ b/Documentation/RelNotes-1.6.0.3.txt @@ -24,6 +24,12 @@ Fixes since v1.6.0.2 * "git diff --no-index" on binary files no longer outputs a bogus "diff --git" header line. +* "git diff" hunk header patterns with multiple elements separated by LF + were not used correctly. + +* "git gc" when ejecting otherwise unreachable objects from packfiles into + loose form leaked memory. + * Hunk headers in "git diff" default to using extended regular expressions, fixing some of the internal patterns on non-GNU platforms. @@ -47,6 +53,8 @@ Fixes since v1.6.0.2 * "git remote show -v" now displays all URLs of a remote. +* "git checkout -b branch" was confused when branch already existed. + * "git checkout -q" once again suppresses the locally modified file list. * "git clone -q", "git fetch -q" asks remote side to not send @@ -107,6 +115,6 @@ Many other documentation updates. -- exec >/var/tmp/1 -O=v1.6.0.2-95-g72d404d +O=v1.6.0.2-110-gf07c3c5 echo O=$(git describe maint) git shortlog --no-merges $O..maint -- cgit v1.2.1