git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artur Skawina <art.08.09@gmail.com>
To: Seth Robertson <in-gitvger@baka.org>
Cc: Stefan Haller <lists@haller-berlin.de>, git@vger.kernel.org
Subject: Re: Find out on which branch a commit was originally made
Date: Tue, 21 Sep 2010 04:12:05 +0200	[thread overview]
Message-ID: <4C981475.10404@gmail.com> (raw)
In-Reply-To: <201009210015.o8L0FcJt020691@no.baka.org>

On 09/21/10 02:15, Seth Robertson wrote:
> 
> I've discovered an error case in your pike script's logic (as and if I
> understand it).  If there are multiple children of the commit in
> question and those two children both merge onto the target branch, the
> path your program prints is incorrect (specifically, for reference B
> it prints D and then G--the correct answer is G only or a least D+H).
> It does not check to see whether a specific reachable merge commit is
> reachable by the path you have started to print.
> 
> ----master-----------G------H
>                     /      /
>                     |     /
>  --A-------D-----------F-
>           /         |
>  ----B---C          |
>       \             |
>        ----------E--/

I haven't checked, but I expect it to print exactly 'D' and 'G'.
'H' isn't interesting, as both parents already contain 'B'.
Yes, 'D' could be omitted, but knowing where else 'B' also
appeared /can/ be useful (and figuring out if it's safe to skip
'D' would be more expensive).

>     Unpikifying is left as an exercise for the user. ;)
> 
> I've converted it to perl and it now handles both your problem (which

I wasn't exactly thinking of perl when i wrote that... :)

> Of course it still suffers from reporting branches created after the
> reference you are interested in was created.

Well, at least git-find-branch-for, shows (some) merges _to_ other
(topic/remote) branches, but after browsing the kernel history
for a while i'm a bit surprised -- this causes significantly less
problems than i expected.

I haven't looked at your script, so i'm not sure what exactly it
tries to do, but i ran a quick test, using the kernel tree:

$ time git-find-branch-for 1f9c381fa3e0b9b9042e310c69df87eaf9b46ea4 
84e48b6d64fd Merge of master.kernel.org:/home/rmk/linux-2.6-rmk.git   050503 22:27
bfd4bda097f8 Merge with master.kernel.org:/pub/scm/linux/kernel/git/t 050505 12:59
325a479c4c11 Merge with temp tree to get David's gdb inferior calls p 050517 22:53
ad34ea2cc384 merge by hand - fix up rejections in Documentation/DocBo 050520 20:27
0m10.549s user   0m0.713s system   0m10.963s elapsed   102.74% CPU
$
$ time git-what-branch 1f9c381fa3e0b9b9042e310c69df87eaf9b46ea4 
1f9c381fa3e0b9b9042e310c69df87eaf9b46ea4 first merged onto v2.6.32.n using the following minimal path:
  v2.6.12-rc3-450-g1f9c381 merged up at v2.6.12-rc4-39-gad34ea2 (Fri May 20 22:27:44 2005)
  v2.6.12-rc4-39-gad34ea2 merged up at v2.6.12-rc3-590-gbfd4bda (Thu May  5 14:59:37 2005)
  v2.6.12-rc3-590-gbfd4bda merged up at v2.6.12-rc3-461-g84e48b6 (Wed May  4 00:27:24 2005)
  v2.6.12-rc3-461-g84e48b6 is on v2.6.32.n
18m29.771s user   0m29.681s system   18m4.897s elapsed   105.03% CPU
$

Results are similar, that one extra merge i'll have to take a look at
later, but the cost difference...

artur

  reply	other threads:[~2010-09-21  2:12 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
2010-09-20 15:49                     ` Artur Skawina
2010-09-21  0:15                       ` Seth Robertson
2010-09-21  2:12                         ` Artur Skawina [this message]
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=4C981475.10404@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).