facebook / sapling

A Scalable, User-Friendly Source Control System.

Home Page:https://sapling-scm.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`sl log` presents commits in reverse, or not at all

BackSlasher opened this issue · comments

I'm probably missing something on how to use sl log, but the docs seem to be incorrect.
From sl log --help:

If no revision range is specified, the default is the current commit and
all of its ancestors ("::.").

However, I can't simulate the default behavior, not to mention looking at logs of other labels, with explicit arguments.

Setup

V nitz@nitz-angel:~$ cd /tmp
V nitz@nitz-angel:/tmp$ mkdir bla
V nitz@nitz-angel:/tmp$ cd bla
V nitz@nitz-angel:/tmp/bla$ sl init --git .
V nitz@nitz-angel:/tmp/bla$ echo 1 > bla
V nitz@nitz-angel:/tmp/bla$ sl addremove
adding bla
V nitz@nitz-angel:/tmp/bla$ sl commit -m 'a'
V nitz@nitz-angel:/tmp/bla$ echo 2 > bla
V nitz@nitz-angel:/tmp/bla$ sl commit -m 'b'
V nitz@nitz-angel:/tmp/bla$ echo 3 > bla
V nitz@nitz-angel:/tmp/bla$ sl commit -m 'c'

Default behavior:


V nitz@nitz-angel:/tmp/bla$ sl log
changeset:   e2c7902c8123c8ec08eaae0e70960876443c8385  (@)
user:        Nitzan Raz <nitzan@angelsense.com>
date:        Tue, 26 Dec 2023 13:35:51 +0200
summary:     c

changeset:   406a0c6ca0494ba6800b6faa856ac64f4dac749d  
user:        Nitzan Raz <nitzan@angelsense.com>
date:        Tue, 26 Dec 2023 13:35:43 +0200
summary:     b

changeset:   a8fc0f668913a9dc0b271d1109a0711424e19b86  
user:        Nitzan Raz <nitzan@angelsense.com>
date:        Tue, 26 Dec 2023 13:35:37 +0200
summary:     a

My attempts to get default behavior with arguments:

V nitz@nitz-angel:/tmp/bla$ sl log ::.
V nitz@nitz-angel:/tmp/bla$ 
V nitz@nitz-angel:/tmp/bla$ sl log -r ::.
changeset:   a8fc0f668913a9dc0b271d1109a0711424e19b86  
user:        Nitzan Raz <nitzan@angelsense.com>
date:        Tue, 26 Dec 2023 13:35:37 +0200
summary:     a

changeset:   406a0c6ca0494ba6800b6faa856ac64f4dac749d  
user:        Nitzan Raz <nitzan@angelsense.com>
date:        Tue, 26 Dec 2023 13:35:43 +0200
summary:     b

changeset:   e2c7902c8123c8ec08eaae0e70960876443c8385  (@)
user:        Nitzan Raz <nitzan@angelsense.com>
date:        Tue, 26 Dec 2023 13:35:51 +0200
summary:     c

V nitz@nitz-angel:/tmp/bla$ 

As you can see, using -r ::. causes the commits to be displayed in inverse, which is not very efficient with a repo with >3 commits.
Am I missing something obvious? Is this a bug?

Thank you for your time <3

The revset expression defines both the set of commits and the order. ::. uses the ascending order. You can use reverse(::.) to get the expected order. You can also use -fr . for the same effect.

Thank you