git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* q: faster way to integrate/merge lots of topic branches?
@ 2008-07-23 13:05 Ingo Molnar
  2008-07-23 13:17 ` Ingo Molnar
                   ` (6 more replies)
  0 siblings, 7 replies; 32+ messages in thread
From: Ingo Molnar @ 2008-07-23 13:05 UTC (permalink / raw)
  To: git


I've got the following, possibly stupid question: is there a way to 
merge a healthy number of topic branches into the master branch in a 
quicker way, when most of the branches are already merged up?

Right now i've got something like this scripted up:

  for B in $(git-branch | cut -c3- ); do git-merge $B; done 

It takes a lot of time to run on even a 3.45GHz box:

  real    0m53.228s
  user    0m41.134s
  sys     0m11.405s

I just had a workflow incident where i forgot that this script was 
running in one window (53 seconds are a _long_ time to start doing some 
other stuff :-), i switched branches and the script merrily chugged away 
merging branches into a topic branch i did not intend.

It iterates over 140 branches - but all of them are already merged up.

Anyone can simulate it by switching to the linus/master branch of the 
current Linux kernel tree, and doing:

   time for ((i=0; i<140; i++)); do git-merge v2.6.26; done

   real    1m26.397s
   user    1m10.048s
   sys     0m13.944s

One could argue that determining whether it's all merged up already is a 
complex task, but but even this seemingly trivial merge of HEAD into 
HEAD is quite slow:

   time for ((i=0; i<140; i++)); do git-merge HEAD; done

   real    0m17.871s
   user    0m8.977s
   sys     0m8.396s

I'm wondering whether there are tricks to speed this up. The real script 
i'm using is much longer and obscured with boring details like errors, 
conflicts, etc. - but the above is the gist of it. (and that is what 
makes it slow primarily)

Using a speculative Octopus might be one approach, but that runs into 
the octopus merge limitation at 24 branches, and it also is quite slow 
as well. (and is not equivalent to the serial merge of 140 branches)

I have thought of using the last CommitDate of the topic branch and 
compare it with the last CommitDate of the master branch [and i can 
trust those values] - that would be a lot faster - but maybe i'm missing 
something trivial that makes that approach unworkable. It would also be 
nice to have a builtin shortcut for that instead of having to go via 
"git-log --pretty=fuller" to dump the CommitDate field.

builtin-integrate.c perhaps? ;-)

	Ingo

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2008-07-25  8:48 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 13:05 q: faster way to integrate/merge lots of topic branches? Ingo Molnar
2008-07-23 13:17 ` Ingo Molnar
2008-07-23 13:49   ` Ingo Molnar
2008-07-23 14:47     ` Jay Soffian
2008-07-23 14:56       ` Ingo Molnar
2008-07-23 15:06         ` Ingo Molnar
2008-07-23 13:40 ` Andreas Ericsson
2008-07-23 14:02   ` Ingo Molnar
2008-07-23 14:57   ` Miklos Vajna
2008-07-23 13:41 ` Sergey Vlasov
2008-07-23 14:09   ` Ingo Molnar
2008-07-23 14:14     ` Ingo Molnar
2008-07-23 13:56 ` SZEDER Gábor
2008-07-23 14:04   ` Ingo Molnar
2008-07-23 17:59     ` Junio C Hamano
2008-07-23 22:09       ` [PATCH 1/2] builtin-branch.c: remove unused code in append_ref() callback function Junio C Hamano
2008-07-23 22:15       ` [PATCH] builtin-branch.c: optimize --merged and --no-merged Junio C Hamano
2008-07-24  7:16         ` Lars Hjemli
2008-07-24  8:29         ` Nanako Shiraishi
2008-07-24 10:03           ` Lars Hjemli
2008-07-24 15:29       ` q: faster way to integrate/merge lots of topic branches? Ingo Molnar
2008-07-23 18:04     ` Linus Torvalds
2008-07-23 18:12       ` Linus Torvalds
2008-07-23 20:01     ` Junio C Hamano
2008-07-24 15:27       ` Ingo Molnar
2008-07-25  8:46         ` Junio C Hamano
2008-07-23 14:06 ` Björn Steinbrink
2008-07-23 14:06 ` Santi Béjar
2008-07-23 17:59 ` Linus Torvalds
2008-07-23 19:09   ` Pierre Habouzit
2008-07-23 20:27     ` Pierre Habouzit
2008-07-23 20:40       ` Pierre Habouzit

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).