Motivation
I was doing a bisection and considering saving its state, then maybe continue it later. It's not clear if git bisect log
can do exactly that.
Search before you post
man git bisect
says:
Bisect log and bisect replay
After having marked revisions as good or bad, issue the following command to show what has been done so far:
$ git bisect log
If you discover that you made a mistake in specifying the status of a revision, you can save the output of this command to a file, edit it to remove the incorrect entries, and then issue the following commands to return to a corrected state:
$ git bisect reset $ git bisect replay that-file
Compare with Fighting regressions with git bisect which seems more to suggest that the answer is yes.
Saving a log and replaying it
If you want to show other people your bisection process, you can get a log using for example:
$ git bisect log > bisect_log.txt
And it is possible to replay it using:
$ git bisect replay bisect_log.txt
Experiment
I just did an experiment to check this with git 1.9.0.
tar zcvf git.tgz .git
git bisect log >bisectlog
git reset --hard
git bisect replay bisectlog
We are not bisecting.
Bisecting: 2 revisions left to test after this (roughly 2 steps)
[somehash] Some commit log
tar zdf git.tgz
.git/BISECT_ANCESTORS_OK: Mod time differs
.git/BISECT_EXPECTED_REV: Mod time differs
.git/BISECT_LOG: Mod time differs
.git/BISECT_LOG: Size differs
.git/BISECT_NAMES: Mod time differs
.git/BISECT_START: Mod time differs
.git/HEAD: Mod time differs
.git/index: Mod time differs
.git/index: Contents differ
.git/logs/HEAD: Mod time differs
.git/logs/HEAD: Size differs
.git/ORIG_HEAD: Mod time differs
.git/ORIG_HEAD: Contents differ
.git/refs/bisect/bad: Mod time differs
.git/refs/bisect/good-0702dc7ec1d80d8ed38d7fe597dc0cce98ddccfc: Mod time differs
.git/refs/bisect/good-07357488ecac01085e6a5df1e4d44e00da4842e5: Mod time differs
.git/refs/bisect/good-5b753b5d63f16b60f5ccd6a954cf2f92e721af08: Mod time differs
.git/refs/bisect/good-5fac8a8900d5a27bbdf4bebd8b49cfef9757a4e3: Mod time differs
.git/refs/bisect/good-b2a73d5c02353589a81fb247255f78c41137299a: Mod time differs
.git/refs/bisect/good-f3f89511415bf386a6d4c815b92c9d3679a5e2eb: Mod time differs
git bisect log | diff - bisectlog
25a26
> # first bad commit: [someotherhash] Some other commit message
Conclusion
So, after replaying like this, git bisect log
lost one line.
I'd say git bisect log
contains most of the information, but not always all.
Note: the bisection used for this experiment implied several manual reset to other commits, which might explain something.
Has anyone asked oneself the same question?
Should one care about the missing line?