From: Peter Harris <git@peter.is-a-geek.org>
To: Daniel Pittman <daniel@rimspace.net>
Cc: git@vger.kernel.org
Subject: Re: git-svn, and which branch am I on?
Date: Sat, 28 Feb 2009 10:03:55 -0500 [thread overview]
Message-ID: <eaa105840902280703w3dcc9b7fv9095ba874624dcca@mail.gmail.com> (raw)
In-Reply-To: <87ljrr7xof.fsf@rimspace.net>
On Sat, Feb 28, 2009 at 3:50 AM, Daniel Pittman wrote:
>
> The general question was: in git, how do I identify where this branch
> came from?
> Specifically, this was about 'git svn', but also generally how to
> identify this information in git.
> ...and, finally, is the reason that I am finding it hard to explain this
> because I have an expectation of how things work that doesn't match up
> with git? In other words, is the question actually meaningless?
You've hit the nail on the head. The question is meaningless. Git
tracks a DAG, and a branch is just that - a branch (or 'tip', if you
will) of the DAG.
Take, for example,
o--o--o--o master
\
o--o--o--o feature
\
o--o working
Which branch did 'working' come from? 'feature' or 'master'? Say I
later delete branch 'feature', since it was going in the wrong
direction. Does the answer change? What if I simply redraw the above
so that feature and working are swapped? Does the answer change? It's
still the same tree.
You can, however, answer related questions.
'git svn info' will tell you which branch a 'git svn dcommit' will
commit to, which is usually the question you actually wanted to
answer.
'git branch -r' will tell you which remote branch your local branch is
tracking. ie. which branch, if any, a plain 'git pull' will fetch and
merge from.
See also http://thread.gmane.org/gmane.comp.version-control.git/77730/focus=77823
and surrounding thread.
Peter Harris
next prev parent reply other threads:[~2009-02-28 15:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-28 8:50 git-svn, and which branch am I on? Daniel Pittman
2009-02-28 14:54 ` Björn Steinbrink
2009-02-28 15:03 ` Peter Harris [this message]
2009-02-28 17:14 ` Jakub Narebski
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eaa105840902280703w3dcc9b7fv9095ba874624dcca@mail.gmail.com \
--to=git@peter.is-a-geek.org \
--cc=daniel@rimspace.net \
--cc=git@vger.kernel.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 NNTP newsgroup(s).