summaryrefslogtreecommitdiff
path: root/src/merge.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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...
| * Remove converting user error to GIT_EUSERRussell Belfer2013-12-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
| * Add git_vector_free_allRussell Belfer2013-12-111-5/+1
| | | | | | | | | | | | There are a lot of places that we call git__free on each item in a vector and then call git_vector_free on the vector itself. This just wraps that up into one convenient helper function.
| * Further EUSER and error propagation fixesRussell Belfer2013-12-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This continues auditing all the places where GIT_EUSER is being returned and making sure to clear any existing error using the new giterr_user_cancel helper. As a result, places that relied on intercepting GIT_EUSER but having the old error preserved also needed to be cleaned up to correctly stash and then retrieve the actual error. Additionally, as I encountered places where error codes were not being propagated correctly, I tried to fix them up. A number of those fixes are included in the this commit as well.
| * Add config read fns with controlled error behaviorRussell Belfer2013-12-111-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds `git_config__lookup_entry` which will look up a key in a config and return either the entry or NULL if the key was not present. Optionally, it can either suppress all errors or can return them (although not finding the key is not an error for this function). Unlike other accessors, this does not normalize the config key string, so it must only be used when the key is known to be in normalized form (i.e. all lower-case before the first dot and after the last dot, with no invalid characters). This also adds three high-level helper functions to look up config values with no errors and a fallback value. The three functions are for string, bool, and int values, and will resort to the fallback value for any error that arises. They are: * `git_config__get_string_force` * `git_config__get_bool_force` * `git_config__get_int_force` None of them normalize the config `key` either, so they can only be used for internal cases where the key is known to be in normal format.
* | Validate struct versions in merge, revertEdward Thomson2013-12-121-0/+4
|/
* Clean up warningsEdward Thomson2013-12-091-2/+2
|
* Bare naked merge and rebaseEdward Thomson2013-12-031-0/+34
|
* clean up state metadata more consistentlyEdward Thomson2013-12-021-34/+12
|
* Introduce git_revert to revert a single commitEdward Thomson2013-12-021-8/+10
|
* Fix warningsRussell Belfer2013-11-131-1/+3
|
* Plug git_merge() related leaksnulltoken2013-11-051-0/+1
|
* merge branch into current, updating workdirEdward Thomson2013-11-051-18/+525
|
* move mode_t to filebuf_open instead of _commitEdward Thomson2013-11-041-8/+8
|
* merge: any non-zero return from the user is an errorCarlos Martín Nieto2013-10-301-1/+1
| | | | This fixes #1703.
* merge: reverse array and length parameter orderCarlos Martín Nieto2013-09-221-1/+1
| | | | Make it pair up with the one for commits. This fixes #1691.
* Fix some more memory leaks in error pathRémi Duraffort2013-07-151-1/+3
|
* Reorganize diff and add basic diff driverRussell Belfer2013-06-101-0/+2
| | | | | | | | | | | | | | | | | | This is a significant reorganization of the diff code to break it into a set of more clearly distinct files and to document the new organization. Hopefully this will make the diff code easier to understand and to extend. This adds a new `git_diff_driver` object that looks of diff driver information from the attributes and the config so that things like function content in diff headers can be provided. The full driver spec is not implemented in the commit - this is focused on the reorganization of the code and putting the driver hooks in place. This also removes a few #includes from src/repository.h that were overbroad, but as a result required extra #includes in a variety of places since including src/repository.h no longer results in pulling in the whole world.
* Make iterators use GIT_ITEROVER & smart advanceRussell Belfer2013-05-311-3/+12
| | | | | | | | | | | | | | | 1. internal iterators now return GIT_ITEROVER when you go past the last item in the iteration. 2. git_iterator_advance will "advance" to the first item in the iteration if it is called immediately after creating the iterator, which allows a simpler idiom for basic iteration. 3. if git_iterator_advance encounters an error reading data (e.g. a missing tree or an unreadable file), it returns the error but also attempts to advance past the invalid data to prevent an infinite loop. Updated all tests and internal usage of iterators to account for these new behaviors.
* merge setupEdward Thomson2013-05-171-40/+555
|
* Fix trailing whitespacesnulltoken2013-05-151-164/+163
|
* Merge pull request #1526 from arrbee/cleanup-error-return-without-msgVicent Martí2013-05-061-1/+2
|\ | | | | Make sure error messages are set for most error returns
| * Set error when no merge base is foundRussell Belfer2013-05-011-1/+2
| |
* | puns are not funny; type punning especially soEdward Thomson2013-05-021-6/+16
| |