On Sat, Mar 4, 2023 at 1:39 AM Uwe Brauer <o...@mat.ucm.es> wrote:

> However a solution is to use name-rev
> Like this
> git log   --graph --color=always --all --since=2years --decorate --pretty | 
> git name-rev --annotate-stdin | less -R
> And the resulting graph looks, at least for me, close enough to
> mercurial's named branches.
> So I am wondering, is this  name-rev information somewhere stored, or
> calculated on the fly each time  the command is called?

It's calculated on the fly.

Weirdly enough, I wrote a blog post [1] about a debate in 2012
precisely about the differences between git and mercurial, and how
`git name-rev` can be used to simulate mercurial branches (for the
most part).

But there are some corner cases in which git is not able to provide
the same information as mercurial, because it doesn't have the branch
point (the precise point where a branch was created). There's many
potential ways to calculate this branch point [2], but there isn't a
single infallible solution.

Git truly needs to be fixed in order to support this, I proposed a
branch@{tail} notation [3].

But for now `git name-rev` is good enough.


[2] https://stackoverflow.com/questions/1527234/finding-a-branch-point-with-git
[3] https://felipec.wordpress.com/2013/08/27/analysis-of-hg-and-git-branches/

Felipe Contreras

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to