[git-users] Re: Getting the bad commit from git bisect run?

2012-01-06 Thread Thomas Ferris Nicolaisen
Ah, glad I could help then. I also learned git-bisect and a bit of 
shell-script in the process :)

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/tnr4KPeCsMYJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-06 Thread petter
On 5 Jan, 23:36, Thomas Ferris Nicolaisen  wrote:
> Thanks for the example. I'm indeed able to recreate the problem. I guess
> that that's just the way it works, and my toy repo landed on the failing
> commit by accident. Sorry for misleading.

Good that you were able to re-produce it so that I know that my repo
was not corrupted.

> How about you just use the contents of that file mentioned in the docs?
>
> cat .git/refs/bisect/bad

Just what I was looking for. Thanks! Unfortunately I overlooked that
part when I checked the docs. Probably not a very well known feature
as that would have been a quick response to my initial question.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread Thomas Ferris Nicolaisen
By the way, you need to inspect that file *before* you do git bisect reset.

You can also do git rev-parse bisect/bad, which prints the same thing.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/X6hfDvViPhQJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread Thomas Ferris Nicolaisen
Thanks for the example. I'm indeed able to recreate the problem. I guess 
that that's just the way it works, and my toy repo landed on the failing 
commit by accident. Sorry for misleading.

How about you just use the contents of that file mentioned in the docs?

cat .git/refs/bisect/bad

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/-77JICWUuOMJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread petter
On 5 Jan, 16:30, Thomas Ferris Nicolaisen  wrote:
> The intention of bisect is to get the first bad commit. From the docs:
>
> "Eventually there will be no more revisions left to bisect, and you will
> have been left with the first bad kernel revision in "refs/bisect/bad"."
>
> So git bisect run ending up with a commit which is "good" doesn't make
> sense.

Well, it clearly tells me which is the bad commit. But HEAD seem to be
left at the last iteration.

> If you manually run the test/script again, after running git bisect run -
> is the result actually positive (returncode is 0)?

bisect-test-run  ; echo "dollar qmark is $?"
gives:
dollar qmark is 0

> Can you try manually bisecting and see if you end up with the same results?

That will take too long as each iteration is long and I don't have
time to sit and wait for each one.

> If all else fails, try re-creating the problem in a little dummy project,
> which you can share with us (put on github or something).

But I can make a small example to reproduce this. You can try to run
it yourself.

mkdir remove-me.git
cd remove-me.git
git init
cat  > hello.sh < this-is-good
sed -i s/c1/c2/ hello.sh
git commit -m "c2" hello.sh
sed -i s/c2/c3/ hello.sh
git commit -m "c3" hello.sh
sed -i s/c3/c4/ hello.sh
sed -i s/true/false/ hello.sh
git commit -m "c4" hello.sh
git rev-parse HEAD > this-is-bad

git bisect start
git bisect good $(cat this-is-good)
git bisect bad $(cat this-is-bad)
git bisect run ./hello.sh > git-bisect-run.out

git rev-parse HEAD > this-is-after-git-bisect-run
git bisect log | grep 'git bisect'
git bisect reset
sed -n s'/\([0-9a-f]\{40\}\) is the first bad commit/\1/p' git-bisect-
run.out
cat this-is-after-git-bisect-run

I get the following result:

git bisect start
git bisect good 5d3b094d474098be2db9873b2e967b7b09341a3a
git bisect bad f2e0970cd5f6ce94dd9a4fa887a76daa8b5cf95e
git bisect good 6d63d6f4f9152676b4d6cb4f8a68d64a1c5133e1
git bisect reset
Previous HEAD position was 6d63d6f... c3
Switched to branch 'master'
sed -n s'/\([0-9a-f]\{40\}\) is the first bad commit/\1/p' git-bisect-
run.out
f2e0970cd5f6ce94dd9a4fa887a76daa8b5cf95e
cat this-is-after-git-bisect-run
6d63d6f4f9152676b4d6cb4f8a68d64a1c5133e1



-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread Thomas Ferris Nicolaisen
The intention of bisect is to get the first bad commit. From the docs:

"Eventually there will be no more revisions left to bisect, and you will 
have been left with the first bad kernel revision in "refs/bisect/bad"."

So git bisect run ending up with a commit which is "good" doesn't make 
sense.

If you manually run the test/script again, after running git bisect run - 
is the result actually positive (returncode is 0)?

Can you try manually bisecting and see if you end up with the same results?

If all else fails, try re-creating the problem in a little dummy project, 
which you can share with us (put on github or something).

A small note: If the test (by way of error in the test script, or wrongly 
specified revision range) always is positive, you will also get some 
confusing results.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/XUldNZBv6B0J.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread petter
On 5 Jan, 14:40, Thomas Ferris Nicolaisen  wrote:
> I still believe that there's something fishy going on in your test.. Care
> to share some concrete examples?

Immediately after git bisect run HEAD is at d9:

git rev-parse HEAD
d9ab70394d306d5ab450513b2f69c8b81f6f255c

The bad commit is:
sed -n s'/\([0-9a-f]\{40\}\) is the first bad commit/\1/p' git-bisect-
run.out
e8035d1d31d528ade3d991c575be7140fe17624c

The log:

git bisect log | grep 'git bisect'
git bisect start
git bisect bad e8035d1d31d528ade3d991c575be7140fe17624c
git bisect good a0dea7d93fc40686c5e0b07cf04c2fda6a53dc9e
git bisect good c5612aa2a37b3e610e726fdc2fcc9d5c8c9adf17
git bisect good 7f47189e0ba6fa1ad19c32b8059b4f39d8e6ff75
git bisect good 0c78b8538c5966cf9424c9bb2128324779ce00ca
git bisect good d9ab70394d306d5ab450513b2f69c8b81f6f255c

