summaryrefslogtreecommitdiff
path: root/merge-base.c
Commit message (Collapse)AuthorAgeFilesLines
* Make the rest of commands work from a subdirectory.Junio C Hamano2005-11-281-0/+2
| | | | | | | | | | These commands are converted to run from a subdirectory. commit-tree convert-objects merge-base merge-index mktag pack-objects pack-redundant prune-packed read-tree tar-tree unpack-file unpack-objects update-server-info write-tree Signed-off-by: Junio C Hamano <junkio@cox.net>
* merge-base: avoid unnecessary postprocessing.Junio C Hamano2005-11-111-34/+43
| | | | | | | | | When we have only one merge-base candidates in the result list, there is no point going back to mark the reachable commits again. And that is the most common case, so try not to waste time on it. Suggested by Linus. Signed-off-by: Junio C Hamano <junkio@cox.net>
* merge-base: fully contaminate the well.Junio C Hamano2005-11-111-1/+77
| | | | | | | | The discussion on the list demonstrated a pathological case where an ancestor of a merge-base can be left interesting. This commit introduces a postprocessing phase to fix it. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Try to find the optimum merge base while resolving.Junio C Hamano2005-08-231-14/+38
| | | | | | | | | 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-111-6/+68
| | | | | | 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-111-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-301-38/+36
| | | | | | | | | | | | | | | | 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-201-1/+1
| | | | | | | | | 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-191-1/+1
| | | | | | | 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-181-2/+2
| | | | This allows you to use tags for merge bases.
* Add "get_sha1()" helper function.Linus Torvalds2005-05-011-2/+2
| | | | | | | | | | | | 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-231-21/+5
| | | | | | | | | | | 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-231-48/+44
| | | | | | | | | | 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-181-38/+76
|\ | | | | | | | | | | | | 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-181-42/+80
| | | | | | | | | | | | | | | | 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-171-4/+1
|/ | | | | | | | 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-171-0/+57
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.