Skip to contentSkip to conversation

git bisect should not expand file globs in log

BUG New Frans Pop 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore

Frans Pop

author
#0 lore raw

Hi,

During a git bisect session I ended up with the following in the .git/BISECT_LOG:

# bad: [38a382ae5dd4f4d04e3046816b0a41836094e538] Kobject: convert arch/alpha arch/arm arch/avr32 arch/blackfin arch/cris arch/frv arch/h8300 arch/ia64 arch/m32r arch/m68k arch/m68knommu arch/mips arch/parisc arch/powerpc arch/ppc arch/s390 arch/sh arch/sh64 arch/sparc arch/sparc64 arch/um arch/v850 arch/x86 arch/x86_64 arch/xtensa from kobject_unregister() to kobject_put()
git-bisect bad 38a382ae5dd4f4d04e3046816b0a41836094e538

Quoted 1 line

From the following command you can see shat happened: the 'arch/*' from the

commit log was expanded in the comment line in the bisect log file.

$ git bisect bad
38a382ae5dd4f4d04e3046816b0a41836094e538 is first bad commit
commit 38a382ae5dd4f4d04e3046816b0a41836094e538
Author: Greg Kroah-Hartman <[email protected]>
Date:   Thu Dec 20 08:13:05 2007 -0800

Kobject: convert arch/* from kobject_unregister() to kobject_put()

git version: 1.5.4 (current Debian unstable)

Cheers,
FJP

#1 lore raw

PATCH 1/1 Fix shell quoting in git-bisect

---
Frans Pop, Tue, Feb 12, 2008 20:23:28 +0100:

Quoted 9 lines

During a git bisect session I ended up with the following in the .git/BISECT_LOG:

# bad: [38a382ae5dd4f4d04e3046816b0a41836094e538] Kobject: convert arch/alpha arch/arm arch/avr32 arch/blackfin arch/cris arch/frv arch/h8300
...

From the following command you can see shat happened: the 'arch/*' from the commit log was expanded in the comment line in the bisect log file.

This should fix it

 git-bisect.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-bisect.sh +1 -1
index 5385249..0bb51d7 100755
@@ -131,7 +131,7 @@ bisect_write() {
 		*)		die "Bad bisect_write argument: $state" ;;
 	esac
 	git update-ref "refs/bisect/$tag" "$rev"
-	echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+	echo "# $state: $(git show-branch $rev)" >>"$GIT_DIR/BISECT_LOG"
 	test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
 }
 
Signature · 1 line
1.5.4.1.112.g94408
#2 lore raw
In reply to Frans Pop

Hi,

does this help? (It is a really trivial patch...)

-- snipsnap --
[PATCH] bisect: use verbatim commit subject in the bisect log

Due to a typo, the commit subject was shell expanded in the bisect log. That is, if you had some shell pattern in the commit subject, bisect would happily put all matching file names into the log.

Noticed by Frans Pop.

---
 git-bisect.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-bisect.sh +1 -1
index 5385249..0bb51d7 100755
@@ -131,7 +131,7 @@ bisect_write() {
 		*)		die "Bad bisect_write argument: $state" ;;
 	esac
 	git update-ref "refs/bisect/$tag" "$rev"
-	echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+	echo "# $state: $(git show-branch $rev)" >>"$GIT_DIR/BISECT_LOG"
 	test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
 }
 
Signature · 1 line
1.5.4.18.gb6d712
author Tested-by
#3 lore raw
Quoted 1 line · you

does this help? (It is a really trivial patch...)

Yes, it does. Thanks.

You beat Alex by about 15 minutes. If I'd known this was just shell script, I could've done the patch myself :-P

Quoted 9 lines

[PATCH] bisect: use verbatim commit subject in the bisect log

Due to a typo, the commit subject was shell expanded in the bisect log. That is, if you had some shell pattern in the commit subject, bisect would happily put all matching file names into the log.

Noticed by Frans Pop.