{"thread":{"id":"16368","subject":"git-bisect not working correctly in the kvm.git repository?","startedAt":"2008-11-17T17:27:15Z","lastAt":"2008-11-18T20:38:04Z","messageCount":9,"participants":["walt","Linus Torvalds","Christian Couder","Johannes Sixt","Avi Kivity"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96048","messageId":"gfs9hn$hq9$1@ger.gmane.org","threadId":"16368","inReplyTo":null,"subject":"git-bisect not working correctly in the kvm.git repository?","fromName":"walt","fromEmail":"w41ter@gmail.com","sentAt":"2008-11-17T17:27:15Z","receivedAt":"2008-11-17T17:27:15Z","isPatch":false,"sender":{"key":"w41ter@gmail.com","avatar":null},"body":"I'm trying to find a bug introduced somewhere between kvm-69\nand kvm-70, so of course I want to git-bisect down to it.\n\nThe weirdness is that when I give git-bisect the good and\nbad tags, almost everything in my working directory just\ndisappears, leaving only the qemu subdirectory behind.\n\nCan anyone else reproduce this with the kvm.git repo?\n(I don't see this problem with the linux.git repo or the\ngit.git repo, so it seems to be something with the kvm.git\nrepo itself.)\n\nThanks!\n"},{"id":"96049","messageId":"alpine.LFD.2.00.0811171131330.18283@nehalem.linux-foundation.org","threadId":"16368","inReplyTo":"gfs9hn$hq9$1@ger.gmane.org","subject":"Re: git-bisect not working correctly in the kvm.git repository?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-11-17T19:34:11Z","receivedAt":"2008-11-17T19:34:11Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 17 Nov 2008, walt wrote:\n>\n> I'm trying to find a bug introduced somewhere between kvm-69\n> and kvm-70, so of course I want to git-bisect down to it.\n> \n> The weirdness is that when I give git-bisect the good and\n> bad tags, almost everything in my working directory just\n> disappears, leaving only the qemu subdirectory behind.\n\nHave you done subdirectory merges or other odd merges?\n\nIf you merge stuff from another project that isn't a full repository, then \nyou are merging commits that simply don't _have_ the full tree of your \nrepo. If you then bisect into those commits, the checkout will then (of \ncourse) end up having only the files that are in that partial tree.\n\nThis will happen in the git repository too, if \"git bisect\" ends up \njumping into one of the commits that were done in the 'gitk' repository. \n\nFor an example of this, do something like\n\n\tgit clean -dqfx\n\tgit checkout -b oddbranch eb33a67f218b612f6fb1456e19b40a1f97ff02c0\n\nin the git repository, and see all files disappear, and gitk is no longer \nin the 'gitk-git' subdirectory, but got moved to the top level.\n\nBecause in the history that is that commit, that is literally how things \nwere. The data from that commit just got merged into a subdirectory of its \nown, and together with all the rest of git, by using a subtree merge.\n\n\t\t\tLinus\n"},{"id":"96050","messageId":"200811172047.03669.chriscool@tuxfamily.org","threadId":"16368","inReplyTo":"gfs9hn$hq9$1@ger.gmane.org","subject":"Re: git-bisect not working correctly in the kvm.git repository?","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-11-17T19:47:02Z","receivedAt":"2008-11-17T19:47:02Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le lundi 17 novembre 2008, walt a écrit :\n> I'm trying to find a bug introduced somewhere between kvm-69\n> and kvm-70, so of course I want to git-bisect down to it.\n>\n> The weirdness is that when I give git-bisect the good and\n> bad tags, almost everything in my working directory just\n> disappears, leaving only the qemu subdirectory behind.\n>\n> Can anyone else reproduce this with the kvm.git repo?\n> (I don't see this problem with the linux.git repo or the\n> git.git repo, so it seems to be something with the kvm.git\n> repo itself.)\n\nI cannot reproduce this:\n\n$ git bisect start kvm-70 kvm-69\nBisecting: 846 revisions left to test after this\n[80bfc25f42db6d4715c7688ae2352c5a8038fe7e] ntfs: le*_add_cpu conversion\n$ find . -type f |wc -l\n24286\n$ git bisect reset\nPrevious HEAD position was 80bfc25... ntfs: le*_add_cpu conversion\nSwitched to branch \"master\"\n$ find . -type f |wc -l\n24384\n\nCould you give more information, like your git version and the result of the \nabove commands?\n\nThanks,\nChristian.\n"},{"id":"96051","messageId":"gfsjjp$o42$1@ger.gmane.org","threadId":"16368","inReplyTo":"alpine.LFD.2.00.0811171131330.18283@nehalem.linux-foundation.org","subject":"Re: git-bisect not working correctly in the kvm.git repository?","fromName":"walt","fromEmail":"w41ter@gmail.com","sentAt":"2008-11-17T20:19:03Z","receivedAt":"2008-11-17T20:19:03Z","isPatch":false,"sender":{"key":"w41ter@gmail.com","avatar":null},"body":"Linus Torvalds wrote:\n>\n> On Mon, 17 Nov 2008, walt wrote:\n>> I'm trying to find a bug introduced somewhere between kvm-69\n>> and kvm-70, so of course I want to git-bisect down to it.\n>>\n>> The weirdness is that when I give git-bisect the good and\n>> bad tags, almost everything in my working directory just\n>> disappears, leaving only the qemu subdirectory behind.\n\n> ...\n> If you merge stuff from another project that isn't a full repository, then\n> you are merging commits that simply don't _have_ the full tree of your\n> repo...\n\nOkay, that's clearly what's happening to me.  The kvm.git repo\ncontains hundred of commits just like that.  How would you deal\nwith the same situation?  Is git-bisect skip the easiest way?\n"},{"id":"96052","messageId":"alpine.LFD.2.00.0811171230500.18283@nehalem.linux-foundation.org","threadId":"16368","inReplyTo":"gfsjjp$o42$1@ger.gmane.org","subject":"Re: git-bisect not working correctly in the kvm.git repository?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-11-17T20:34:44Z","receivedAt":"2008-11-17T20:34:44Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 17 Nov 2008, walt wrote:\n> \n> Okay, that's clearly what's happening to me.  The kvm.git repo\n> contains hundred of commits just like that.  How would you deal\n> with the same situation?  Is git-bisect skip the easiest way?\n\nYeah. A much fancier alternative is to do a (temporary) branch that \nrewrites the history using the same sub-tree merge strategy, so that you \ncan actually build the whole thing in that branch. \n\nThis, btw, is why I asked Chris Mason to not do a subtree merge for the \nbtrfs code. I wrote him a helper script to do exactly that with a nice \nindex script for 'git filter-branch'. That way his whole tree is nicely \nbisectable when merged into the rest of the kernel.\n\nBut that's really a rather bigger thing to do, and I'd suggest that only \nif you really can't find things any other way.\n\n\t\tLinus\n"},{"id":"96064","messageId":"alpine.LNX.2.00.0811171350540.4238@x9.ybpnyarg","threadId":"16368","inReplyTo":"200811172047.03669.chriscool@tuxfamily.org","subject":"Re: git-bisect not working correctly in the kvm.git repository?","fromName":"walt","fromEmail":"w41ter@gmail.com","sentAt":"2008-11-17T22:11:53Z","receivedAt":"2008-11-17T22:11:53Z","isPatch":false,"sender":{"key":"w41ter@gmail.com","avatar":null},"body":"\n\nOn Mon, 17 Nov 2008, Christian Couder wrote:\n\n> Le lundi 17 novembre 2008, walt a écrit :\n> > I'm trying to find a bug introduced somewhere between kvm-69\n> > and kvm-70, so of course I want to git-bisect down to it.\n> >\n> > The weirdness is that when I give git-bisect the good and\n> > bad tags, almost everything in my working directory just\n> > disappears, leaving only the qemu subdirectory behind.\n> >\n> > Can anyone else reproduce this with the kvm.git repo?\n> > (I don't see this problem with the linux.git repo or the\n> > git.git repo, so it seems to be something with the kvm.git\n> > repo itself.)\n>\n> I cannot reproduce this:\n>\n> $ git bisect start kvm-70 kvm-69\n> Bisecting: 846 revisions left to test after this\n> [80bfc25f42db6d4715c7688ae2352c5a8038fe7e] ntfs: le*_add_cpu conversion\n> $ find . -type f |wc -l\n> 24286\n> $ git bisect reset\n> Previous HEAD position was 80bfc25... ntfs: le*_add_cpu conversion\n> Switched to branch \"master\"\n> $ find . -type f |wc -l\n> 24384\n\nYour numbers are so different from mine I'm wondering if we are using\ndifferent repositories.\n\n$~/src/kvm-userspace find . -type f | wc -l\n1715\n\n$~/src/kvm-userspace git bisect start kvm-70 kvm-69\nBisecting: 176 revisions left to test after this\n[06508be8108f785caead849a717c9e6d67da62d7] Un-break MIPS conditional moves, by\nRichard Sandiford.\nwa1ter@k9:~/src/kvm-userspace find . -type f | wc -l\n1413\n\n$~/src/kvm-userspace 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/virt/kvm/kvm-userspace.git\n        fetch = +refs/heads/*:refs/remotes/origin/*\n[branch \"master\"]\n        remote = origin\n        merge = refs/heads/master\n\nI track Junio's git.git and it's current as of this morning, but I\nalso tried git v1.5.0 (chosen at random) and got the same results.\nWhat repo are you using?\n\nThanks."},{"id":"96073","messageId":"200811180656.05324.chriscool@tuxfamily.org","threadId":"16368","inReplyTo":"alpine.LNX.2.00.0811171350540.4238@x9.ybpnyarg","subject":"Re: git-bisect not working correctly in the kvm.git repository?","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-11-18T05:56:05Z","receivedAt":"2008-11-18T05:56:05Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le lundi 17 novembre 2008, walt a écrit :\n> On Mon, 17 Nov 2008, Christian Couder wrote:\n> > Le lundi 17 novembre 2008, walt a écrit :\n> > > I'm trying to find a bug introduced somewhere between kvm-69\n> > > and kvm-70, so of course I want to git-bisect down to it.\n> > >\n> > > The weirdness is that when I give git-bisect the good and\n> > > bad tags, almost everything in my working directory just\n> > > disappears, leaving only the qemu subdirectory behind.\n> > >\n> > > Can anyone else reproduce this with the kvm.git repo?\n> > > (I don't see this problem with the linux.git repo or the\n> > > git.git repo, so it seems to be something with the kvm.git\n> > > repo itself.)\n> >\n> > I cannot reproduce this:\n> >\n> > $ git bisect start kvm-70 kvm-69\n> > Bisecting: 846 revisions left to test after this\n> > [80bfc25f42db6d4715c7688ae2352c5a8038fe7e] ntfs: le*_add_cpu conversion\n> > $ find . -type f |wc -l\n> > 24286\n> > $ git bisect reset\n> > Previous HEAD position was 80bfc25... ntfs: le*_add_cpu conversion\n> > Switched to branch \"master\"\n> > $ find . -type f |wc -l\n> > 24384\n>\n> Your numbers are so different from mine I'm wondering if we are using\n> different repositories.\n>\n> $~/src/kvm-userspace find . -type f | wc -l\n> 1715\n>\n> $~/src/kvm-userspace git bisect start kvm-70 kvm-69\n> Bisecting: 176 revisions left to test after this\n> [06508be8108f785caead849a717c9e6d67da62d7] Un-break MIPS conditional\n> moves, by Richard Sandiford.\n> wa1ter@k9:~/src/kvm-userspace find . -type f | wc -l\n> 1413\n>\n> $~/src/kvm-userspace 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/virt/kvm/kvm-userspace.git\n\nI cloned this one:\n\n[remote \"origin\"]\n        url = git://git.kernel.org/pub/scm/linux/kernel/git/amit/kvm.git\n\nSorry I didn't know which should be used, as I am not a kernel developer.\n\nRegards,\nChristian.\n\n>         fetch = +refs/heads/*:refs/remotes/origin/*\n> [branch \"master\"]\n>         remote = origin\n>         merge = refs/heads/master\n>\n> I track Junio's git.git and it's current as of this morning, but I\n> also tried git v1.5.0 (chosen at random) and got the same results.\n> What repo are you using?\n>\n> Thanks.\n"},{"id":"96074","messageId":"49226B26.4000807@viscovery.net","threadId":"16368","inReplyTo":"gfsjjp$o42$1@ger.gmane.org","subject":"Re: git-bisect not working correctly in the kvm.git repository?","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-11-18T07:13:42Z","receivedAt":"2008-11-18T07:13:42Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"walt schrieb:\n> Linus Torvalds wrote:\n>>\n>> On Mon, 17 Nov 2008, walt wrote:\n>>> I'm trying to find a bug introduced somewhere between kvm-69\n>>> and kvm-70, so of course I want to git-bisect down to it.\n>>>\n>>> The weirdness is that when I give git-bisect the good and\n>>> bad tags, almost everything in my working directory just\n>>> disappears, leaving only the qemu subdirectory behind.\n> \n>> ...\n>> If you merge stuff from another project that isn't a full repository,\n>> then\n>> you are merging commits that simply don't _have_ the full tree of your\n>> repo...\n> \n> Okay, that's clearly what's happening to me.  The kvm.git repo\n> contains hundred of commits just like that.  How would you deal\n> with the same situation?  Is git-bisect skip the easiest way?\n\nIf you are pretty sure that the bug you are looking for was *not*\nintroduced in the branch that was subtree-merged, you can mark it as\n\"good\" like so:\n\n  $ git bisect start kvm-69 kvm-70 $BRANCH\n\nwhere $BRANCH is the most recent commit on the subtree-merged branch.\nWatch out that you do *not* accidentally pick the *merge* commit that\nmerged the branch in, but the (second) parent[*], the one that was merged\nin.  Then your bisect sequence won't ever end up in that branch.\n\n[*] If you happen to have the branch lying around as a remote ref, you can\nuse that instead, even if it is ahead of what was merged in.\n\n-- Hannes\n"},{"id":"96097","messageId":"492327AC.9020007@redhat.com","threadId":"16368","inReplyTo":"49226B26.4000807@viscovery.net","subject":"Re: git-bisect not working correctly in the kvm.git repository?","fromName":"Avi Kivity","fromEmail":"avi@redhat.com","sentAt":"2008-11-18T20:38:04Z","receivedAt":"2008-11-18T20:38:04Z","isPatch":false,"sender":{"key":"avi@redhat.com","avatar":null},"body":"Johannes Sixt wrote:\n> If you are pretty sure that the bug you are looking for was *not*\n> introduced in the branch that was subtree-merged, you can mark it as\n> \"good\" like so:\n>\n>   $ git bisect start kvm-69 kvm-70 $BRANCH\n>\n> where $BRANCH is the most recent commit on the subtree-merged branch.\n> Watch out that you do *not* accidentally pick the *merge* commit that\n> merged the branch in, but the (second) parent[*], the one that was merged\n> in.  Then your bisect sequence won't ever end up in that branch.\n>   \n\nUnfortunately, it is fairly likely that the bug was indeed introduced by \nthe merge, since most of the commits in that repository come via that merge.\n\nIt is possible that the bug exists in that branch (which you need to \nbuild as pure qemu, not kvm), but again, it is more likely that the bug \nis an interaction between a qemu feature introduced during the merge, \nand the existing kvm glue code.\n\nOne way around this is to redo the merge from the point git bisect \nsuggests, but that is difficult, time consuming, and error prone.  It \nalso needs a lot of familiarity with the code.\n\nFortunately, long term the problem is going away with qemu upstream \ngaining kvm support.\n\n-- \nI have a truly marvellous patch that fixes the bug which this\nsignature is too narrow to contain.\n"}]}