{"thread":{"id":"37430","subject":"revert top most commit","startedAt":"2014-08-27T21:14:08Z","lastAt":"2014-08-28T20:27:06Z","messageCount":6,"participants":["Keller, Jacob E","David Turner","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"248446","messageId":"1409174048.2715.12.camel@jekeller-desk1.amr.corp.intel.com","threadId":"37430","inReplyTo":null,"subject":"revert top most commit","fromName":"Keller, Jacob E","fromEmail":"jacob.e.keller@intel.com","sentAt":"2014-08-27T21:14:08Z","receivedAt":"2014-08-27T21:14:08Z","isPatch":false,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"Hi,\n\nI am having trouble using revert. If I attempt to\n\n$ git revert <sha1id>\n\nwhere sha1id is the same as the HEAD commit, I instead get the output of\nwhat looks like git status.\n\nIs there anything specific about git revert that prevents it from\nreverting the most recent commit?\n\nThanks,\nJake\n"},{"id":"248454","messageId":"1409177738.15185.5.camel@leckie","threadId":"37430","inReplyTo":"1409174048.2715.12.camel@jekeller-desk1.amr.corp.intel.com","subject":"Re: revert top most commit","fromName":"David Turner","fromEmail":"dturner@twopensource.com","sentAt":"2014-08-27T22:15:38Z","receivedAt":"2014-08-27T22:15:38Z","isPatch":false,"sender":{"key":"novalis@novalis.org","avatar":"https://avatars.githubusercontent.com/u/77003?v=4"},"body":"On Wed, 2014-08-27 at 21:14 +0000, Keller, Jacob E wrote:\n> Hi,\n> \n> I am having trouble using revert. If I attempt to\n> \n> $ git revert <sha1id>\n> \n> where sha1id is the same as the HEAD commit, I instead get the output of\n> what looks like git status.\n> \n> Is there anything specific about git revert that prevents it from\n> reverting the most recent commit?\n\nWorks for me.  What version of git?  Is there a public repo that someone\ncould test this out on?\n"},{"id":"248457","messageId":"1409179401.2715.17.camel@jekeller-desk1.amr.corp.intel.com","threadId":"37430","inReplyTo":"1409177738.15185.5.camel@leckie","subject":"Re: revert top most commit","fromName":"Keller, Jacob E","fromEmail":"jacob.e.keller@intel.com","sentAt":"2014-08-27T22:43:21Z","receivedAt":"2014-08-27T22:43:21Z","isPatch":false,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, 2014-08-27 at 18:15 -0400, David Turner wrote:\n> On Wed, 2014-08-27 at 21:14 +0000, Keller, Jacob E wrote:\n> > Hi,\n> > \n> > I am having trouble using revert. If I attempt to\n> > \n> > $ git revert <sha1id>\n> > \n> > where sha1id is the same as the HEAD commit, I instead get the output of\n> > what looks like git status.\n> > \n> > Is there anything specific about git revert that prevents it from\n> > reverting the most recent commit?\n> \n> Works for me.  What version of git?  Is there a public repo that someone\n> could test this out on?\n> \n\nIt was version 1.9.3 and it's not a public repo.\n\nIt's actually not my repository, I was helping a co-worker, and thought\nI'd ask if anyone here knew if it was expected behavior or not.\n\nThanks,\nJake\n"},{"id":"248458","messageId":"20140828002243.GA20185@google.com","threadId":"37430","inReplyTo":"1409179401.2715.17.camel@jekeller-desk1.amr.corp.intel.com","subject":"Re: revert top most commit","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-08-28T00:22:43Z","receivedAt":"2014-08-28T00:22:43Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Keller, Jacob E wrote:\n>> On Wed, 2014-08-27 at 21:14 +0000, Keller, Jacob E wrote:\n\n>>> I am having trouble using revert. If I attempt to\n>>>\n>>> $ git revert <sha1id>\n>>>\n>>> where sha1id is the same as the HEAD commit, I instead get the output of\n>>> what looks like git status.\n[...]\n> It's actually not my repository, I was helping a co-worker, and thought\n> I'd ask if anyone here knew if it was expected behavior or not.\n\nMore details about the output would help --- otherwise people have to\nguess[*].  I'm guessing your co-worker's working tree is not clean.\nCommiting or stashing their changes first might get things working.\n\nHope that helps,\nJonathan\n\n[*] Another nice thing about quoting output is that it becomes more\nobvious what about it wasn't helpful, which sometimes leads to patches\nfrom kind people on the list to fix it.\n"},{"id":"248518","messageId":"1409257292.25998.4.camel@jekeller-desk1.amr.corp.intel.com","threadId":"37430","inReplyTo":"20140828002243.GA20185@google.com","subject":"Re: revert top most commit","fromName":"Keller, Jacob E","fromEmail":"jacob.e.keller@intel.com","sentAt":"2014-08-28T20:21:32Z","receivedAt":"2014-08-28T20:21:32Z","isPatch":false,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, 2014-08-27 at 17:22 -0700, Jonathan Nieder wrote:\n> Keller, Jacob E wrote:\n> >> On Wed, 2014-08-27 at 21:14 +0000, Keller, Jacob E wrote:\n> \n> >>> I am having trouble using revert. If I attempt to\n> >>>\n> >>> $ git revert <sha1id>\n> >>>\n> >>> where sha1id is the same as the HEAD commit, I instead get the output of\n> >>> what looks like git status.\n> [...]\n> > It's actually not my repository, I was helping a co-worker, and thought\n> > I'd ask if anyone here knew if it was expected behavior or not.\n> \n> More details about the output would help --- otherwise people have to\n> guess[*].  I'm guessing your co-worker's working tree is not clean.\n> Commiting or stashing their changes first might get things working.\n> \n> Hope that helps,\n> Jonathan\n> \n> [*] Another nice thing about quoting output is that it becomes more\n> obvious what about it wasn't helpful, which sometimes leads to patches\n> from kind people on the list to fix it.\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\nI will see if I can get the actual output.\n\nThanks,\nJake\n"},{"id":"248519","messageId":"1409257626.25998.7.camel@jekeller-desk1.amr.corp.intel.com","threadId":"37430","inReplyTo":"20140828002243.GA20185@google.com","subject":"Re: revert top most commit","fromName":"Keller, Jacob E","fromEmail":"jacob.e.keller@intel.com","sentAt":"2014-08-28T20:27:06Z","receivedAt":"2014-08-28T20:27:06Z","isPatch":false,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, 2014-08-27 at 17:22 -0700, Jonathan Nieder wrote:\n> Keller, Jacob E wrote:\n> >> On Wed, 2014-08-27 at 21:14 +0000, Keller, Jacob E wrote:\n> \n> >>> I am having trouble using revert. If I attempt to\n> >>>\n> >>> $ git revert <sha1id>\n> >>>\n> >>> where sha1id is the same as the HEAD commit, I instead get the output of\n> >>> what looks like git status.\n> [...]\n> > It's actually not my repository, I was helping a co-worker, and thought\n> > I'd ask if anyone here knew if it was expected behavior or not.\n> \n> More details about the output would help --- otherwise people have to\n> guess[*].  I'm guessing your co-worker's working tree is not clean.\n> Commiting or stashing their changes first might get things working.\n> \n> Hope that helps,\n> Jonathan\n> \n> [*] Another nice thing about quoting output is that it becomes more\n> obvious what about it wasn't helpful, which sometimes leads to patches\n> from kind people on the list to fix it.\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n# Command, where  \n$git revert b718c4d508204b7f46b147c7c47c51fe7a2c7e31On\n\n# Output\nbranch master\nYour branch is up-to-date with 'origin/master'.\nnothing to commit, working directory clean\n\nI also just got one key piece of information regarding this, the patch\nitself was blank!\n\nFor backstory, the issue is that he pushed to a tree which does not\nallow non-fastforward updates (so he can't rewind). He was using stacked\ngit, and accidentally pushed an empty patch, and wanted to revert it so\nthat at least the log showed that we had removed it (even though the\npatch itself was empty).\n\nAt minimum, this output from git revert could be made more clear about\nwhy it's failing on an empty patch.\n\nRegards,\nJake\n"}]}