{"thread":{"id":"1627","subject":"\"git checkout\" says Entry blah would be overwritten by merge ...","startedAt":"2005-08-23T20:59:03Z","lastAt":"2005-08-23T20:59:03Z","messageCount":1,"participants":["tony.luck@intel.com"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7664","messageId":"200508232059.j7NKx3nM025339@agluck-lia64.sc.intel.com","threadId":"1627","inReplyTo":null,"subject":"\"git checkout\" says Entry blah would be overwritten by merge ...","fromName":"","fromEmail":"tony.luck@intel.com","sentAt":"2005-08-23T20:59:03Z","receivedAt":"2005-08-23T20:59:03Z","isPatch":false,"sender":{"key":"tony.luck@intel.com","avatar":"https://avatars.githubusercontent.com/u/5446021?v=4"},"body":"I'm a little closer to understanding how I got into the situation\nwhere I made that ugly commit last week that included 10 files that\nI didn't want, because I just had another failed merge (but this\ntime I know how to recover :).\n\nThe approximate sequence of events was:\n\nSGI told me one of the pending fixes in my test tree was causing\nan oops during boot on a whole class of machines.  They asked whether\nit could get into 2.6.13.  I agreed it was a good candidate, and ran\nmy script to pull it from its temporary branch (named prarit-bus-sysdata\nin this case) into my release branch.  The script is trivial after the\nargument sanity checks it just does:\n\n $ git checkout release && git resolve release prarit-bus-sysdata \"Pull prarit-bus-sysdata into release branch\"\n\nOnly one file was touched by this:\n  arch/ia64/sn/kernel/io_init.c\n\nI think that this would have gone through a non-trivial merge as this file\nhad subsequently been touched by another patch, but the merge did complete\nautomatically.\n\nNext I pushed the release branch up to kernel.org, asked Linus to pull.\n\nI then applied a totally independent patch to a new branch, pulled it\nto the test branch, and pushed to kernel.org ... net effect was that\nmy tree ended up in \"git checkout test\" state.\n\nLater I noticed that Linus had pulled from my tree (and from other\ntrees too), so I pulled his latest tree down from kernel.org using:\n\n  $ git checkout linus && git pull linus\n\nThen I tried to update my test branch with these changes using:\n\n  $ git checkout test && git resolve test linus \"Auto-update from upstream\"\n\nThis spat out these messages:\n\nfatal: Entry 'arch/ia64/sn/kernel/io_init.c' would be overwritten by merge. Cannot merge.\nTrying to merge 8065e2... into cde7fe...\nfatal: Entry 'arch/ia64/hp/sim/boot/boot_head.S' would be overwritten by merge. Cannot merge.\n\nThere is one obvious bug here: \"git checkout test\" failed with the first error (from\nits invocation of git-read-tree) ... but returned an exit status of 0, so my\nscript went ahead and tried to do the resolve, which the && should have\nprevented.\n\nThe less obvious (i.e. I have no clue what I did wrong) thing is why the\n\"git checkout\" had a problem with this file.  Yes, it had been touched\nearlier ... but in a way that should have left the index up to date. And\ntwo subsequent \"git checkout\" commands had switched first to the test\nbranch, and then to the linus branch without a complaint.\n\n-Tony\n"}]}