On Sat, Mar 4, 2023 at 1:39 AM Uwe Brauer <[email protected]> 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.
Cheers.
[1]
https://felipec.wordpress.com/2012/05/26/no-mercurial-branches-are-still-not-better-than-git-ones-response-to-jhws-more-on-mercurial-vs-git-with-graphs/
[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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/git-users/CAMP44s3J9CjWCaDoo8A3MM-eu%3D%2BToX2S1KRfs%2B1O3nw0V8BKuw%40mail.gmail.com.