git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-rev-list.txt: rev stands for revision, not reverse.

From
RWRalf Wildenhues <ralf.wildenhues@gmx.de>
Date
Nov 2, 2007, 18:55 UTC
Message-ID
<20071102185509.GA5242@ins.uni-bonn.de>
In-Reply-To
<7vr6j9bv80.fsf@gitster.siamese.dyndns.org>
Hello Junio,
* Junio C Hamano wrote on Thu, Nov 01, 2007 at 08:51:11PM CET:
Show 14 quoted lines
> Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
> 
> > Yes, believe it or not, but I stumbled over the synopsis
> >
> > | git-rev-list - Lists commit objects in reverse chronological order
> >
> > asking myself whether rev could possibly mean "reverse".
> > I hope this helps avoid this pitfall for others.
> 
> In addition to your patch,
> 
> 	git-rev-list - List commits from most recent to older
> 
> might be a good rewording?

Is the reverse chronological order the primary sorting key at all? My clone of the git repo gives me

$ git rev-list --pretty=format:%ct master | grep -v ^commit >A $ sort -k1nr A | diff -u - A --- - 2007-11-02 18:06:00.115804000 +0100 +++ A 2007-11-02 18:05:37.000000000 +0100

@@ -8162,8 +8162,8 @@
 1141461106
 1141461098
 1141461088
-1141457404
 1141457396
+1141457404
 1141453772
 1141453757
 1141453684

Interestingly, --date-order shows another inconsistency:

$ git rev-list --date-order --pretty=format:%ct master | grep -v ^commit >Ad
$ sort -k1nr Ad | diff -u - Ad
--- -   2007-11-02 18:27:18.091006000 +0100
+++ Ad  2007-11-02 18:25:46.000000000 +0100
@@ -653,8 +653,8 @@
 1188812406
 1188808117
 1188770606
-1188716400
 1188716027
+1188716400
 1188677727
 1188668216
 1188644991
@@ -8162,8 +8162,8 @@
 1141461106
 1141461098
 1141461088
-1141457404
 1141457396
+1141457404
 1141453772
 1141453757
 1141453684

This is "git version 1.5.3.5.474.g3e4bb", both repo and executables.

It looks like there is either a bug or the sorting criterion is subtly
different.

> "rev-list --reverse" reverses that usual order and we end up
> explaining double reversal if we use the phrase "reverse chronological
> order" to describe the normal order.

Well, I'd say the current synopsis would be fine if the default ordering
really were the commit date.  The synopsis should be concise, it's good
enough if the Description clears potential doubts.

Cheers,
Ralf
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “git-rev-list.txt: rev stands for revision, not reverse.”
  1. git-rev-list.txt: rev stands for revision, not reverse.Ralf Wildenhues, Nov 1, 2007
  2. Junio C HamanoNov 1, 2007
  3. Ralf WildenhuesNov 2, 2007
  4. Junio C HamanoNov 2, 2007
  5. Junio C HamanoNov 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.