From 8892048d516fffab2000c2b47e006d8d8ebaa8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Valdemar=20M=C3=B8rch?= Date: Fri, 25 Jul 2008 15:06:48 +0200 Subject: send-email: find body-encoding correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In 8291db6 (git-send-email: add charset header if we add encoded 'From', 2007-11-16), "$1" is used from a regexp without using () to capture anything in $1. Later, when that value was used, it causes a warning about a variable being undefined, instead of using the correct value for comparison (not that it makes difference in the current code that does not do actual re-encoding). Signed-off-by: Peter Valdemar Mørch Signed-off-by: Junio C Hamano diff --git a/git-send-email.perl b/git-send-email.perl index 0b04ba3..385ff7c 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -850,7 +850,7 @@ foreach my $t (@files) { } elsif (/^Content-type:/i) { $has_content_type = 1; - if (/charset="?[^ "]+/) { + if (/charset="?([^ "]+)/) { $body_encoding = $1; } push @xh, $_; -- cgit v0.10.2-6-g49f6 From 72de2883bd7d4ceda05f107826c7607c594de965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Thu, 24 Jul 2008 18:32:00 +0100 Subject: index-pack.c: correctly initialize appended objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When index-pack completes a thin pack it appends objects to the pack. Since the commit 92392b4(index-pack: Honor core.deltaBaseCacheLimit when resolving deltas) such an object can be pruned in case of memory pressure, and will be read back again by get_data_from_pack(). For this to work, the fields in object_entry structure need to be initialized properly. Noticed by Pierre Habouzit. Signed-off-by: Björn Steinbrink Acked-by: Nicolas Pitre Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano diff --git a/index-pack.c b/index-pack.c index c359f8c..7d5344a 100644 --- a/index-pack.c +++ b/index-pack.c @@ -698,6 +698,10 @@ static struct object_entry *append_obj_to_pack( write_or_die(output_fd, header, n); obj[0].idx.crc32 = crc32(0, Z_NULL, 0); obj[0].idx.crc32 = crc32(obj[0].idx.crc32, header, n); + obj[0].size = size; + obj[0].hdr_size = n; + obj[0].type = type; + obj[0].real_type = type; obj[1].idx.offset = obj[0].idx.offset + n; obj[1].idx.offset += write_compressed(output_fd, buf, size, &obj[0].idx.crc32); hashcpy(obj->idx.sha1, sha1); -- cgit v0.10.2-6-g49f6 From c30e699fc509f43f459c17d3148e7d866fb9157a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 25 Jul 2008 11:09:48 -0700 Subject: tests: propagate $(TAR) down from the toplevel Makefile Signed-off-by: Junio C Hamano diff --git a/Makefile b/Makefile index b003e3e..1d14209 100644 --- a/Makefile +++ b/Makefile @@ -1212,6 +1212,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS @echo SHELL_PATH=\''$(SHELL_PATH_SQ)'\' >$@ + @echo TAR=\''$(subst ','\'',$(TAR))'\' >>$@ ### Detect Tck/Tk interpreter path changes ifndef NO_TCLTK diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh index 9b0baac..5eb119e 100755 --- a/t/t5000-tar-tree.sh +++ b/t/t5000-tar-tree.sh @@ -25,7 +25,6 @@ commit id embedding: ' . ./test-lib.sh -TAR=${TAR:-tar} UNZIP=${UNZIP:-unzip} SUBSTFORMAT=%H%n -- cgit v0.10.2-6-g49f6 From bfce5087ee01fdead5cdc52180c8eef22adbbd71 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 25 Jul 2008 12:35:10 -0700 Subject: Makefile: fix shell quoting Makefile records paths to a few programs in GIT-BUILD-OPTIONS file. These paths need to be quoted twice: once to protect specials from the shell that runs the generated GIT-BUILD-OPTIONS file, and again to protect them (and the first level of quoting itself) from the shell that runs the "echo" inside the Makefile. You can test this by trying: $ ln -s /bin/tar "$HOME/Tes' program/tar" $ make TAR="$HOME/Tes' program/tar" test Signed-off-by: Junio C Hamano diff --git a/Makefile b/Makefile index 1d14209..f13184b 100644 --- a/Makefile +++ b/Makefile @@ -1210,9 +1210,12 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS echo "$$FLAGS" >GIT-CFLAGS; \ fi +# We need to apply sq twice, once to protect from the shell +# that runs GIT-BUILD-OPTIONS, and then again to protect it +# and the first level quoting from the shell that runs "echo". GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS - @echo SHELL_PATH=\''$(SHELL_PATH_SQ)'\' >$@ - @echo TAR=\''$(subst ','\'',$(TAR))'\' >>$@ + @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@ + @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@ ### Detect Tck/Tk interpreter path changes ifndef NO_TCLTK diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh index 5eb119e..87902f8 100755 --- a/t/t5000-tar-tree.sh +++ b/t/t5000-tar-tree.sh @@ -67,7 +67,7 @@ test_expect_success \ test_expect_success \ 'validate file modification time' \ 'mkdir extract && - $TAR xf b.tar -C extract a/a && + "$TAR" xf b.tar -C extract a/a && perl -e '\''print((stat("extract/a/a"))[9], "\n")'\'' >b.mtime && echo "1117231200" >expected.mtime && diff expected.mtime b.mtime' @@ -79,7 +79,7 @@ test_expect_success \ test_expect_success \ 'extract tar archive' \ - '(cd b && $TAR xf -)