unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Daniel Fleischer <danflscr@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: Git/Magit: To which branch was a commit was originally committed?
Date: Mon, 01 Nov 2021 18:09:05 +0200	[thread overview]
Message-ID: <m2bl3397tq.fsf@gmail.com> (raw)
In-Reply-To: <87zgqo2b5q.fsf@web.de> (Michael Heerdegen's message of "Mon, 01 Nov 2021 15:38:57 +0100")

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.

Best,

-- 

Daniel Fleischer



  parent reply	other threads:[~2021-11-01 16:09 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 [this message]
2021-11-01 17:18   ` Sergey Organov
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=m2bl3397tq.fsf@gmail.com \
    --to=danflscr@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).