git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-merge-cache / StGIT - gitmergeonefile.py: merging one tree into another rather than two trees into merge base
@ 2005-09-10 18:27 Blaisorblade
  2005-09-11  8:24 ` Catalin Marinas
  0 siblings, 1 reply; 14+ messages in thread
From: Blaisorblade @ 2005-09-10 18:27 UTC (permalink / raw)
  To: Catalin Marinas, Junio C Hamano, git

(Please CC me on replies as I'm not subscribed).

I experienced a (performance) problem with StGit, but I don't know if it's the 
culprit or if git-merge-cache is.

Today I was pushing my patch stack (which was against Linux 2.6.13) on top of 
the latest snapshot I have (i.e. upstream will likely have some mega of 
patches). And it was *really* slow (say it pushed 8 patches in 5 minutes).

After the analisys, it's more or less logical - it'd take more or less the 
same time to merge upstream changes against local ones. The problem is that 
it's not how things should go.

I looked with "top" at what was happening, and I saw a lot of time spent by 
either gitmergeonefile.py or git-update-cache --remove*. And looking at the 
merge algorithm, I realized it merges both HEAD and patch top into the patch 
bottom (or something like that).

I.e. if upstream rewrote everything, it will merge this rewrite into the patch 
bottom, together with the patch itself. So, the merge time will depend on the 
biggest of the two changed trees, not on the least one.

A more reasonable algorithm would be along "read-tree HEAD"; merge "stg diff 
-r /" (i.e. the current patch) in it.

I don't know if there's any real difference between cg-Xmergefile, 
gitmergeonefile.py and git-merge-one-file-script, and if that would matter in 
this case.

* About --remove, it was called on files which were present in stage1, removed 
in stage2 (i.e. upstream) and unchanged in stage3 (i.e. patch).

In the git-read-tree manpage (which is probably outdated), this is documented 
as follows:

       o  stage 1 and stage 3 are the same and stage 2 is different: 
           take stage 2 (some work has been done on stage 2)

But it didn't happen, which is strange.

Additional note: in StGIT, git-read-tree is called with stage1 which is not 
the merge base between stage2 and stage3.

It is passed the patch bottom, the current HEAD and the patch top.

For the first patch, the patch bottom is the merge base, but not otherwise; so 
differences between either stage1 or stage3, and stage2, include files 
changed in previous patches.

So, would stgit delete a file created in patch #1 when merge-applying patch 
#2?
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

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

end of thread, other threads:[~2005-09-19 18:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-10 18:27 git-merge-cache / StGIT - gitmergeonefile.py: merging one tree into another rather than two trees into merge base Blaisorblade
2005-09-11  8:24 ` Catalin Marinas
2005-09-12 12:59   ` Chuck Lever
2005-09-14 17:46     ` Blaisorblade
2005-09-14 18:16   ` Blaisorblade
2005-09-14 18:19   ` Blaisorblade
2005-09-15 10:06     ` Catalin Marinas
2005-09-16 18:45       ` Blaisorblade
2005-09-16 19:59       ` Junio C Hamano
2005-09-17  9:31         ` Catalin Marinas
2005-09-19 15:50           ` omitted test scripts? Chuck Lever
2005-09-19 16:19             ` Junio C Hamano
2005-09-19 17:01               ` Daniel Barkalow
2005-09-19 18:54               ` Matthias Urlichs

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