summaryrefslogtreecommitdiff
path: root/src/merge.c
Commit message (Collapse)AuthorAgeFilesLines
* merge: expose multiple merge basescmn/oidarrayCarlos Martín Nieto2014-07-271-1/+53
| | | | | | | | We always calculate multiple merge bases, but up to now we had only exposed the "best" merge base. Introduce git_oidarray which analogously to git_strarray lets us return multiple ids.
* merge: don't open COMMIT_MSG unless we need to append conflictsEdward Thomson2014-07-081-3/+4
|
* git_checkout_index: checkout other indexesEdward Thomson2014-07-011-137/+36
| | | | | | | | git_checkout_index can now check out other git_index's (that are not necessarily the repository index). This allows checkout_index to use the repository's index for stat cache information instead of the index data being checked out. git_merge and friends now check out their indexes directly instead of trying to blend it into the running index.
* Modify GIT_MERGE_CONFIG -> GIT_MERGE_PREFERENCEEdward Thomson2014-05-271-7/+7
|
* Staticify `merge_config`Edward Thomson2014-05-271-1/+1
|
* Use a config snapshotEdward Thomson2014-05-271-1/+1
|
* Move GIT_MERGE_CONFIG_* to its own enumEdward Thomson2014-05-271-9/+12
|
* Introduce GIT_MERGE_CONFIG_* for merge.ff settingsEdward Thomson2014-05-271-9/+43
| | | | | | git_merge_analysis will now return GIT_MERGE_CONFIG_NO_FASTFORWARD when merge.ff=false and GIT_MERGE_CONFIG_FASTFORWARD_ONLY when merge.ff=true
* Make init_options fns use unsigned ints and macroRussell Belfer2014-05-021-27/+13
| | | | | Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string).
* merge: checkout default shouldn't clobber givenEdward Thomson2014-04-231-5/+3
|
* merge: default checkout strategy for should be SAFEEdward Thomson2014-04-231-1/+1
|
* Index locking and entry allocation changesRussell Belfer2014-04-171-5/+5
| | | | | | | | | | | | | | | | | This makes the lock management on the index a little bit broader, having a number of routines hold the lock across looking up the item to be modified and actually making the modification. Still not true thread safety, but more pure index modifications are now safe which allows the simple cases (such as starting up a diff while index modifications are underway) safe enough to get the snapshot without hitting allocation problems. As part of this, I simplified the allocation of index entries to use a flex array and just put the path at the end of the index entry. This makes every entry self-contained and makes it a little easier to feel sure that pointers to strings aren't being accidentally copied and freed while other references are still being held.
* Decouple index iterator sort from indexRussell Belfer2014-04-171-1/+1
| | | | | | | | This makes the index iterator honor the GIT_ITERATOR_IGNORE_CASE and GIT_ITERATOR_DONT_IGNORE_CASE flags without modifying the index data itself. To take advantage of this, I had to export a number of the internal index entry comparison functions. I also wrote some new tests to exercise the capability.
* Some vector utility tweaksRussell Belfer2014-04-171-2/+4
| | | | | This is just laying some groundwork for internal index changes that I'm working on.
* Capture conflict information in MERGE_MSG for revert and mergeJacques Germishuys2014-04-141-0/+1
|
* Introduce git_merge__extract_conflict_pathsJacques Germishuys2014-04-141-0/+41
|
* Const correctness!Jacques Germishuys2014-04-031-1/+1
|
* Introduce git_merge_head_idEdward Thomson2014-03-311-0/+8
|
* Free temporary merge indexEdward Thomson2014-03-261-2/+1
|
* Merge pull request #2183 from ethomson/merge_refactorVicent Marti2014-03-241-205/+195
|\ | | | | Refactor the `git_merge` API
| * UNBORN implies FAST_FORWARDEdward Thomson2014-03-201-1/+1
| |
| * Introduce GIT_MERGE_ANALYSIS_UNBORNEdward Thomson2014-03-201-10/+25
| |
| * git_merge_status -> git_merge_analysisEdward Thomson2014-03-201-5/+5
| |
| * Remove `git_merge_result` as it's now unnecessaryEdward Thomson2014-03-201-47/+1
| |
| * Update git_merge_tree_opts to git_merge_optionsEdward Thomson2014-03-201-24/+24
| |
| * Change signature of `git_merge` to take merge and checkout optsEdward Thomson2014-03-201-38/+26
| |
| * Remove fastforward / uptodate from `git_merge`Edward Thomson2014-03-201-82/+23
| |
| * Add `git_merge_status` to provide info about an upcoming mergeEdward Thomson2014-03-201-9/+74
| |
| * Introduce git_merge_file for consumersEdward Thomson2014-03-201-14/+41
| |
* | revwalk: don't try to find merge bases when there can be noneCarlos Martín Nieto2014-03-201-0/+6
|/ | | | | | | | | | | | | | | | | | | As a way to speed up the cases where we need to hide some commits, we find out what the merge bases are so we know to stop marking commits as uninteresting and avoid walking down a potentially very large amount of commits which we will never see. There are however two oversights in current code. The merge-base finding algorithm fails to recognize that if it is only given one commit, there can be no merge base. It instead walks down the whole ancestor chain needlessly. Make it return an empty list immediately in this situation. The revwalk does not know whether the user has asked to hide any commits at all. In situation where the user pushes multiple commits but doesn't hide any, the above fix wouldn't do the trick. Keep track of whether the user wants to hide any commits and only run the merge-base finding algorithm when it's needed.
* Implement git_merge_base_octopusAimeast2014-03-181-0/+25
|
* Added function-based initializers for every options struct.Matthew Bowen2014-03-051-0/+24
| | | | The basic structure of each function is courtesy of arrbee.
* Address PR commentsRussell Belfer2014-02-201-1/+1
| | | | | | | * Make GIT_INLINE an internal definition so it cannot be used in public headers * Fix language in CONTRIBUTING * Make index caps API use signed instead of unsigned values
* Merge pull request #2100 from libgit2/rb/update-pqueueVicent Marti2014-02-071-7/+8
|\ | | | | Replace priority queue code with implementation from hashsig
| * Replace pqueue with code from hashsig heapRussell Belfer2014-02-031-7/+8
| | | | | | | | | | | | | | | | | | | | | | I accidentally wrote a separate priority queue implementation when I was working on file rename detection as part of the file hash signature calculation code. To simplify licensing terms, I just adapted that to a general purpose priority queue and replace the old priority queue implementation that was borrowed from elsewhere. This also removes parts of the COPYING document that no longer apply to libgit2.
* | Remove unused pointer assignmentEdward Thomson2014-02-031-1/+1
| |
* | Merge wd validation tests against index not HEADEdward Thomson2014-02-031-6/+3
|/ | | | | | | | | | | | Validating the workdir should not compare HEAD to working directory - this is both inefficient (as it ignores the cache) and incorrect. If we had legitimately allowed changes in the index (identical to the merge result) then comparing HEAD to workdir would reject these changes as different. Further, this will identify files that were filtered strangely as modified, while testing with the cache would prevent this. Also, it's stupid slow.
* Two-phase index mergingEdward Thomson2014-01-291-5/+14
| | | | | | | | | When three-way merging indexes, we previously changed each path as we read them, which would lead to us adding an index entry for 'foo', then removing an index entry for 'foo/file'. With the new index requirements, this is not allowed. Removing entries in the merged index, then adding them, resolves this. In the previous example, we now remove 'foo/file' before adding 'foo'.
* merge: rename _oid() -> id()Carlos Martín Nieto2014-01-251-3/+3
| | | | Following the rest of the series, use 'id' when refering to the value.
* diff: rename the file's 'oid' to 'id'Carlos Martín Nieto2014-01-251-1/+1
| | | | In the same vein as the previous commits in this series.
* index: rename an entry's id to 'id'Carlos Martín Nieto2014-01-251-13/+13
| | | | This was not converted when we converted the rest, so do it now.
* Merge submodulesEdward Thomson2014-01-201-4/+10
|
* Remove the "merge none" flagEdward Thomson2014-01-201-11/+6
| | | | | | | The "merge none" (don't automerge) flag was only to aide in merge trivial tests. We can easily determine whether merge trivial resulted in a trivial merge or an automerge by examining the REUC after automerge has completed.
* Introduce diff3 mode for checking out conflictsEdward Thomson2014-01-201-5/+19
|
* Don't try to merge binary filesEdward Thomson2014-01-201-0/+43
|
* merge_file should use more aggressive levelsEdward Thomson2014-01-201-7/+10
| | | | | | | | | | | The default merge_file level was XDL_MERGE_MINIMAL, which will produce conflicts where there should not be in the case where both sides were changed identically. Change the defaults to be more aggressive (XDL_MERGE_ZEALOUS) which will more aggressively compress non-conflicts. This matches git.git's defaults. Increase testing around reverting a previously reverted commit to illustrate this problem.
* Merge pull request #1986 from libgit2/rb/error-handling-cleanupsVicent Marti2013-12-131-19/+11
|\ | | | | Clean up some error handling and change callback error behavior
| * Cleanups, renames, and leak fixesRussell Belfer2013-12-121-1/+1
| | | | | | | | | | | | | | | | | | This renames git_vector_free_all to the better git_vector_free_deep and also contains a couple of memory leak fixes based on valgrind checks. The fixes are specifically: failure to free global dir path variables when not compiled with threading on and failure to free filters from the filter registry that had not be initialized fully.
| * One more rename/cleanup for callback err functionsRussell Belfer2013-12-111-1/+1
| |
| * Some callback error check style cleanupsRussell Belfer2013-12-111-1/+3
| | | | | | | | I find this easier to read...