summaryrefslogtreecommitdiff
path: root/src/merge.c
Commit message (Collapse)AuthorAgeFilesLines
* merge: actually increment the counts, not the pointersCarlos Martín Nieto2015-06-101-2/+2
| | | | | | | | `merge_diff_list_count_candidates()` takes pointers to the source and target counts, but when it comes time to increase them, we're increasing the pointer, rather than the value it's pointing to. Dereference the value to increase.
* Rename GIT_EMERGECONFLICT to GIT_ECONFLICTEdward Thomson2015-05-291-1/+1
| | | | | | | | | | We do not error on "merge conflicts"; on the contrary, merge conflicts are a normal part of merging. We only error on "checkout conflicts", where a change exists in the index or the working directory that would otherwise be overwritten by performing the checkout. This *may* happen during merge (after the production of the new index that we're going to checkout) but it could happen during any checkout.
* introduce `git_index_entry_is_conflict`Edward Thomson2015-05-281-2/+2
| | | | | | | | | It's not always obvious the mapping between stage level and conflict-ness. More importantly, this can lead otherwise sane people to write constructs like `if (!git_index_entry_stage(entry))`, which (while technically correct) is unreadable. Provide a nice method to help avoid such messy thinking.
* merge: merge iteratorsEdward Thomson2015-05-111-20/+66
|
* Merge pull request #2967 from jacquesg/merge-whitespaceEdward Thomson2015-03-181-6/+10
|\ | | | | Allow merges of files (and trees) with whitespace problems/fixes
| * Collapse whitespace flags into git_merge_file_flags_tJacques Germishuys2015-03-161-5/+5
| |
| * Renamed git_merge_options 'flags' to 'tree_flags'Jacques Germishuys2015-03-161-2/+2
| |
| * Allow for merges with whitespace discrepanciesJacques Germishuys2015-03-161-4/+8
| |
* | PERF: In MERGE, lazily compute is_binaryJeff Hostetler2015-03-161-8/+19
|/
* Merge pull request #2831 from ethomson/merge_lockCarlos Martín Nieto2015-02-151-11/+14
|\ | | | | merge: lock index during the merge (not just checkout)
| * indexwriter: an indexwriter for repo operationsEdward Thomson2015-02-141-24/+10
| | | | | | | | | | Provide git_indexwriter_init_for_operation for the common locking pattern in merge, rebase, revert and cherry-pick.
| * merge: lock the index at the start of the mergeEdward Thomson2015-02-141-2/+19
| | | | | | | | | | | | | | | | | | | | Always lock the index when we begin the merge, before we write any of the metdata files. This prevents a race where another client may run a commit after we have written the MERGE_HEAD but before we have updated the index, which will produce a merge commit that is treesame to one parent. The merge will finish and update the index and the resultant commit would not be a merge at all.
* | Make our overflow check look more like gcc/clang'sEdward Thomson2015-02-131-5/+4
| | | | | | | | | | | | | | | | | | Make our overflow checking look more like gcc and clang's, so that we can substitute it out with the compiler instrinsics on platforms that support it. This means dropping the ability to pass `NULL` as an out parameter. As a result, the macros also get updated to reflect this as well.
* | allocations: test for overflow of requested sizeEdward Thomson2015-02-121-0/+2
|/ | | | | Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
* Merge branch 'pr/2740'Edward Thomson2015-01-141-7/+1
|\
| * Always use GIT_HASHSIG_SMART_WHITESPACE when diffing for mergesPierre-Olivier Latour2015-01-141-7/+1
| | | | | | | | git_merge_tree_flag_t cannot contain any GIT_DIFF_FIND_xxx flags so there's not point in checking for them
* | Plug some leaksJacques Germishuys2014-12-291-1/+3
|/
* s/git_merge_head/git_annotated_commitEdward Thomson2014-10-261-147/+39
| | | | | Rename git_merge_head to git_annotated_commit, as it becomes used in more operations than just merge.
* Introduce git_rebase to set up a rebase sessionEdward Thomson2014-10-261-24/+1
| | | | | | Introduce `git_rebase` to set up a rebase session that can then be continued. Immediately, only merge-type rebase is supported.
* Extract shared functionality.Arthur Schreiber2014-10-091-55/+41
|
* Add git_merge_bases_many.Arthur Schreiber2014-10-091-0/+67
|
* hashsig: Export as a `sys` headervmg/hashsigVicent Marti2014-10-011-1/+1
|
* Remove local unused index_repo variableJacques Germishuys2014-09-121-3/+1
|
* Only check for workdir conflicts if the index has merged filesJacques Germishuys2014-09-121-0/+10
| | | | | | Passing 0 as the length of the paths to check to git_diff_index_to_workdir results in all files being treated as conflicting, that is, all untracked or modified files in the worktree is reported as conflicting
* Merge pull request #2481 from libgit2/cmn/oidarrayVicent Marti2014-08-291-1/+53
|\ | | | | merge: expose multiple merge bases
| * 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 base: Correctly raise an error if a non-commit object is passed.Arthur Schreiber2014-08-251-1/+4
| |
* | Don't allow conflicts by defaultEdward Thomson2014-07-171-2/+1
|/
* 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
| |