help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Git/Magit: To which branch was a commit was originally committed?


From: Sergey Organov
Subject: Re: Git/Magit: To which branch was a commit was originally committed?
Date: Mon, 01 Nov 2021 20:18:22 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Daniel Fleischer <danflscr@gmail.com> writes:

> Upon thinking, one cannot answer the question you're asking. This is
> because commits do not hold this information; they don't "remember" in
> which branch they were. Git history is a graph where commits are nodes.
> Branches are labels we stick to specific nodes. When we update, we move
> a label forward to another node. That previous node does not "remember"
> that a label was used to be attached to it. The answer I gave you a
> minute ago only answers the following question: if I start from a given
> commit/node and go forward in time, which branches/labels would I meet?
> it answers your question only in the simplest cases (no splits) but
> hopefully that is what you're looking for.

I think that closest thing to the original request would be a way to
list branches from which the commit in question is reachable if we
follow first parent only. This way branches to which the commit "was
merged" won't appear in the list. I dunno how to achieve it either in
Git or Magit without additional scripting though.

-- Sergey Organov




reply via email to

[Prev in Thread] Current Thread [Next in Thread]