<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/apply.c, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-05-07T03:47:38Z</updated>
<entry>
<title>Merge branch 'jz/apply-3way-first-message-fix'</title>
<updated>2021-05-07T03:47:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-05-07T03:47:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d99f31ddafb064795d1d8f9b9bd930296f7069e'/>
<id>urn:sha1:6d99f31ddafb064795d1d8f9b9bd930296f7069e</id>
<content type='text'>
When we swapped the order of --3way fallback, we forgot to adjust
the message we give when the first method fails and the second
method is attempted (which used to be "direct application failed
hence we try 3way", now it is the other way around).

* jz/apply-3way-first-message-fix:
  apply: adjust messages to account for --3way changes
</content>
</entry>
<entry>
<title>apply: adjust messages to account for --3way changes</title>
<updated>2021-04-29T03:27:45Z</updated>
<author>
<name>Jerry Zhang</name>
<email>jerry@skydio.com</email>
</author>
<published>2021-04-29T02:35:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=526705fd3d14a38646a12235ee385dcc0ffc7321'/>
<id>urn:sha1:526705fd3d14a38646a12235ee385dcc0ffc7321</id>
<content type='text'>
"git apply" specifically calls out when it is falling back to 3way
merge application.  Since the order changed to preferring 3way and
falling back to direct application, continue that behavior by
printing whenever 3way fails and git has to fall back.

Signed-off-by: Jerry Zhang &lt;jerry@skydio.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-apply: allow simultaneous --cached and --3way options</title>
<updated>2021-04-08T05:20:33Z</updated>
<author>
<name>Jerry Zhang</name>
<email>jerry@skydio.com</email>
</author>
<published>2021-04-08T02:13:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0c2a37ac2b9338c3a93340cbcbab69690da4df0'/>
<id>urn:sha1:c0c2a37ac2b9338c3a93340cbcbab69690da4df0</id>
<content type='text'>
"git apply" does not allow "--cached" and "--3way" to be used
together, since "--3way" writes conflict markers into the working
tree.

Allow "git apply" to accept "--cached" and "--3way" at the same
time.  When a single file auto-resolves cleanly, the result is
placed in the index at stage #0 and the command exits with 0 status.

For a file that has a conflict which cannot be cleanly
auto-resolved, the original contents from common ancestor (stage
conflict at the content level, and the command exists with non-zero
status, because there is no place (like the working tree) to leave a
half-resolved merge for the user to resolve.

The user can use `git diff` to view the contents of the conflict, or
`git checkout -m -- .` to regenerate the conflict markers in the
working directory.

Don't attempt rerere in this case since it depends on conflict
markers written to file for its database storage and lookup. There
would be two main changes required to get rerere working:

1. Allow the rerere api to accept in memory object rather than
   files, which would allow us to pass in the conflict markers
   contained in the result from ll_merge().

2. Rerere can't write to the working directory, so it would have to
   apply the result to cache stage #0 directly. A flag would be
   needed to control this.

Signed-off-by: Jerry Zhang &lt;jerry@skydio.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-apply: try threeway first when "--3way" is used</title>
<updated>2021-04-07T00:11:41Z</updated>
<author>
<name>Jerry Zhang</name>
<email>jerry@skydio.com</email>
</author>
<published>2021-04-06T23:25:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=923cd87ac8550a8e277bfeb19198a11b6a8ed854'/>
<id>urn:sha1:923cd87ac8550a8e277bfeb19198a11b6a8ed854</id>
<content type='text'>
The apply_fragments() method of "git apply"
can silently apply patches incorrectly if
a file has repeating contents. In these
cases a three-way merge is capable of applying
it correctly in more situations, and will
show a conflict rather than applying it
incorrectly. However, because the patches
apply "successfully" using apply_fragments(),
git will never fall back to the merge, even
if the "--3way" flag is used, and the user has
no way to ensure correctness by forcing the
three-way merge method.

Change the behavior so that when "--3way" is used,
git will always try the three-way merge first and
will only fall back to apply_fragments() in cases
where blobs are not available or some other error
(but not in the case of a merge conflict).

Since user-facing results will be different,
this has backwards compatibility implications
for users depending on the old behavior. In
addition, the three-way merge will be slower
than direct patch application.

Signed-off-by: Jerry Zhang &lt;jerry@skydio.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mt/parallel-checkout-part-1'</title>
<updated>2021-04-02T21:43:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-02T21:43:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c47679d0405f134703fcae0f8f0b7ef82ecf96d5'/>
<id>urn:sha1:c47679d0405f134703fcae0f8f0b7ef82ecf96d5</id>
<content type='text'>
Preparatory API changes for parallel checkout.

* mt/parallel-checkout-part-1:
  entry: add checkout_entry_ca() taking preloaded conv_attrs
  entry: move conv_attrs lookup up to checkout_entry()
  entry: extract update_ce_after_write() from write_entry()
  entry: make fstat_output() and read_blob_entry() public
  entry: extract a header file for entry.c functions
  convert: add classification for conv_attrs struct
  convert: add get_stream_filter_ca() variant
  convert: add [async_]convert_to_working_tree_ca() variants
  convert: make convert_attrs() and convert structs public
</content>
</entry>
<entry>
<title>entry: extract a header file for entry.c functions</title>
<updated>2021-03-23T17:34:05Z</updated>
<author>
<name>Matheus Tavares</name>
<email>matheus.bernardino@usp.br</email>
</author>
<published>2021-03-23T14:19:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d052cc038270d1231a245d7ac6d60559123464d3'/>
<id>urn:sha1:d052cc038270d1231a245d7ac6d60559123464d3</id>
<content type='text'>
The declarations of entry.c's public functions and structures currently
reside in cache.h. Although not many, they contribute to the size of
cache.h and, when changed, cause the unnecessary recompilation of
modules that don't really use these functions. So let's move them to a
new entry.h header. While at it let's also move a comment related to
checkout_entry() from entry.c to entry.h as it's more useful to describe
the function there.

Original-patch-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Matheus Tavares &lt;matheus.bernardino@usp.br&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use CALLOC_ARRAY</title>
<updated>2021-03-14T00:00:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-03-13T16:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca56dadb4b65ccaeab809d80db80a312dc00941a'/>
<id>urn:sha1:ca56dadb4b65ccaeab809d80db80a312dc00941a</id>
<content type='text'>
Add and apply a semantic patch for converting code that open-codes
CALLOC_ARRAY to use it instead.  It shortens the code and infers the
element size automatically.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/unreachable-break'</title>
<updated>2020-12-18T23:15:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-18T23:15:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3517022568b0cbf2ada289e43c8c562b61132082'/>
<id>urn:sha1:3517022568b0cbf2ada289e43c8c562b61132082</id>
<content type='text'>
Code clean-up.

* ab/unreachable-break:
  style: do not "break" in switch() after "return"
</content>
</entry>
<entry>
<title>style: do not "break" in switch() after "return"</title>
<updated>2020-12-16T00:32:50Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2020-12-15T23:50:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=56f56ac50b932310c629832fad256e624ca451e3'/>
<id>urn:sha1:56f56ac50b932310c629832fad256e624ca451e3</id>
<content type='text'>
Remove this unreachable code. It was found by SunCC, it's found by a
non-fatal warning emitted by SunCC. It's one of the things it's more
vehement about than GCC &amp; Clang.

It complains about a lot of other similarly unreachable code, e.g. a
BUG(...) without a "return", and a "return 0" after a long if/else,
both of whom have "return" statements. Those are also genuine
redundancies to a compiler, but arguably make the code a bit easier to
read &amp; less fragile to maintain.

These return/break cases are just unnecessary however, and as seen
here the surrounding code just did a plain "return" without a "break"
already.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mt/do-not-use-scld-in-working-tree'</title>
<updated>2020-12-08T23:11:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-08T23:11:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9b3b4adb3fc586d14bbe2bfa7ba5f682a87e903d'/>
<id>urn:sha1:9b3b4adb3fc586d14bbe2bfa7ba5f682a87e903d</id>
<content type='text'>
"git apply" adjusted the permission bits of working-tree files and
directories according core.sharedRepository setting by mistake and
for a long time, which has been corrected.

* mt/do-not-use-scld-in-working-tree:
  apply: don't use core.sharedRepository to create working tree files
</content>
</entry>
</feed>
