aboutsummaryrefslogtreecommitdiff
path: root/merge-base.c
Commit message (Collapse)AuthorAge
* Try to find the optimum merge base while resolving.Junio C Hamano2005-08-23
| | | | | | | | | The merge-base command acquires a new option, '--all', that causes it to output all the common ancestor candidates. The "git resolve" command then uses it to pick the optimum merge base by picking the one that results in the smallest number of nontrivial merges. Signed-off-by: Junio C Hamano <junkio@cox.net>
* merge-base.c: pathological case fix.Junio C Hamano2005-08-11
| | | | | | Also add some illustration requested by Linus. Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Speed up git-merge-base a lotLinus Torvalds2005-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 4f7eb2e5a351e0d1f19fd4eab7e92834cc4528c2 I fixed git-merge-base getting confused by datestamps that caused it to traverse things in a non-obvious order. However, my fix was a very brute-force one, and it had some really horrible implications for more complex trees with lots of parallell development. It might end up traversing all the way to the root commit. Now, normally that isn't that horrible: it's used mainly for merging, and the bad cases really tend to happen fairly rarely, so if it takes a few seconds, we're not in too bad shape. However, gitk will also do the git-merge-base for every merge it shows, because it basically re-does the trivial merge in order to show the "interesting" parts. And there we'd really like the result to be instantaneous. This patch does that by walking the tree more completely, and using the same heuristic as git-rev-list to decide "ok, the rest is uninteresting". In one - hopefully fairly extreme - case, it made a git-merge-base go from just under five seconds(!) to a tenth of a second on my machine. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix merge-base from getting confused.Linus Torvalds2005-07-30
| | | | | | | | | | | | | | | | On Sat, 30 Jul 2005, Linus Torvalds wrote: > > Yup, it's git-merge-base, and it is confused by the same thing that > confused git-rev-list. Hmm.. Here's a tentative fix. I'm not really happy with it, and maybe somebody else can come up with a better one. I think this one ends up being quite a bit more expensive than the old one (it will look up _all_ common parents that have a child that isn't common, and then select the newest one of the bunch), but I haven't really thought it through very much. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* sparse cleanupLinus Torvalds2005-05-20
| | | | | | | | | Fix various things that sparse complains about: - use NULL instead of 0 - make sure we declare everything properly, or mark it static - use proper function declarations ("fn(void)" instead of "fn()") Sparse is always right.
* [PATCH] cleanup of in-code namesAlexey Nezhdanov2005-05-19
| | | | | | | Fixes all in-code names that leaved during "big name change". Signed-off-by: Alexey Nezhdanov <snake@penza-gsm.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* merge-base: use the new lookup_commit_reference() helper functionLinus Torvalds2005-05-18
| | | | This allows you to use tags for merge bases.
* Add "get_sha1()" helper function.Linus Torvalds2005-05-01
| | | | | | | | | | | | This allows the programs to use various simplified versions of the SHA1 names, eg just say "HEAD" for the SHA1 pointed to by the .git/HEAD file etc. For example, this commit has been done with git-commit-tree $(git-write-tree) -p HEAD instead of the traditional "$(cat .git/HEAD)" syntax.
* [PATCH] Allow multiple date-ordered listsDaniel Barkalow2005-04-23
| | | | | | | | | | | Make pop_most_recent_commit() return the same objects multiple times, but only if called with different bits to mark. This is necessary to make merge-base work again. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] Replace merge-base implementationDaniel Barkalow2005-04-23
| | | | | | | | | | The old implementation was a nice algorithm, but, unfortunately, it could be confused in some cases and would not necessarily do the obvious thing if one argument was decended from the other. This version fixes that by changing the criterion to the most recent common ancestor. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Merge the new object model thing from Daniel BarkalowLinus Torvalds2005-04-18
|\ | | | | | | | | | | | | This was a real git merge with conflicts. I'll commit the scripts I used to do the merge next. Not pretty, but it's half-way functional.
| * [PATCH] Switch implementations of merge-base, port to parsingDaniel Barkalow2005-04-18
| | | | | | | | | | | | | | | | This switches to my implementation of merge-base, but with the new parsing library. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | Make "parse_commit" return the "struct revision" for the commit.Linus Torvalds2005-04-17
|/ | | | | | | | Also, make it a fatal error to pass in a non-commit object. The callers never checked, so better check here. This simplifies merge-base further. It's now so trivial that it's almost ridiculous.
* Do a very simple "merge-base" that finds the most recent commonLinus Torvalds2005-04-17
parent of two commits. The question of "best" commit can probably be tweaked almost arbitrarily. In particular, trying to take things like how big the tree differences are into account migt be a good idea. This one is just very simple.