{"thread":{"id":"13740","subject":"Why does \"git log --reverse -1\" print the HEAD commit?","startedAt":"2008-05-31T14:11:02Z","lastAt":"2008-05-31T14:33:27Z","messageCount":3,"participants":["Teemu Likonen","Miklos Vajna"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"78226","messageId":"20080531141102.GA3035@mithlond.arda.local","threadId":"13740","inReplyTo":null,"subject":"Why does \"git log --reverse -1\" print the HEAD commit?","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-05-31T14:11:02Z","receivedAt":"2008-05-31T14:11:02Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"It feels wrong that \"git log -1\" and \"git log --reverse -1\" both print\nthe same commit: HEAD. Why is that?\n\nSince \"git log --reverse\" starts from the bottom I'd have expected \"-1\"\nto print one commit from the bottom.\n"},{"id":"78229","messageId":"20080531142408.GL29404@genesis.frugalware.org","threadId":"13740","inReplyTo":"20080531141102.GA3035@mithlond.arda.local","subject":"Re: Why does \"git log --reverse -1\" print the HEAD commit?","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-05-31T14:24:08Z","receivedAt":"2008-05-31T14:24:08Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, May 31, 2008 at 05:11:02PM +0300, Teemu Likonen <tlikonen@iki.fi> wrote:\n> It feels wrong that \"git log -1\" and \"git log --reverse -1\" both print\n> the same commit: HEAD. Why is that?\n> \n> Since \"git log --reverse\" starts from the bottom I'd have expected \"-1\"\n> to print one commit from the bottom.\n\n-1 limits the commit list to one element and then it prints that range\nin reverse order, which is the same for a single commit.\n"},{"id":"78230","messageId":"20080531143327.GA4121@mithlond.arda.local","threadId":"13740","inReplyTo":"20080531142408.GL29404@genesis.frugalware.org","subject":"Re: Why does \"git log --reverse -1\" print the HEAD commit?","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-05-31T14:33:27Z","receivedAt":"2008-05-31T14:33:27Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"Miklos Vajna wrote (2008-05-31 16:24 +0200):\n\n> On Sat, May 31, 2008 at 05:11:02PM +0300, Teemu Likonen\n> <tlikonen@iki.fi> wrote:\n> > It feels wrong that \"git log -1\" and \"git log --reverse -1\" both\n> > print the same commit: HEAD. Why is that?\n> > \n> > Since \"git log --reverse\" starts from the bottom I'd have expected\n> > \"-1\" to print one commit from the bottom.\n> \n> -1 limits the commit list to one element and then it prints that range\n> in reverse order, which is the same for a single commit.\n\nOh yeah, that's the logic, thanks. I find it counter-intuitive but I'll\nsurvive.\n"}]}