Commit 0929280
committed
merge-ort: add a new mergeability_only option
Git Forges may be interested in whether two branches can be merged while
not being interested in what the resulting merge tree is nor which files
conflicted. For such cases, add a new mergeability_only option. This
option allows the merge machinery to, in the outer layer of the merge:
* exit upon first conflict
* avoid writing merged blobs/trees to the object store
Note that since the recursive merge of merge bases (corresponding to
call_depth > 0) can conflict without the outer final merge (corresponding
to call_depth == 0) conflicting, we can't short-circuit nor avoid
writing merges blobs/trees to the object store during those inner
merges.
There is a further potential micro-optimization here. rename/rename
conflicts have the potential for nested conflicts even without recursive
merges; because of that, handle_content_merge() can be called multiple
times and is done via different paths. Currently, we only exit early in
process_entries(), which is where the final handle_content_merge() is
invoked. Since rename/rename conflicts have an additional earlier
handle_content_merge() call that can be invoked from
detect_and_process_renames() (via process_renames()), we could
potentially exit earlier at that call point. However, rename/rename
conflicts are exceptionally rare, and feeding the extra logic through
didn't seem worth it. (And, if we don't exit early at that point, then
any resulting blobs need to be written to the store so that subsequent
handle_content_merge() calls trying to use the blob don't throw
exceptions.)
Signed-off-by: Elijah Newren <[email protected]>1 parent 6c0bd1f commit 0929280
2 files changed
+32
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2127 | 2127 | | |
2128 | 2128 | | |
2129 | 2129 | | |
| 2130 | + | |
2130 | 2131 | | |
2131 | 2132 | | |
2132 | 2133 | | |
| |||
2214 | 2215 | | |
2215 | 2216 | | |
2216 | 2217 | | |
2217 | | - | |
| 2218 | + | |
2218 | 2219 | | |
2219 | 2220 | | |
2220 | 2221 | | |
| |||
2897 | 2898 | | |
2898 | 2899 | | |
2899 | 2900 | | |
| 2901 | + | |
2900 | 2902 | | |
2901 | 2903 | | |
2902 | 2904 | | |
| |||
2947 | 2949 | | |
2948 | 2950 | | |
2949 | 2951 | | |
| 2952 | + | |
2950 | 2953 | | |
2951 | 2954 | | |
2952 | 2955 | | |
| |||
3061 | 3064 | | |
3062 | 3065 | | |
3063 | 3066 | | |
| 3067 | + | |
3064 | 3068 | | |
3065 | 3069 | | |
3066 | 3070 | | |
| |||
3080 | 3084 | | |
3081 | 3085 | | |
3082 | 3086 | | |
| 3087 | + | |
3083 | 3088 | | |
3084 | 3089 | | |
3085 | 3090 | | |
| |||
3931 | 3936 | | |
3932 | 3937 | | |
3933 | 3938 | | |
| 3939 | + | |
| 3940 | + | |
3934 | 3941 | | |
3935 | 3942 | | |
3936 | | - | |
| 3943 | + | |
| 3944 | + | |
3937 | 3945 | | |
3938 | 3946 | | |
3939 | 3947 | | |
| |||
4231 | 4239 | | |
4232 | 4240 | | |
4233 | 4241 | | |
| 4242 | + | |
| 4243 | + | |
4234 | 4244 | | |
4235 | 4245 | | |
4236 | 4246 | | |
4237 | 4247 | | |
| 4248 | + | |
4238 | 4249 | | |
4239 | 4250 | | |
4240 | 4251 | | |
| |||
4395 | 4406 | | |
4396 | 4407 | | |
4397 | 4408 | | |
| 4409 | + | |
| 4410 | + | |
4398 | 4411 | | |
4399 | 4412 | | |
4400 | 4413 | | |
| |||
4454 | 4467 | | |
4455 | 4468 | | |
4456 | 4469 | | |
| 4470 | + | |
| 4471 | + | |
| 4472 | + | |
| 4473 | + | |
| 4474 | + | |
| 4475 | + | |
4457 | 4476 | | |
4458 | 4477 | | |
4459 | 4478 | | |
| |||
4468 | 4487 | | |
4469 | 4488 | | |
4470 | 4489 | | |
4471 | | - | |
| 4490 | + | |
| 4491 | + | |
4472 | 4492 | | |
4473 | 4493 | | |
4474 | 4494 | | |
| |||
4715 | 4735 | | |
4716 | 4736 | | |
4717 | 4737 | | |
| 4738 | + | |
| 4739 | + | |
4718 | 4740 | | |
4719 | 4741 | | |
4720 | 4742 | | |
| |||
5171 | 5193 | | |
5172 | 5194 | | |
5173 | 5195 | | |
5174 | | - | |
5175 | | - | |
5176 | | - | |
5177 | | - | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
5178 | 5202 | | |
5179 | 5203 | | |
5180 | 5204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
0 commit comments