From: Artur Skawina <art.08.09@gmail.com>
To: Stefan Haller <lists@haller-berlin.de>
Cc: Seth Robertson <in-gitvger@baka.org>, git@vger.kernel.org
Subject: Re: Find out on which branch a commit was originally made
Date: Mon, 20 Sep 2010 12:58:35 +0200 [thread overview]
Message-ID: <4C973E5B.4090201@gmail.com> (raw)
In-Reply-To: <1jp42v5.w5dez21d3nlciM%lists@haller-berlin.de>
On 09/20/10 10:12, Stefan Haller wrote:
> Seth Robertson <in-gitvger@baka.org> wrote:
>> -AA-- subtopic
>> / \
>> A---B---C topic
>> / \
>> D---E---F---G---H---I---J---K---L---M---N master
>> \ /
>> O---P---Q another-topic
>>
>>
>> In the above example, the subtopic branch merge from AA to C prevents
>> you from finding out what branch B is on using the original script.
>
> When you say "the original script", are you talking about Artur's
> one-liner or my script?
>
> My script gives me exactly the information I want in all cases. For a
> given command $1 and a target branch $2, it shows you all merges that
> were involved in bringing $1 into $2. For example:
>
> Called with "B" "master", it returns H
No, it will return both C and H, just like my one-liner; this will be
misleading, the user won't be able to figure out where 'B" came from
w/o looking at the graph, from output like:
$ git-show-merges-since B master
C..... Merge branch 'subtopic' into topic
H..... Merge branch 'topic'
The results for 'B' and 'AA' will be exactly the same.
For 'B', the 'C' merge should be omitted; skipping it because 'B'
comes in via first parent would probably work, but i can't turn that
into a one-liner right now...
On 09/20/10 07:47, Seth Robertson wrote:
> I agree 100% that the right answer is topic for B and master for F.
>
> I know how to get topic for B. Finding master (and not another-topic)
> for F is difficult because we have to know something that I don't know
> how to get git to tell me: when another-topic branch was created.
> Using git-rev-parse another-topic....master we know what commit
> another-topic and master diverged, but I cannot figure out a way to
> discover which branch was created at that point and which branch
> pre-existed (obviously for master we know, but if this was a
> supertopic branch we would not). I thought about using merge
> direction for subsequent merges as a hint, but we don't know if the
> second branch has been permanently been merged or not, if there was a
> K->P merge and Q-M did not happen (yet) then we would give the wrong
> branch name.
Oh, if there would be no 'Q->M' merge and both branches would still
be "live", 'both' is certainly the right answer.
If 'another-topic' was merged into another branch (like in the example
graph) and is dead at this point, i think skipping it is the correct
decision -- there could be many such branches and presenting a long
list of candidates won't really help the user.
Given history as in the graph and a /live/ 'another-topic' -- hmm,
if there are just a few such refs maybe showing them would be ok.
artur
next prev parent reply other threads:[~2010-09-20 10:58 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-18 9:19 Find out on which branch a commit was originally made Stefan Haller
2010-09-18 9:58 ` Ævar Arnfjörð Bjarmason
2010-09-18 10:02 ` Ævar Arnfjörð Bjarmason
2010-09-18 11:28 ` Tor Arntsen
2010-09-18 15:26 ` Stefan Haller
2010-09-18 16:41 ` Artur Skawina
2010-09-19 9:45 ` Stefan Haller
2010-09-19 12:54 ` Clemens Buchacher
2010-09-19 14:03 ` Artur Skawina
2010-09-19 14:08 ` Stefan Haller
2010-09-19 16:38 ` Artur Skawina
2010-09-19 18:30 ` Robin Rosenberg
2010-09-19 22:03 ` Seth Robertson
2010-09-19 23:12 ` Artur Skawina
2010-09-19 23:54 ` Seth Robertson
2010-09-20 1:31 ` Artur Skawina
2010-09-20 5:47 ` Seth Robertson
2010-09-20 8:12 ` Stefan Haller
2010-09-20 10:58 ` Artur Skawina [this message]
2010-09-20 15:49 ` Artur Skawina
2010-09-21 0:15 ` Seth Robertson
2010-09-21 2:12 ` Artur Skawina
2010-09-22 16:35 ` ANNOUNCE git-what-branch (was Re: Find out on which branch a commit was originally made) Seth Robertson
2010-09-22 20:27 ` Artur Skawina
2010-09-22 23:26 ` Find out on which branch a commit was originally made) (was ANNOUNCE git-what-branch) Seth Robertson
2010-09-23 13:14 ` Stephen Bash
2010-09-23 13:26 ` Ævar Arnfjörð Bjarmason
2010-09-23 21:32 ` Artur Skawina
2010-09-24 1:33 ` Artur Skawina
2010-09-24 20:57 ` Seth Robertson
2010-09-23 14:27 ` Seth Robertson
2010-09-20 18:20 ` Find out on which branch a commit was originally made Stefan Haller
2010-09-24 18:26 ` Bryan Drewery
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=4C973E5B.4090201@gmail.com \
--to=art.08.09@gmail.com \
--cc=git@vger.kernel.org \
--cc=in-gitvger@baka.org \
--cc=lists@haller-berlin.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 NNTP newsgroup(s).