* Why does "git log --reverse -1" print the HEAD commit?
@ 2008-05-31 14:11 Teemu Likonen
2008-05-31 14:24 ` Miklos Vajna
0 siblings, 1 reply; 3+ messages in thread
From: Teemu Likonen @ 2008-05-31 14:11 UTC (permalink / raw)
To: git
It feels wrong that "git log -1" and "git log --reverse -1" both print
the same commit: HEAD. Why is that?
Since "git log --reverse" starts from the bottom I'd have expected "-1"
to print one commit from the bottom.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why does "git log --reverse -1" print the HEAD commit?
2008-05-31 14:11 Why does "git log --reverse -1" print the HEAD commit? Teemu Likonen
@ 2008-05-31 14:24 ` Miklos Vajna
2008-05-31 14:33 ` Teemu Likonen
0 siblings, 1 reply; 3+ messages in thread
From: Miklos Vajna @ 2008-05-31 14:24 UTC (permalink / raw)
To: Teemu Likonen; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 446 bytes --]
On Sat, May 31, 2008 at 05:11:02PM +0300, Teemu Likonen <tlikonen@iki.fi> wrote:
> It feels wrong that "git log -1" and "git log --reverse -1" both print
> the same commit: HEAD. Why is that?
>
> Since "git log --reverse" starts from the bottom I'd have expected "-1"
> to print one commit from the bottom.
-1 limits the commit list to one element and then it prints that range
in reverse order, which is the same for a single commit.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why does "git log --reverse -1" print the HEAD commit?
2008-05-31 14:24 ` Miklos Vajna
@ 2008-05-31 14:33 ` Teemu Likonen
0 siblings, 0 replies; 3+ messages in thread
From: Teemu Likonen @ 2008-05-31 14:33 UTC (permalink / raw)
To: Miklos Vajna; +Cc: git
Miklos Vajna wrote (2008-05-31 16:24 +0200):
> On Sat, May 31, 2008 at 05:11:02PM +0300, Teemu Likonen
> <tlikonen@iki.fi> wrote:
> > It feels wrong that "git log -1" and "git log --reverse -1" both
> > print the same commit: HEAD. Why is that?
> >
> > Since "git log --reverse" starts from the bottom I'd have expected
> > "-1" to print one commit from the bottom.
>
> -1 limits the commit list to one element and then it prints that range
> in reverse order, which is the same for a single commit.
Oh yeah, that's the logic, thanks. I find it counter-intuitive but I'll
survive.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-31 14:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-31 14:11 Why does "git log --reverse -1" print the HEAD commit? Teemu Likonen
2008-05-31 14:24 ` Miklos Vajna
2008-05-31 14:33 ` Teemu Likonen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).