e8 is the only bad commit in this case, but I think it boils down to
if the last run which was performed was a good or a bad. In my case it
was a good, in your case if was a bad.

Seems like git bisect run just stops with HEAD at the last iteration,
but it would have been nice if it was a way to get the bad commit
after a successful bisect

git --version
git version 1.7.3.4

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread Thomas Ferris Nicolaisen
By the way, compare your git version:

➜  ~/projects/agnes/[(broke-the-build)|BISECTING]>git --version 
 tfnico@Thomas-Ferris-Nicolaisens-iMac 
[14:34:13]
git version 1.7.3.4

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/xX5Tr-YBKO0J.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread Thomas Ferris Nicolaisen
I still think git show will show the commit that breaks the build.

Here's the output of me running bisect on a toy project, the target commit 
is 74a227:


First, a oneline log of my recent commits:

c5f7e3a8a943b5a3d2a1b43981730405f9b9f9a0 A random commit message: flanky
c6a92b9c359f0ae4332d63d2b6786fc85ffdd67e A random commit message: 
anamnestically
426f9b4d84d683d6cfa841550c76e356b86c48f1 A random commit message: rikk
74a277ba449d800d1346151228aa2dd05f7783b1 Break the build
8aa8ead6437ccf72c02a89d74347101f23d82945 A random commit message: pose
f50f1932a87bef2fc3c4964bfce6cab865febf8d A random commit message: 
procatarxis
3049456ee0687dcba375cefe31e2bebbfa974dca A random commit message: 
hidropoiesis
d5c745d307d6770c34dfd995b4cf77c725c622b2 A random commit message: farmtown
d4cf807a21d2c9de45513ee81154040fedcb4597 A random commit message: inviolate

I start bisecting the range, just like above:

➜  ~/projects/agnes/[master]>git bisect start HEAD 
d4cf807a21d2c9de45513ee81154040fedcb4597 
 tfnico@Thomas-Ferris-Nicolaisens-iMac [14:31:41]
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[8aa8ead6437ccf72c02a89d74347101f23d82945] A random commit message: pose
➜  ~/projects/agnes/[(8aa8ead...)|BISECTING]>git bisect run mvn clean test

[ lots of output ...]


This is the final result at the end of the output:

74a277ba449d800d1346151228aa2dd05f7783b1 is the first bad commit
commit 74a277ba449d800d1346151228aa2dd05f7783b1
Author: Thomas Ferris Nicolaisen 
Date:   Thu Jan 5 12:47:45 2012 +0100

Break the build

:04 04 cfcbef1c6b45c4a93f2863be81a6ecbe780eeaab 
0c2c45d3e7369ba609508f807c2b1d849fb3cefc M src
bisect run success

Now, run git show:

➜  ~/projects/agnes/[(broke-the-build)|BISECTING]>git show 
  tfnico@Thomas-Ferris-Nicolaisens-iMac 
[14:32:35]
commit 74a277ba449d800d1346151228aa2dd05f7783b1
Author: Thomas Ferris Nicolaisen 
Date:   Thu Jan 5 12:47:45 2012 +0100

Break the build
[ diff ...]

As it stands, it works as described. Here's the bisect log for show:

➜  ~/projects/agnes/[(broke-the-build)|BISECTING]>git bisect log   
  tfnico@Thomas-Ferris-Nicolaisens-iMac 
[14:32:52]
# bad: [c5f7e3a8a943b5a3d2a1b43981730405f9b9f9a0] A random commit message: 
flanky
# good: [d4cf807a21d2c9de45513ee81154040fedcb4597] A random commit message: 
inviolate
git bisect start 'HEAD' 'd4cf807a21d2c9de45513ee81154040fedcb4597'
# good: [8aa8ead6437ccf72c02a89d74347101f23d82945] A random commit message: 
pose
git bisect good 8aa8ead6437ccf72c02a89d74347101f23d82945
# bad: [426f9b4d84d683d6cfa841550c76e356b86c48f1] A random commit message: 
rikk
git bisect bad 426f9b4d84d683d6cfa841550c76e356b86c48f1
# bad: [74a277ba449d800d1346151228aa2dd05f7783b1] Break the build
git bisect bad 74a277ba449d800d1346151228aa2dd05f7783b1

I still believe that there's something fishy going on in your test.. Care 
to share some concrete examples?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/lJA9km9kXqMJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread petter
On 5 Jan, 13:03, Thomas Ferris Nicolaisen  wrote:
> Can you double check that the commit before is not failing as well, or
> maybe there are some other variables outside the test that are causing it
> to fail?

No the commit before is good. Even doing a "git bisect log" will list
it as good.

I'll just ended up parsing the output. Actually, the problem is not
the parsing, but keeping the output of the git bisect command since it
can potentially be very large. The parsing part can be quite simple:

sed -n s'/\([0-9a-f]\{40\}\) is the first bad commit/\1/p' $out

Alternatively I can do it manually, but git bisect run was so
simple

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Getting the bad commit from git bisect run?

2012-01-05 Thread Thomas Ferris Nicolaisen
After running git bisect run, (I just actually tried bisecting for the 
first time, after two years of gitting :)), I ended up with HEAD pointing 
at the actual commit that broke the build. 

Can you double check that the commit before is not failing as well, or 
maybe there are some other variables outside the test that are causing it 
to fail? 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/WIVWK6NZmL4J.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.