From 39cb6445d9bf5794723bb656499168c3d1b31774 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 25 Feb 2012 03:42:42 +0400 Subject: [PATCH 1/5] Makefile: add thread-utils.h to LIB_H Starting with commit v1.7.8-165-g0579f91, grep.h includes thread-utils.h, so the latter has to be added to LIB_H. Signed-off-by: Dmitry V. Levin Acked-by: Thomas Rast Signed-off-by: Junio C Hamano --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index b21d2f1417..3031be5ee6 100644 --- a/Makefile +++ b/Makefile @@ -576,6 +576,7 @@ LIB_H += streaming.h LIB_H += string-list.h LIB_H += submodule.h LIB_H += tag.h +LIB_H += thread-utils.h LIB_H += transport.h LIB_H += tree.h LIB_H += tree-walk.h From ad687b447a87efaf61c39075da2ef81b85715186 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Fri, 24 Feb 2012 23:31:22 -0500 Subject: [PATCH 2/5] rebase -m: only call "notes copy" when rewritten exists and is non-empty This prevents a shell error complaining rebase-merge/rewritten doesn't exist. Signed-off-by: Andrew Wong Signed-off-by: Junio C Hamano --- git-rebase--merge.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh index 26afc75cc7..dc599077f0 100644 --- a/git-rebase--merge.sh +++ b/git-rebase--merge.sh @@ -90,10 +90,13 @@ call_merge () { finish_rb_merge () { move_to_original_branch - git notes copy --for-rewrite=rebase < "$state_dir"/rewritten - if test -x "$GIT_DIR"/hooks/post-rewrite && - test -s "$state_dir"/rewritten; then - "$GIT_DIR"/hooks/post-rewrite rebase < "$state_dir"/rewritten + if test -s "$state_dir"/rewritten + then + git notes copy --for-rewrite=rebase <"$state_dir"/rewritten + if test -x "$GIT_DIR"/hooks/post-rewrite + then + "$GIT_DIR"/hooks/post-rewrite rebase <"$state_dir"/rewritten + fi fi rm -r "$state_dir" say All done. From f0c5793b37a53992611968ab4a1d62a0e3edc2dd Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 25 Feb 2012 18:34:26 +0100 Subject: [PATCH 3/5] am: don't infloop for an empty input file git-am.sh's check_patch_format function would attempt to preview the patch to guess its format, but would go into an infinite loop when the patch file happened to be empty. The solution: exit the loop when "read" fails, not when the line var, "$l1" becomes empty. Signed-off-by: Jim Meyering Signed-off-by: Junio C Hamano --- git-am.sh | 2 +- t/t4150-am.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/git-am.sh b/git-am.sh index 1c13b13991..f43a75b04b 100755 --- a/git-am.sh +++ b/git-am.sh @@ -201,7 +201,7 @@ check_patch_format () { l1= while test -z "$l1" do - read l1 + read l1 || break done read l2 read l3 diff --git a/t/t4150-am.sh b/t/t4150-am.sh index d7d9ccc1c8..03eee07ffb 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -495,4 +495,14 @@ test_expect_success 'am -q is quiet' ' ! test -s output.out ' +test_expect_success 'am empty-file does not infloop' ' + rm -fr .git/rebase-apply && + git reset --hard && + touch empty-file && + test_tick && + { git am empty-file > actual 2>&1 && false || :; } && + echo Patch format detection failed. >expected && + test_cmp expected actual +' + test_done From fba4f1259db8e5dc47b1c8e6e344c61f7eb4a9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kiedrowicz?= Date: Sat, 25 Feb 2012 10:24:28 +0100 Subject: [PATCH 4/5] grep -P: Fix matching ^ and $ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When "git grep" is run with -P/--perl-regexp, it doesn't match ^ and $ at the beginning/end of the line. This is because PCRE normally matches ^ and $ at the beginning/end of the whole text, not for each line, and "git grep" passes a large chunk of text (possibly containing many lines) to pcre_exec() and then splits the text into lines. This makes "git grep -P" behave differently from "git grep -E" and also from "grep -P" and "pcregrep": $ cat file a b $ git grep --no-index -P '^ ' file $ git grep --no-index -E '^ ' file file: b $ grep -c -P '^ ' file b $ pcregrep -c '^ ' file b Reported-by: Zbigniew Jędrzejewski-Szmek Signed-off-by: Michał Kiedrowicz Signed-off-by: Junio C Hamano --- grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grep.c b/grep.c index b29d09c7f6..9c5e1cd950 100644 --- a/grep.c +++ b/grep.c @@ -79,7 +79,7 @@ static void compile_pcre_regexp(struct grep_pat *p, const struct grep_opt *opt) { const char *error; int erroffset; - int options = 0; + int options = PCRE_MULTILINE; if (opt->ignore_case) options |= PCRE_CASELESS; From c524ceb12f65e2ad4fc68c9d5b39f6e4b6b5c17b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 26 Feb 2012 16:40:20 -0800 Subject: [PATCH 5/5] Git 1.7.8.5 Signed-off-by: Junio C Hamano --- Documentation/RelNotes/1.7.8.5.txt | 19 +++++++++++++++++++ GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 Documentation/RelNotes/1.7.8.5.txt diff --git a/Documentation/RelNotes/1.7.8.5.txt b/Documentation/RelNotes/1.7.8.5.txt new file mode 100644 index 0000000000..011fd2a428 --- /dev/null +++ b/Documentation/RelNotes/1.7.8.5.txt @@ -0,0 +1,19 @@ +Git v1.7.8.5 Release Notes +========================== + +Fixes since v1.7.8.4 +-------------------- + + * Dependency on our thread-utils.h header file was missing for + objects that depend on it in the Makefile. + + * "git am" when fed an empty file did not correctly finish reading it + when it attempts to guess the input format. + + * "git grep -P" (when PCRE is enabled in the build) did not match the + beginning and the end of the line correctly with ^ and $. + + * "git rebase -m" tried to run "git notes copy" needlessly when + nothing was rewritten. + +Also contains minor fixes and documentation updates. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 445190db7a..c95c200eeb 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.7.8.4 +DEF_VER=v1.7.8.5 LF=' ' diff --git a/RelNotes b/RelNotes index 5c6b14b694..dfc0e738d9 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/1.7.8.4.txt \ No newline at end of file +Documentation/RelNotes/1.7.8.5.txt \ No newline at end of file