{"thread":{"id":"34316","subject":"[RFH] \"git reset --hard\" broken???","startedAt":"2013-07-01T21:28:52Z","lastAt":"2013-07-01T21:47:56Z","messageCount":2,"participants":["Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"222303","messageId":"7vli5qezqj.fsf@alter.siamese.dyndns.org","threadId":"34316","inReplyTo":null,"subject":"[RFH] \"git reset --hard\" broken???","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-01T21:28:52Z","receivedAt":"2013-07-01T21:28:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I have no time to dig this down, but I just noticed this by accident:\n\n\t$ make\n        $ cd t\n        $ sh ./t7011-skip-worktree-reading.sh -d\n        $ cd trash*.t7011*\n        $ git reset --hard HEAD\n        error: Entry '1' not uptodate. Cannot merge.\n\tfatal: Could not reset index file to revision 'HEAD'.\n\nwhich looks quite bogus.  \"reset --hard\" is meant to be the last\nresort \"no matter what, please match the working tree to the commit\"\nand should not ever error out with \"not uptodate Cannot merge\"\nmessage.\n\nInterestingly, you can do this to work it around, though:\n\n        $ cd t\n        $ sh ./t7011-skip-worktree-reading.sh -d\n        $ cd trash*.t7011*\n\t$ git reset\n        $ git reset --hard HEAD\n        HEAD is now at .... init\n"},{"id":"222304","messageId":"20130701214756.GA13962@sigill.intra.peff.net","threadId":"34316","inReplyTo":"7vli5qezqj.fsf@alter.siamese.dyndns.org","subject":"Re: [RFH] \"git reset --hard\" broken???","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-07-01T21:47:56Z","receivedAt":"2013-07-01T21:47:56Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jul 01, 2013 at 02:28:52PM -0700, Junio C Hamano wrote:\n\n> I have no time to dig this down, but I just noticed this by accident:\n> \n> \t$ make\n>         $ cd t\n>         $ sh ./t7011-skip-worktree-reading.sh -d\n>         $ cd trash*.t7011*\n>         $ git reset --hard HEAD\n>         error: Entry '1' not uptodate. Cannot merge.\n> \tfatal: Could not reset index file to revision 'HEAD'.\n> \n> which looks quite bogus.  \"reset --hard\" is meant to be the last\n> resort \"no matter what, please match the working tree to the commit\"\n> and should not ever error out with \"not uptodate Cannot merge\"\n> message.\n\nYeah, I would agree. I do not think this is a new breakage. It behaves\nthe same way all the way back to v1.7.0 (the first commit with t7011).\nTrying to go back further (by snapshotting the state of the trash\ndirectory and just running the reset on it) doesn't work, as older\nversions do not understand the skip-worktree bit.\n\nI'm not sure yet if it's just a problem with skip-worktree entries, or\nif you can trigger the problem another way, though.\n\n-Peff\n"}]}