-
Notifications
You must be signed in to change notification settings - Fork 27.6k
Comparing changes
Open a pull request
base repository: git/git
base: 83232e3
head repository: git/git
compare: 8c8e5bd
- 15 commits
- 19 files changed
- 1 contributor
Commits on Apr 8, 2019
-
Use 'unsigned short' for mode, like diff_filespec does
struct diff_filespec defines mode to be an 'unsigned short'. Several other places in the API which we'd like to interact with using a diff_filespec used a plain unsigned (or unsigned int). This caused problems when taking addresses, so switch to unsigned short. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 5ec1e72 - Browse repository at this point
Copy the full SHA 5ec1e72View commit details -
merge-recursive: rename merge_options argument from 'o' to 'opt'
The name 'o' was used for the merge_options struct pointer taken by many functions, but in a few places it was named 'opt'. Several functions that didn't need merge_options instead used 'o' for a diff_filespec argument or local. Some functions needed both an inconsistently either renamed the merge_options to 'opt' or the diff_filespec to 'one'. I want to remove the weird split in the codebase between using a diff_filespec and a pair of (oid,mode) values in favor of using a diff_filespec everywhere, but that dramatically increases the number of cases where we want to use 'o' as a diff_filespec. Rename the merge_options argument to 'opt' to make room. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 259ccb6 - Browse repository at this point
Copy the full SHA 259ccb6View commit details -
merge-recursive: rename diff_filespec 'one' to 'o'
In the previous commit, we noted that several places throughout merge recursive both had a reason to use 'o'; some for a merge_options struct, and others for a diff_filespec struct. Some places had both, forcing one of the two to be renamed, though the choice was inconsistent. Now that the merge_options struct has been renamed to 'opt' everywhere, we can replace the few places that used 'one' for the diff_filespec to 'o'. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for e3de888 - Browse repository at this point
Copy the full SHA e3de888View commit details -
merge-recursive: rename locals 'o' and 'a' to 'obuf' and 'abuf'
Since we want to replace oid,mode pairs with a single diff_filespec, we will soon want to be able to use the names 'o', 'a', and 'b' for the three different file versions. Rename some local variables in blob_unchanged() that would otherwise conflict. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 93a02c5 - Browse repository at this point
Copy the full SHA 93a02c5View commit details -
merge-recursive: use 'ci' for rename_conflict_info variable name
We used a couple different names, but used 'ci' the most. Use the same variable name throughout for a little extra consistency. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 043622b - Browse repository at this point
Copy the full SHA 043622bView commit details -
merge-recursive: move some struct declarations together
These structs are related and reference each other, so move them together to make it easier for folks to determine what they hold and what their purpose is. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 967d6be - Browse repository at this point
Copy the full SHA 967d6beView commit details -
merge-recursive: shrink rename_conflict_info
The rename_conflict_info struct used both a pair and a stage_data which were taken from a rename struct. Just use the original rename struct. This will also allow us to start making other simplifications to the code. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for e9cd1b5 - Browse repository at this point
Copy the full SHA e9cd1b5View commit details -
merge-recursive: remove ren[12]_other fields from rename_conflict_info
The ren1_other and ren2_other fields were synthesized from information in ren1->src_entry and ren2->src_entry. Since we already have the necessary information in ren1 and ren2, just use those. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 3f9c92e - Browse repository at this point
Copy the full SHA 3f9c92eView commit details -
merge-recursive: track branch where rename occurred in rename struct
We previously tracked the branch associated with a rename in a separate field in rename_conflict_info, but since it is directly associated with the rename it makes more sense to move it into the rename struct. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for c336ab8 - Browse repository at this point
Copy the full SHA c336ab8View commit details -
merge-recursive: cleanup handle_rename_* function signatures
Instead of passing various bits and pieces of 'ci', just pass it directly. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for e2d563d - Browse repository at this point
Copy the full SHA e2d563dView commit details -
merge-recursive: switch from (oid,mode) pairs to a diff_filespec
There was a significant inconsistency in the various parts of the API used in merge-recursive; many places used a pair of (oid, mode) to track file version/contents, while other parts used a diff_filespec (which have an oid and mode embedded in it). This inconsistency caused lots of places to need to pack and unpack data to call into other functions. This has been the subject of some past cleanups (see e.g. commit 0270a07 ("merge-recursive: remove final remaining caller of merge_file_one()", 2018-09-19)), but let's just remove the underlying mess altogether by switching to use diff_filespec. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 8daec1d - Browse repository at this point
Copy the full SHA 8daec1dView commit details -
t6043: fix copied test description to match its purpose
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for e0612a1 - Browse repository at this point
Copy the full SHA e0612a1View commit details -
merge-recursive: track information associated with directory renames
Directory rename detection previously silently applied. In order to allow printing information about paths that changed or printing a conflict notification (and only doing so near other potential conflict messages associated with the paths), save this information inside the rename struct for later use. A subsequent patch will make use of the additional information. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for 6d169fd - Browse repository at this point
Copy the full SHA 6d169fdView commit details -
merge-recursive: give callers of handle_content_merge() access to con…
…tents Pass a merge_file_info struct to handle_content_merge() so that the callers can access the oid and mode of the result afterward. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Configuration menu - View commit details
-
Copy full SHA for e62d112 - Browse repository at this point
Copy the full SHA e62d112View commit details -
merge-recursive: switch directory rename detection default
When all of x/a, x/b, and x/c have moved to z/a, z/b, and z/c on one branch, there is a question about whether x/d added on a different branch should remain at x/d or appear at z/d when the two branches are merged. There are different possible viewpoints here: A) The file was placed at x/d; it's unrelated to the other files in x/ so it doesn't matter that all the files from x/ moved to z/ on one branch; x/d should still remain at x/d. B) x/d is related to the other files in x/, and x/ was renamed to z/; therefore x/d should be moved to z/d. Since there was no ability to detect directory renames prior to git-2.18, users experienced (A) regardless of context. Choice (B) was implemented in git-2.18, with no option to go back to (A), and has been in use since. However, one user reported that the merge results did not match their expectations, making the change of default problematic, especially since there was no notice printed when directory rename detection moved files. Note that there is also a third possibility here: C) There are different answers depending on the context and content that cannot be determined by git, so this is a conflict. Use a higher stage in the index to record the conflict and notify the user of the potential issue instead of silently selecting a resolution for them. Add an option for users to specify their preference for whether to use directory rename detection, and default to (C). Even when directory rename detection is on, add notice messages about files moved into new directories. As a sidenote, x/d did not have to be a new file here; it could have already existed at some other path and been renamed to x/d, with directory rename detection just renaming it again to z/d. Thus, it's not just new files, but also a modification to all rename types (normal renames, rename/add, rename/delete, rename/rename(1to1), rename/rename(1to2), and rename/rename(2to1)). Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>Configuration menu - View commit details
-
Copy full SHA for 8c8e5bd - Browse repository at this point
Copy the full SHA 8c8e5bdView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 83232e3...8c8e5bd