{"thread":{"id":"49945","subject":"[BUG REPORT] Git does not correctly replay bisect log","startedAt":"2018-12-04T09:52:18Z","lastAt":"2018-12-06T23:02:23Z","messageCount":10,"participants":["Lukáš Krejčí","Christian Couder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"364543","messageId":"CA+YJQx72dMybGWyzNMUcNcVZnpDTHoaONcC-AQdqt=C_8aEdXg@mail.gmail.com","threadId":"49945","inReplyTo":null,"subject":"[BUG REPORT] Git does not correctly replay bisect log","fromName":"Lukáš Krejčí","fromEmail":"lskrejci@gmail.com","sentAt":"2018-12-04T09:51:39Z","receivedAt":"2018-12-04T09:52:18Z","isPatch":false,"sender":{"key":"lskrejci@gmail.com","avatar":null},"body":"Executing git bisect replay reaches a different commit than\nthe one that is obtained by running the commands from the bisect log manually.\n\nDistribution: Arch Linux\ngit: 2.19.2-1\nperl: 5.28.1-1\npcre2: 10.32-1\nexpat: 2.2.6-1\nperl-error: 0.17027-1\ngrep: 3.1-2\nbash: 4.4.023-1\n\nno system /etc/gitconfig is present\ntried with no ~/.gitconfig\n\n$ cat .git/config\n[core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = false\n        logallrefupdates = true\n[remote \"origin\"]\n        url = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n        fetch = +refs/heads/*:refs/remotes/origin/*\n[branch \"master\"]\n        remote = origin\n        merge = refs/heads/master\n\n$ git fsck\nChecking object directories: 100% (256/256), done.\nwarning in tag 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 26791a8bcf0e6d33f43aef7682bdb555236d56de:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 9e734775f7c22d2f89943ad6c745571f1930105f:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 0397236d43e48e821cce5bbe6a80a1a56bb7cc3a:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag ebb5573ea8beaf000d4833735f3e53acb9af844c:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 06f6d9e2f140466eeb41e494e14167f90210f89d:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 701d7ecec3e0c6b4ab9bb824fd2b34be4da63b7e:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 733ad933f62e82ebc92fed988c7f0795e64dea62:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag c521cb0f10ef2bf28a18e1cc8adf378ccbbe5a19:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag a339981ec18d304f9efeb9ccf01b1f04302edf32:\nmissingTaggerEntry: invalid format - expected 'tagger' line\nChecking objects: 100% (6428247/6428247), done.\nChecking connectivity: 6369862, done.\n\n$ cat /var/tmp/git-bisect.log\ngit bisect start\n# bad: [5b394b2ddf0347bef56e50c69a58773c94343ff3] Linux 4.19-rc1\ngit bisect bad 5b394b2ddf0347bef56e50c69a58773c94343ff3\n# good: [94710cac0ef4ee177a63b5227664b38c95bbf703] Linux 4.18\ngit bisect good 94710cac0ef4ee177a63b5227664b38c95bbf703\n# bad: [54dbe75bbf1e189982516de179147208e90b5e45] Merge tag\n'drm-next-2018-08-15' of git://anongit.freedesktop.org/drm/drm\ngit bisect bad 54dbe75bbf1e189982516de179147208e90b5e45\n# bad: [0a957467c5fd46142bc9c52758ffc552d4c5e2f7] x86: i8259: Add\nmissing include file\ngit bisect bad 0a957467c5fd46142bc9c52758ffc552d4c5e2f7\n# good: [958f338e96f874a0d29442396d6adf9c1e17aa2d] Merge branch\n'l1tf-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip\ngit bisect good 958f338e96f874a0d29442396d6adf9c1e17aa2d\n# bad: [2c20443ec221dcb76484b30933593e8ecd836bbd] Merge tag\n'acpi-4.19-rc1' of\ngit://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm\ngit bisect bad 2c20443ec221dcb76484b30933593e8ecd836bbd\n# bad: [c2fc71c9b74c1e87336a27dba1a5edc69d2690f1] Merge tag\n'mtd/for-4.19' of git://git.infradead.org/linux-mtd\ngit bisect bad c2fc71c9b74c1e87336a27dba1a5edc69d2690f1\n# bad: [b86d865cb1cae1e61527ea0b8977078bbf694328] blkcg: Make\nblkg_root_lookup() work for queues in bypass mode\ngit bisect bad b86d865cb1cae1e61527ea0b8977078bbf694328\n# bad: [1b0d274523df5ef1caedc834da055ff721e4d4f0] nvmet: don't use uuid_le type\ngit bisect bad 1b0d274523df5ef1caedc834da055ff721e4d4f0\n\n$ git status\nOn branch master\nYour branch is up to date with 'origin/master'.\n\nnothing to commit, working tree clean\n\n$ git log -1 --format=oneline\n2595646791c319cadfdbf271563aac97d0843dc7 (HEAD -> master, tag:\nv4.20-rc5, origin/master, origin/HEAD) Linux 4.20-rc5\n\n$ git bisect replay /var/tmp/git-bisect.log\nWe are not bisecting.\nBisecting: a merge base must be tested\n[d72e90f33aa4709ebecc5005562f52335e106a60] Linux 4.18-rc6\n\n$ git log -1 --format=oneline\nd72e90f33aa4709ebecc5005562f52335e106a60 (HEAD, tag: v4.18-rc6) Linux 4.18-rc6\n\n\n\n\n\nRunning the commands from the bisect log manually, however:\n\n$ git bisect reset\nChecking out files: 100% (18326/18326), done.\nPrevious HEAD position was d72e90f33aa4 Linux 4.18-rc6\nSwitched to branch 'master'\nYour branch is up to date with 'origin/master'.\n\n$ . /var/tmp/git-bisect.log\nBisecting: 6112 revisions left to test after this (roughly 13 steps)\n[54dbe75bbf1e189982516de179147208e90b5e45] Merge tag\n'drm-next-2018-08-15' of git://anongit.freedesktop.org/drm/drm\nBisecting: 3881 revisions left to test after this (roughly 12 steps)\n[0a957467c5fd46142bc9c52758ffc552d4c5e2f7] x86: i8259: Add missing include file\nBisecting: 1595 revisions left to test after this (roughly 11 steps)\n[958f338e96f874a0d29442396d6adf9c1e17aa2d] Merge branch 'l1tf-final'\nof git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip\nBisecting: 854 revisions left to test after this (roughly 10 steps)\n[2c20443ec221dcb76484b30933593e8ecd836bbd] Merge tag 'acpi-4.19-rc1'\nof git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm\nBisecting: 352 revisions left to test after this (roughly 9 steps)\n[c2fc71c9b74c1e87336a27dba1a5edc69d2690f1] Merge tag 'mtd/for-4.19' of\ngit://git.infradead.org/linux-mtd\nBisecting: 193 revisions left to test after this (roughly 8 steps)\n[b86d865cb1cae1e61527ea0b8977078bbf694328] blkcg: Make\nblkg_root_lookup() work for queues in bypass mode\nBisecting: 97 revisions left to test after this (roughly 7 steps)\n[1b0d274523df5ef1caedc834da055ff721e4d4f0] nvmet: don't use uuid_le type\nBisecting: 47 revisions left to test after this (roughly 6 steps)\n[6dad38d38f20c0c8a84b5ae4f23c62b2c8758ec5] null_blk: move shared\ndefinitions to header file\n\n$ git log -1 --format=oneline\n6dad38d38f20c0c8a84b5ae4f23c62b2c8758ec5 (HEAD) null_blk: move shared\ndefinitions to header file\n"},{"id":"364545","messageId":"CAP8UFD2xv6SK+qPXKr5hQ0ZctOR5K-BNg1wdBy5=fp2DVBZMHw@mail.gmail.com","threadId":"49945","inReplyTo":"CA+YJQx72dMybGWyzNMUcNcVZnpDTHoaONcC-AQdqt=C_8aEdXg@mail.gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2018-12-04T11:04:05Z","receivedAt":"2018-12-04T11:19:12Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Dec 4, 2018 at 10:53 AM Lukáš Krejčí <lskrejci@gmail.com> wrote:\n>\n> Executing git bisect replay reaches a different commit than\n> the one that is obtained by running the commands from the bisect log manually.\n\n\n> $ git bisect replay /var/tmp/git-bisect.log\n> We are not bisecting.\n> Bisecting: a merge base must be tested\n> [d72e90f33aa4709ebecc5005562f52335e106a60] Linux 4.18-rc6\n\nMerge bases are tested only when the good commit is not an ancestor of\nthe bad commit. If this didn't happen when the log was recorded, it\nshouldn't happen when it is replayed.\n\nHere it seems that this is happening at the beginning of the replay.\nPerhaps git bisect replay is taking into account the current\nbranch/commit though it shouldn't.\n\nI wonder if this would happen if the current branch/commit has the\ngood commit as an ancestor.\n\nCould you try to check that? And first could you give us the output of:\n\ngit merge-base 5b394b2ddf0347bef56e50c69a58773c94343ff3\n94710cac0ef4ee177a63b5227664b38c95bbf703\n"},{"id":"364546","messageId":"f9f644daa705c78ef348a4a808d88bc01e7bdbd4.camel@gmail.com","threadId":"49945","inReplyTo":"CAP8UFD2xv6SK+qPXKr5hQ0ZctOR5K-BNg1wdBy5=fp2DVBZMHw@mail.gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Lukáš Krejčí","fromEmail":"lskrejci@gmail.com","sentAt":"2018-12-04T11:20:18Z","receivedAt":"2018-12-04T11:20:23Z","isPatch":false,"sender":{"key":"lskrejci@gmail.com","avatar":null},"body":"On Tue, 2018-12-04 at 12:04 +0100, Christian Couder wrote:\n> \n> Could you try to check that? And first could you give us the output of:\n> \n> git merge-base 5b394b2ddf0347bef56e50c69a58773c94343ff3\n> 94710cac0ef4ee177a63b5227664b38c95bbf703\n\n$ git merge-base 5b394b2ddf0347bef56e50c69a58773c94343ff3 94710cac0ef4ee177a63b5227664b38c95bbf703\n94710cac0ef4ee177a63b5227664b38c95bbf703\n$ git log -1 --format=oneline 94710cac0ef4ee177a63b5227664b38c95bbf703\n94710cac0ef4ee177a63b5227664b38c95bbf703 (tag: v4.18) Linux 4.18\n\n"},{"id":"364547","messageId":"79d309e1312bbff8739c146d2348ea8788d6235d.camel@gmail.com","threadId":"49945","inReplyTo":"CA+YJQx72dMybGWyzNMUcNcVZnpDTHoaONcC-AQdqt=C_8aEdXg@mail.gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Lukáš Krejčí","fromEmail":"lskrejci@gmail.com","sentAt":"2018-12-04T10:57:32Z","receivedAt":"2018-12-04T11:30:01Z","isPatch":false,"sender":{"key":"lskrejci@gmail.com","avatar":null},"body":"(I'm sorry about the formatting, here's the message again.)\n\nExecuting git bisect replay reaches a different commit than\nthe one that is obtained by running the commands from the bisect log manually.\n\nDistribution: Arch Linux\ngit: 2.19.2-1\nperl: 5.28.1-1\npcre2: 10.32-1\nexpat: 2.2.6-1\nperl-error: 0.17027-1\ngrep: 3.1-2\nbash: 4.4.023-1\n\nno system /etc/gitconfig is present\ntried with no ~/.gitconfig\n\n$ cat .git/config \n[core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = false\n        logallrefupdates = true\n[remote \"origin\"]\n        url = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n        fetch = +refs/heads/*:refs/remotes/origin/*\n[branch \"master\"]\n        remote = origin\n        merge = refs/heads/master\n\n$ git fsck\nChecking object directories: 100% (256/256), done.\nwarning in tag 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 26791a8bcf0e6d33f43aef7682bdb555236d56de: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 9e734775f7c22d2f89943ad6c745571f1930105f: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 0397236d43e48e821cce5bbe6a80a1a56bb7cc3a: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag ebb5573ea8beaf000d4833735f3e53acb9af844c: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 06f6d9e2f140466eeb41e494e14167f90210f89d: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 701d7ecec3e0c6b4ab9bb824fd2b34be4da63b7e: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag 733ad933f62e82ebc92fed988c7f0795e64dea62: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag c521cb0f10ef2bf28a18e1cc8adf378ccbbe5a19: missingTaggerEntry: invalid format - expected 'tagger' line\nwarning in tag a339981ec18d304f9efeb9ccf01b1f04302edf32: missingTaggerEntry: invalid format - expected 'tagger' line\nChecking objects: 100% (6428247/6428247), done.\nChecking connectivity: 6369862, done.\n\n$ cat /var/tmp/git-bisect.log\ngit bisect start\n# bad: [5b394b2ddf0347bef56e50c69a58773c94343ff3] Linux 4.19-rc1\ngit bisect bad 5b394b2ddf0347bef56e50c69a58773c94343ff3\n# good: [94710cac0ef4ee177a63b5227664b38c95bbf703] Linux 4.18\ngit bisect good 94710cac0ef4ee177a63b5227664b38c95bbf703\n# bad: [54dbe75bbf1e189982516de179147208e90b5e45] Merge tag 'drm-next-2018-08-15' of git://anongit.freedesktop.org/drm/drm\ngit bisect bad 54dbe75bbf1e189982516de179147208e90b5e45\n# bad: [0a957467c5fd46142bc9c52758ffc552d4c5e2f7] x86: i8259: Add missing include file\ngit bisect bad 0a957467c5fd46142bc9c52758ffc552d4c5e2f7\n# good: [958f338e96f874a0d29442396d6adf9c1e17aa2d] Merge branch 'l1tf-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip\ngit bisect good 958f338e96f874a0d29442396d6adf9c1e17aa2d\n# bad: [2c20443ec221dcb76484b30933593e8ecd836bbd] Merge tag 'acpi-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm\ngit bisect bad 2c20443ec221dcb76484b30933593e8ecd836bbd\n# bad: [c2fc71c9b74c1e87336a27dba1a5edc69d2690f1] Merge tag 'mtd/for-4.19' of git://git.infradead.org/linux-mtd\ngit bisect bad c2fc71c9b74c1e87336a27dba1a5edc69d2690f1\n# bad: [b86d865cb1cae1e61527ea0b8977078bbf694328] blkcg: Make blkg_root_lookup() work for queues in bypass mode\ngit bisect bad b86d865cb1cae1e61527ea0b8977078bbf694328\n# bad: [1b0d274523df5ef1caedc834da055ff721e4d4f0] nvmet: don't use uuid_le type\ngit bisect bad 1b0d274523df5ef1caedc834da055ff721e4d4f0\n\n$ git status\nOn branch master\nYour branch is up to date with 'origin/master'.\n\nnothing to commit, working tree clean\n\n$ git log -1 --format=oneline\n2595646791c319cadfdbf271563aac97d0843dc7 (HEAD -> master, tag: v4.20-rc5, origin/master, origin/HEAD) Linux 4.20-rc5\n\n$ git bisect replay /var/tmp/git-bisect.log \nWe are not bisecting.\nBisecting: a merge base must be tested\n[d72e90f33aa4709ebecc5005562f52335e106a60] Linux 4.18-rc6\n\n$ git log -1 --format=oneline\nd72e90f33aa4709ebecc5005562f52335e106a60 (HEAD, tag: v4.18-rc6) Linux 4.18-rc6\n\n\n\n\n\n# Running the commands from the bisect log manually, however:\n\n$ git bisect reset\nChecking out files: 100% (18326/18326), done.\nPrevious HEAD position was d72e90f33aa4 Linux 4.18-rc6\nSwitched to branch 'master'\nYour branch is up to date with 'origin/master'.\n\n$ . /var/tmp/git-bisect.log \nBisecting: 6112 revisions left to test after this (roughly 13 steps)\n[54dbe75bbf1e189982516de179147208e90b5e45] Merge tag 'drm-next-2018-08-15' of git://anongit.freedesktop.org/drm/drm\nBisecting: 3881 revisions left to test after this (roughly 12 steps)\n[0a957467c5fd46142bc9c52758ffc552d4c5e2f7] x86: i8259: Add missing include file\nBisecting: 1595 revisions left to test after this (roughly 11 steps)\n[958f338e96f874a0d29442396d6adf9c1e17aa2d] Merge branch 'l1tf-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip\nBisecting: 854 revisions left to test after this (roughly 10 steps)\n[2c20443ec221dcb76484b30933593e8ecd836bbd] Merge tag 'acpi-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm\nBisecting: 352 revisions left to test after this (roughly 9 steps)\n[c2fc71c9b74c1e87336a27dba1a5edc69d2690f1] Merge tag 'mtd/for-4.19' of git://git.infradead.org/linux-mtd\nBisecting: 193 revisions left to test after this (roughly 8 steps)\n[b86d865cb1cae1e61527ea0b8977078bbf694328] blkcg: Make blkg_root_lookup() work for queues in bypass mode\nBisecting: 97 revisions left to test after this (roughly 7 steps)\n[1b0d274523df5ef1caedc834da055ff721e4d4f0] nvmet: don't use uuid_le type\nBisecting: 47 revisions left to test after this (roughly 6 steps)\n[6dad38d38f20c0c8a84b5ae4f23c62b2c8758ec5] null_blk: move shared definitions to header file\n\n$ git log -1 --format=oneline\n6dad38d38f20c0c8a84b5ae4f23c62b2c8758ec5 (HEAD) null_blk: move shared definitions to header file\n\n"},{"id":"364548","messageId":"CAP8UFD3cD5KtvPJK5WkWGVUT6grbL=xL2MV1YWNJGpOjD3uRiQ@mail.gmail.com","threadId":"49945","inReplyTo":"f9f644daa705c78ef348a4a808d88bc01e7bdbd4.camel@gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2018-12-04T12:01:32Z","receivedAt":"2018-12-04T12:01:46Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Dec 4, 2018 at 12:20 PM Lukáš Krejčí <lskrejci@gmail.com> wrote:\n>\n> On Tue, 2018-12-04 at 12:04 +0100, Christian Couder wrote:\n> >\n> > Could you try to check that? And first could you give us the output of:\n> >\n> > git merge-base 5b394b2ddf0347bef56e50c69a58773c94343ff3\n> > 94710cac0ef4ee177a63b5227664b38c95bbf703\n>\n> $ git merge-base 5b394b2ddf0347bef56e50c69a58773c94343ff3 94710cac0ef4ee177a63b5227664b38c95bbf703\n> 94710cac0ef4ee177a63b5227664b38c95bbf703\n> $ git log -1 --format=oneline 94710cac0ef4ee177a63b5227664b38c95bbf703\n> 94710cac0ef4ee177a63b5227664b38c95bbf703 (tag: v4.18) Linux 4.18\n\n94710cac0ef4ee177a63b5227664b38c95bbf703 is the good commit that was\ninitially given. This means that the good commit\n94710cac0ef4ee177a63b5227664b38c95bbf703 is an ancestor of the bad\ncommit 5b394b2ddf0347bef56e50c69a58773c94343ff3 i and there should be\nno reason to test a merge base when replaying.\n\nAfter testing on my machine, it seems that the problem is not\nhappening at the beginning of the replay.\n\nTo debug I think it would be interesting to see the output of the\nfollowing commands just before we get different results:\n\ngit for-each-ref 'refs/bisect/*'\n\nand\n\ngit log -1 --format=oneline\n\nin the case we are using `git bisect replay` and in the case we are\nrunning the commands from the bisect log manually.\n\n(You might need to temporarily remove the last command from the bisect\nlog to do that.)\n"},{"id":"364555","messageId":"f79b421a8033d69f88547028629719ca2ba93615.camel@gmail.com","threadId":"49945","inReplyTo":"CAP8UFD3cD5KtvPJK5WkWGVUT6grbL=xL2MV1YWNJGpOjD3uRiQ@mail.gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Lukáš Krejčí","fromEmail":"lskrejci@gmail.com","sentAt":"2018-12-04T13:36:52Z","receivedAt":"2018-12-04T13:36:58Z","isPatch":false,"sender":{"key":"lskrejci@gmail.com","avatar":null},"body":"On Tue, 2018-12-04 at 13:01 +0100, Christian Couder wrote:\n> To debug I think it would be interesting to see the output of the\n> following commands just before we get different results:\n> \n> git for-each-ref 'refs/bisect/*'\n> \n> and\n> \n> git log -1 --format=oneline\n> \n\nI placed the following snippet at the end of the loop in bisect_replay():\necho \"COMMAND: '$git' '$bisect' '$command' '$rev'\"\t\t\ngit for-each-ref 'refs/bisect/*'\necho \"current HEAD: $(git log -1 --format=oneline)\"\necho \"---\"\n\n$ env GIT_TRACE=0 git bisect replay /var/tmp/git-bisect.log \n\nWe are not bisecting.\nCOMMAND: 'git' 'bisect' 'start' ''\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'bad' '5b394b2ddf0347bef56e50c69a58773c94343ff3'\n5b394b2ddf0347bef56e50c69a58773c94343ff3 commit refs/bisect/bad\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'good' '94710cac0ef4ee177a63b5227664b38c95bbf703'\n5b394b2ddf0347bef56e50c69a58773c94343ff3 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'bad' '54dbe75bbf1e189982516de179147208e90b5e45'\n54dbe75bbf1e189982516de179147208e90b5e45 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'bad' '0a957467c5fd46142bc9c52758ffc552d4c5e2f7'\n0a957467c5fd46142bc9c52758ffc552d4c5e2f7 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'good' '958f338e96f874a0d29442396d6adf9c1e17aa2d'\n0a957467c5fd46142bc9c52758ffc552d4c5e2f7 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'bad' '2c20443ec221dcb76484b30933593e8ecd836bbd'\n2c20443ec221dcb76484b30933593e8ecd836bbd commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'bad' 'c2fc71c9b74c1e87336a27dba1a5edc69d2690f1'\nc2fc71c9b74c1e87336a27dba1a5edc69d2690f1 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'bad' 'b86d865cb1cae1e61527ea0b8977078bbf694328'\nb86d865cb1cae1e61527ea0b8977078bbf694328 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nCOMMAND: 'git' 'bisect' 'bad' '1b0d274523df5ef1caedc834da055ff721e4d4f0'\n1b0d274523df5ef1caedc834da055ff721e4d4f0 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\nBisecting: a merge base must be tested\n[1e4b044d22517cae7047c99038abb444423243ca] Linux 4.18-rc4\n\n\n\n\n\n\n\n# I placed git for-each-ref 'refs/bisect/*' after each command in the file:\n\n$ . /var/tmp/git-bisect.log \n5b394b2ddf0347bef56e50c69a58773c94343ff3 commit refs/bisect/bad\nBisecting: 6112 revisions left to test after this (roughly 13 steps)\n[54dbe75bbf1e189982516de179147208e90b5e45] Merge tag 'drm-next-2018-08-15' of git://anongit.freedesktop.org/drm/drm\n5b394b2ddf0347bef56e50c69a58773c94343ff3 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\nBisecting: 3881 revisions left to test after this (roughly 12 steps)\n[0a957467c5fd46142bc9c52758ffc552d4c5e2f7] x86: i8259: Add missing include file\n54dbe75bbf1e189982516de179147208e90b5e45 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\nBisecting: 1595 revisions left to test after this (roughly 11 steps)\n[958f338e96f874a0d29442396d6adf9c1e17aa2d] Merge branch 'l1tf-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip\n0a957467c5fd46142bc9c52758ffc552d4c5e2f7 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\nBisecting: 854 revisions left to test after this (roughly 10 steps)\n[2c20443ec221dcb76484b30933593e8ecd836bbd] Merge tag 'acpi-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm\n0a957467c5fd46142bc9c52758ffc552d4c5e2f7 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\nBisecting: 352 revisions left to test after this (roughly 9 steps)\n[c2fc71c9b74c1e87336a27dba1a5edc69d2690f1] Merge tag 'mtd/for-4.19' of git://git.infradead.org/linux-mtd\n2c20443ec221dcb76484b30933593e8ecd836bbd commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\nBisecting: 193 revisions left to test after this (roughly 8 steps)\n[b86d865cb1cae1e61527ea0b8977078bbf694328] blkcg: Make blkg_root_lookup() work for queues in bypass mode\nc2fc71c9b74c1e87336a27dba1a5edc69d2690f1 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\nBisecting: 97 revisions left to test after this (roughly 7 steps)\n[1b0d274523df5ef1caedc834da055ff721e4d4f0] nvmet: don't use uuid_le type\nb86d865cb1cae1e61527ea0b8977078bbf694328 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\nBisecting: 47 revisions left to test after this (roughly 6 steps)\n[6dad38d38f20c0c8a84b5ae4f23c62b2c8758ec5] null_blk: move shared definitions to header file\n1b0d274523df5ef1caedc834da055ff721e4d4f0 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\n\n\n\n\n\n\n\n\nHere is the output of the first command with GIT_TRACE on.\n\n$ env GIT_TRACE=1 git bisect replay /var/tmp/git-bisect.log \n14:30:26.859355 git.c:659               trace: exec: git-bisect replay /var/tmp/git-bisect.log\n14:30:26.859422 run-command.c:643       trace: run_command: git-bisect replay /var/tmp/git-bisect.log\n14:30:26.893410 git.c:415               trace: built-in: git rev-parse --git-dir\n14:30:26.898676 git.c:415               trace: built-in: git rev-parse --show-cdup\n14:30:26.906487 git.c:415               trace: built-in: git rev-parse --git-path objects\nWe are not bisecting.\n14:30:26.928736 git.c:415               trace: built-in: git rev-parse --sq-quote\n14:30:26.935080 git.c:415               trace: built-in: git rev-parse --is-bare-repository\n14:30:26.941601 git.c:415               trace: built-in: git symbolic-ref -q HEAD\n14:30:26.949947 git.c:415               trace: built-in: git bisect--helper --bisect-clean-state\n14:30:26.961001 git.c:415               trace: built-in: git rev-parse --sq-quote\n14:30:26.970945 git.c:415               trace: built-in: git show-ref -q --verify refs/bisect/bad\n14:30:26.979838 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/good-*'\nCOMMAND: 'git' 'bisect' 'start' ''\n14:30:26.989878 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\n14:30:26.997573 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.012658 git.c:415               trace: built-in: git bisect--helper --write-terms bad good\n14:30:27.021663 git.c:415               trace: built-in: git update-ref refs/bisect/bad 5b394b2ddf0347bef56e50c69a58773c94343ff3\n14:30:27.032023 git.c:415               trace: built-in: git show-branch 5b394b2ddf0347bef56e50c69a58773c94343ff3\nCOMMAND: 'git' 'bisect' 'bad' '5b394b2ddf0347bef56e50c69a58773c94343ff3'\n14:30:27.045300 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\n5b394b2ddf0347bef56e50c69a58773c94343ff3 commit refs/bisect/bad\n14:30:27.055905 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.069302 git.c:415               trace: built-in: git update-ref refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703 94710cac0ef4ee177a63b5227664b38c95bbf703\n14:30:27.080205 git.c:415               trace: built-in: git show-branch 94710cac0ef4ee177a63b5227664b38c95bbf703\nCOMMAND: 'git' 'bisect' 'good' '94710cac0ef4ee177a63b5227664b38c95bbf703'\n14:30:27.091229 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\n5b394b2ddf0347bef56e50c69a58773c94343ff3 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n14:30:27.101268 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.108474 git.c:415               trace: built-in: git update-ref refs/bisect/bad 54dbe75bbf1e189982516de179147208e90b5e45\n14:30:27.117641 git.c:415               trace: built-in: git show-branch 54dbe75bbf1e189982516de179147208e90b5e45\nCOMMAND: 'git' 'bisect' 'bad' '54dbe75bbf1e189982516de179147208e90b5e45'\n14:30:27.126344 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\n54dbe75bbf1e189982516de179147208e90b5e45 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n14:30:27.135195 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.143550 git.c:415               trace: built-in: git update-ref refs/bisect/bad 0a957467c5fd46142bc9c52758ffc552d4c5e2f7\n14:30:27.151005 git.c:415               trace: built-in: git show-branch 0a957467c5fd46142bc9c52758ffc552d4c5e2f7\nCOMMAND: 'git' 'bisect' 'bad' '0a957467c5fd46142bc9c52758ffc552d4c5e2f7'\n14:30:27.157688 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\n0a957467c5fd46142bc9c52758ffc552d4c5e2f7 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n14:30:27.163749 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.171138 git.c:415               trace: built-in: git update-ref refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d 958f338e96f874a0d29442396d6adf9c1e17aa2d\n14:30:27.177118 git.c:415               trace: built-in: git show-branch 958f338e96f874a0d29442396d6adf9c1e17aa2d\nCOMMAND: 'git' 'bisect' 'good' '958f338e96f874a0d29442396d6adf9c1e17aa2d'\n14:30:27.186531 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\n0a957467c5fd46142bc9c52758ffc552d4c5e2f7 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\n14:30:27.199439 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.210832 git.c:415               trace: built-in: git update-ref refs/bisect/bad 2c20443ec221dcb76484b30933593e8ecd836bbd\n14:30:27.219812 git.c:415               trace: built-in: git show-branch 2c20443ec221dcb76484b30933593e8ecd836bbd\nCOMMAND: 'git' 'bisect' 'bad' '2c20443ec221dcb76484b30933593e8ecd836bbd'\n14:30:27.228918 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\n2c20443ec221dcb76484b30933593e8ecd836bbd commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\n14:30:27.237583 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.246265 git.c:415               trace: built-in: git update-ref refs/bisect/bad c2fc71c9b74c1e87336a27dba1a5edc69d2690f1\n14:30:27.257213 git.c:415               trace: built-in: git show-branch c2fc71c9b74c1e87336a27dba1a5edc69d2690f1\nCOMMAND: 'git' 'bisect' 'bad' 'c2fc71c9b74c1e87336a27dba1a5edc69d2690f1'\n14:30:27.268181 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\nc2fc71c9b74c1e87336a27dba1a5edc69d2690f1 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\n14:30:27.279037 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.287349 git.c:415               trace: built-in: git update-ref refs/bisect/bad b86d865cb1cae1e61527ea0b8977078bbf694328\n14:30:27.293680 git.c:415               trace: built-in: git show-branch b86d865cb1cae1e61527ea0b8977078bbf694328\nCOMMAND: 'git' 'bisect' 'bad' 'b86d865cb1cae1e61527ea0b8977078bbf694328'\n14:30:27.301385 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\nb86d865cb1cae1e61527ea0b8977078bbf694328 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\n14:30:27.307179 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.312767 git.c:415               trace: built-in: git update-ref refs/bisect/bad 1b0d274523df5ef1caedc834da055ff721e4d4f0\n14:30:27.318559 git.c:415               trace: built-in: git show-branch 1b0d274523df5ef1caedc834da055ff721e4d4f0\nCOMMAND: 'git' 'bisect' 'bad' '1b0d274523df5ef1caedc834da055ff721e4d4f0'\n14:30:27.323911 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/*'\n1b0d274523df5ef1caedc834da055ff721e4d4f0 commit refs/bisect/bad\n94710cac0ef4ee177a63b5227664b38c95bbf703 commit refs/bisect/good-94710cac0ef4ee177a63b5227664b38c95bbf703\n958f338e96f874a0d29442396d6adf9c1e17aa2d commit refs/bisect/good-958f338e96f874a0d29442396d6adf9c1e17aa2d\n14:30:27.329725 git.c:415               trace: built-in: git log -1 --format=oneline\ncurrent HEAD: 2595646791c319cadfdbf271563aac97d0843dc7 Linux 4.20-rc5\n---\n14:30:27.332326 git.c:415               trace: built-in: git show-ref -q --verify refs/bisect/bad\n14:30:27.342139 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/good-*'\n14:30:27.348466 git.c:415               trace: built-in: git show-ref -q --verify refs/bisect/bad\n14:30:27.355160 git.c:415               trace: built-in: git for-each-ref 'refs/bisect/good-*'\n14:30:27.364281 git.c:415               trace: built-in: git bisect--helper --next-all\nBisecting: a merge base must be tested\n14:30:27.491498 run-command.c:643       trace: run_command: git checkout -q 1e4b044d22517cae7047c99038abb444423243ca --\n14:30:27.497822 git.c:415               trace: built-in: git checkout -q 1e4b044d22517cae7047c99038abb444423243ca --\n14:30:55.290141 run-command.c:643       trace: run_command: git show-branch 1e4b044d22517cae7047c99038abb444423243ca\n14:30:55.292168 git.c:415               trace: built-in: git show-branch 1e4b044d22517cae7047c99038abb444423243ca\n[1e4b044d22517cae7047c99038abb444423243ca] Linux 4.18-rc4\n\n"},{"id":"364688","messageId":"278123655fbdb565aed16bba804711774716c554.camel@gmail.com","threadId":"49945","inReplyTo":"CAP8UFD3cD5KtvPJK5WkWGVUT6grbL=xL2MV1YWNJGpOjD3uRiQ@mail.gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Lukáš Krejčí","fromEmail":"lskrejci@gmail.com","sentAt":"2018-12-06T14:43:32Z","receivedAt":"2018-12-06T14:56:26Z","isPatch":false,"sender":{"key":"lskrejci@gmail.com","avatar":null},"body":"Hello again,\n\nafter looking into this today, I'm not sure if this can be considered a\nbug - it's just that I expected Git to check out the exact commit to\ntest that was there before resetting the bisect. That made me uncertain\nwhether Git restored the correct state.\n\nWhen I looked at what Git actually does, it became clear that the\nbehavior is not incorrect but perhaps a bit surprising.\n\nWhen Git replays the bisect log, it only updates refs/bisect/bad,\nrefs/bisect/good-*, refs/bisect/skip-* and reconstructs the log in\n.git/BISECT_LOG. After that check_good_are_ancestors_of_bad() verifies\nthat all good commits are ancestors of the bad commit, and if not, the\nmessage \"Bisecting: a merge base must be tested\" is printed and the\nbranch is switched to the merge base of the bad and all the good\ncommits.\n\nBasically, some state is lost because Git \"forgot\" the first good\ncommit from the log already was an ancestor of the first bad one.\nIn other words, it's as if I just started the bisect with the following\ncommands and just pasted the whole bisect log to .git/BISECT_LOG:\n\n$ git bisect start\n$ git bisect good 94710cac0ef4ee177a63b5227664b38c95bbf703\n$ git bisect good 958f338e96f874a0d29442396d6adf9c1e17aa2d\n$ git bisect bad 1b0d274523df5ef1caedc834da055ff721e4d4f0\nBisecting: a merge base must be tested\n[1e4b044d22517cae7047c99038abb444423243ca] Linux 4.18-rc4\n\n(here's the full bisect log again for reference)\ngit bisect start\n# bad: [5b394b2ddf0347bef56e50c69a58773c94343ff3] Linux 4.19-rc1\ngit bisect bad 5b394b2ddf0347bef56e50c69a58773c94343ff3\n# good: [94710cac0ef4ee177a63b5227664b38c95bbf703] Linux 4.18\ngit bisect good 94710cac0ef4ee177a63b5227664b38c95bbf703\n# bad: [54dbe75bbf1e189982516de179147208e90b5e45] Merge tag 'drm-next-2018-08-15' of git://anongit.freedesktop.org/drm/drm\ngit bisect bad 54dbe75bbf1e189982516de179147208e90b5e45\n# bad: [0a957467c5fd46142bc9c52758ffc552d4c5e2f7] x86: i8259: Add missing include file\ngit bisect bad 0a957467c5fd46142bc9c52758ffc552d4c5e2f7\n# good: [958f338e96f874a0d29442396d6adf9c1e17aa2d] Merge branch 'l1tf-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip\ngit bisect good 958f338e96f874a0d29442396d6adf9c1e17aa2d\n# bad: [2c20443ec221dcb76484b30933593e8ecd836bbd] Merge tag 'acpi-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm\ngit bisect bad 2c20443ec221dcb76484b30933593e8ecd836bbd\n# bad: [c2fc71c9b74c1e87336a27dba1a5edc69d2690f1] Merge tag 'mtd/for-4.19' of git://git.infradead.org/linux-mtd\ngit bisect bad c2fc71c9b74c1e87336a27dba1a5edc69d2690f1\n# bad: [b86d865cb1cae1e61527ea0b8977078bbf694328] blkcg: Make blkg_root_lookup() work for queues in bypass mode\ngit bisect bad b86d865cb1cae1e61527ea0b8977078bbf694328\n# bad: [1b0d274523df5ef1caedc834da055ff721e4d4f0] nvmet: don't use uuid_le type\ngit bisect bad 1b0d274523df5ef1caedc834da055ff721e4d4f0\n\nAnd indeed, marking the merge base as good switches to the correct\ncommit after the bisect. Marking it as bad will fail, so at least you\ncan't make a mistake after replaying the bisect log:\n$ git bisect bad\nThe merge base 1e4b044d22517cae7047c99038abb444423243ca is bad.\nThis means the bug has been fixed between 1e4b044d22517cae7047c99038abb444423243ca and [94710cac0ef4ee177a63b5227664b38c95bbf703 958f338e96f874a0d29442396d6adf9c1e17aa2d].\n\nOnce again, I'm sorry for the noise. I guess it wasn't clear from the\nman page that something like this could happen and that made me think\nthat this was a bug.\n\n"},{"id":"364692","messageId":"CAP8UFD3VCzEdtfRqi_d2ibPtTN0uocGW+CshY_5m16TW1_YUdw@mail.gmail.com","threadId":"49945","inReplyTo":"278123655fbdb565aed16bba804711774716c554.camel@gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2018-12-06T16:31:57Z","receivedAt":"2018-12-06T16:32:12Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Thu, Dec 6, 2018 at 3:43 PM Lukáš Krejčí <lskrejci@gmail.com> wrote:\n>\n> Hello again,\n>\n> after looking into this today, I'm not sure if this can be considered a\n> bug - it's just that I expected Git to check out the exact commit to\n> test that was there before resetting the bisect. That made me uncertain\n> whether Git restored the correct state.\n>\n> When I looked at what Git actually does, it became clear that the\n> behavior is not incorrect but perhaps a bit surprising.\n\nYeah, I agree. I suspect, but I am not sure, that the difference of\nbehavior is because in one case we only check merge bases once at the\nbeginning (maybe because the BISECT_ANCESTORS_OK file always exists)\nwhile in the other case we check them more than once during the\nbisection. I haven't had time to look closely at this, but I would\nlike to.\n\n> When Git replays the bisect log, it only updates refs/bisect/bad,\n> refs/bisect/good-*, refs/bisect/skip-* and reconstructs the log in\n> .git/BISECT_LOG. After that check_good_are_ancestors_of_bad() verifies\n> that all good commits are ancestors of the bad commit, and if not, the\n> message \"Bisecting: a merge base must be tested\" is printed and the\n> branch is switched to the merge base of the bad and all the good\n> commits.\n\nI am not sure if you are talking about running `git bisect replay` or\nsourcing the log in the above.\n\n> Basically, some state is lost because Git \"forgot\" the first good\n> commit from the log already was an ancestor of the first bad one.\n\nThe BISECT_ANCESTORS_OK file should be there to avoid forgetting that\nwe already checked the merge bases.\n\n> In other words, it's as if I just started the bisect with the following\n> commands and just pasted the whole bisect log to .git/BISECT_LOG:\n>\n> $ git bisect start\n> $ git bisect good 94710cac0ef4ee177a63b5227664b38c95bbf703\n> $ git bisect good 958f338e96f874a0d29442396d6adf9c1e17aa2d\n> $ git bisect bad 1b0d274523df5ef1caedc834da055ff721e4d4f0\n> Bisecting: a merge base must be tested\n> [1e4b044d22517cae7047c99038abb444423243ca] Linux 4.18-rc4\n\nYeah, when we start a new bisection the BISECT_ANCESTORS_OK file\nshould be erased if it exists, while it shouldn't be erased when we\nare already in the middle of an existing bisection.\n\n[...]\n\n> And indeed, marking the merge base as good switches to the correct\n> commit after the bisect. Marking it as bad will fail, so at least you\n> can't make a mistake after replaying the bisect log:\n> $ git bisect bad\n> The merge base 1e4b044d22517cae7047c99038abb444423243ca is bad.\n> This means the bug has been fixed between 1e4b044d22517cae7047c99038abb444423243ca and [94710cac0ef4ee177a63b5227664b38c95bbf703 958f338e96f874a0d29442396d6adf9c1e17aa2d].\n\nYeah, I think this works as expected.\n\n> Once again, I'm sorry for the noise. I guess it wasn't clear from the\n> man page that something like this could happen and that made me think\n> that this was a bug.\n\nNo reason to be sorry, there might still be a bug related to the\nBISECT_ANCESTORS_OK file or something. I hope I can take a look at\nthis more closely soon.\n\nThanks for your report and your work on this,\nChristian.\n"},{"id":"364693","messageId":"5ab4e3fb2e22097753bde7702e67d6ce924283a2.camel@gmail.com","threadId":"49945","inReplyTo":"CAP8UFD3VCzEdtfRqi_d2ibPtTN0uocGW+CshY_5m16TW1_YUdw@mail.gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Lukáš Krejčí","fromEmail":"lskrejci@gmail.com","sentAt":"2018-12-06T17:30:35Z","receivedAt":"2018-12-06T17:30:42Z","isPatch":false,"sender":{"key":"lskrejci@gmail.com","avatar":null},"body":"On Thu, 2018-12-06 at 17:31 +0100, Christian Couder wrote:\n> > When Git replays the bisect log, it only updates refs/bisect/bad,\n> > refs/bisect/good-*, refs/bisect/skip-* and reconstructs the log in\n> > .git/BISECT_LOG. After that check_good_are_ancestors_of_bad() verifies\n> > that all good commits are ancestors of the bad commit, and if not, the\n> > message \"Bisecting: a merge base must be tested\" is printed and the\n> > branch is switched to the merge base of the bad and all the good\n> > commits.\n> \n> I am not sure if you are talking about running `git bisect replay` or\n> sourcing the log in the above.\n\nI am talking about `git bisect replay`. The shell script, as far as I\ncan see, only updates the references (ref/bisect/*) and never checks if\nthe revisions marked as 'good' are ancestors of the 'bad' one.\nTherefore, $GIT_DIR/BISECT_ANCESTORS_OK file is never created.\n\nThe first time the ancestors are checked is in the helper (`git-bisect-\n-help --next-all`) that has only limited information from refs/bisect*.\n\n"},{"id":"364720","messageId":"CAP8UFD2+Kk84J=xwGo2bRGUeOXaRCKbLhZSS769qvDMFN8Pg3g@mail.gmail.com","threadId":"49945","inReplyTo":"5ab4e3fb2e22097753bde7702e67d6ce924283a2.camel@gmail.com","subject":"Re: [BUG REPORT] Git does not correctly replay bisect log","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2018-12-06T23:02:08Z","receivedAt":"2018-12-06T23:02:23Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Dec 6, 2018 at 6:30 PM Lukáš Krejčí <lskrejci@gmail.com> wrote:\n>\n> I am talking about `git bisect replay`. The shell script, as far as I\n> can see, only updates the references (ref/bisect/*) and never checks if\n> the revisions marked as 'good' are ancestors of the 'bad' one.\n> Therefore, $GIT_DIR/BISECT_ANCESTORS_OK file is never created.\n\nIndeed `git bisect replay` first only updates the references\n(ref/bisect/*) according to all the \"git bisect {good,bad}\"\ninstructions it finds in the log it is passed. After doing that\nthough, before exiting, it calls `bisect_auto_next` which calls\n`bisect_next` which calls `git bisect--helper --next-all` which checks\nthe merge bases.\n\nI think it is a bug.\n\n`git bisect replay` is right to only update the references\n(ref/bisect/*) and not to compute and checkout the best commit to test\nat each step except at the end, but it should probably just create the\n$GIT_DIR/BISECT_ANCESTORS_OK file if more than one bisection step has\nbeen performed (because the merge bases are checked as part of the\nfirst bisection step only).\n\n> The first time the ancestors are checked is in the helper (`git-bisect-\n> -help --next-all`) that has only limited information from refs/bisect*.\n\n`git-bisect--helper --next-all` knows how to get refs/bisect*\ninformation, otherwise it couldn't decide which is the next best\ncommit to test.\n\nThanks for your help in debugging this,\nChristian.\n"}]}