From: Sergey Organov <sorganov@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Git/Magit: To which branch was a commit was originally committed?
Date: Mon, 01 Nov 2021 20:18:22 +0300 [thread overview]
Message-ID: <slp7gu$37t$1@ciao.gmane.io> (raw)
In-Reply-To: m2bl3397tq.fsf@gmail.com
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
next prev parent reply other threads:[~2021-11-01 17:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 14:38 Git/Magit: To which branch was a commit was originally committed? Michael Heerdegen
2021-11-01 16:01 ` Daniel Fleischer
2021-11-01 16:09 ` Daniel Fleischer
2021-11-01 17:18 ` Sergey Organov [this message]
2021-11-01 19:34 ` Michael Heerdegen
2021-11-02 14:12 ` Sergey Organov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='slp7gu$37t$1@ciao.gmane.io' \
--to=sorganov@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).