News for hackers. Stuff that matters.
Re:Mercurial RFC of a new extension to directly operate on G... by pseudalopex on Wednesday October 30, 2019 @04:09PM (#21402004)
Git's idea of branches confuses a lot of new users. Their expect them to work like Mercurial's. Bookmarks were added for Git compatibility.

The Mercurial command to get the short hash of the current commit is "hg id -i". You can get the long hash by adding "—debug". The "hg log" command shows a more general way to do it and could be shorter.

Mercurial logs are also easy to customize.

Re:Mercurial RFC of a new extension to directly operate on G... by Grue3 on Thursday October 31, 2019 @05:35AM (#21407009)
You'd think it would be `hg id`, but it doesn't work without connection to remote repository and is extremely slow with large repositories with uncommited changes, so it's not the correct answer. --debug option also prints info other than hash and can't be customized.

>Mercurial logs are also easy to customize.

I wanted to customize logging string so that it shows (sequential commit id) - (other stuff), but there's no way to make sequential commit id to line up neatly when it goes from 9 to 10, or from 99 to 100. So making a pretty one-line log is impossible. Maybe it was fixed since then, I wouldn't know.

Re:Mercurial RFC of a new extension to directly operate on G... by pseudalopex on Friday November 01, 2019 @10:58PM (#21425614)
"hg id" works offline. Adding "--debug" only makes the hash longer. It can be customized with a template like "hg log".

Looking for uncommitted changes is what makes it slow. The fsmonitor extension makes it faster. Adding "-r ." skips it.

The "pad" function was added in 2014.[1]

[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2014...