<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/apply.c, branch gitk-resize-error</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=gitk-resize-error</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=gitk-resize-error'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2022-01-10T19:52:56Z</updated>
<entry>
<title>Merge branch 'ja/i18n-similar-messages'</title>
<updated>2022-01-10T19:52:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-01-10T19:52:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c17de5a505a2da23fcbfefdc8b0aad3f045a510f'/>
<id>urn:sha1:c17de5a505a2da23fcbfefdc8b0aad3f045a510f</id>
<content type='text'>
Similar message templates have been consolidated so that
translators need to work on fewer number of messages.

* ja/i18n-similar-messages:
  i18n: turn even more messages into "cannot be used together" ones
  i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"
  i18n: factorize "--foo outside a repository"
  i18n: refactor "unrecognized %(foo) argument" strings
  i18n: factorize "no directory given for --foo"
  i18n: factorize "--foo requires --bar" and the like
  i18n: tag.c factorize i18n strings
  i18n: standardize "cannot open" and "cannot read"
  i18n: turn "options are incompatible" into "cannot be used together"
  i18n: refactor "%s, %s and %s are mutually exclusive"
  i18n: refactor "foo and bar are mutually exclusive"
</content>
</entry>
<entry>
<title>Merge branch 'jz/apply-3-corner-cases'</title>
<updated>2022-01-10T19:52:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-01-10T19:52:53Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=bc61dbac770923a96e2007c3de4027c5d11c6d41'/>
<id>urn:sha1:bc61dbac770923a96e2007c3de4027c5d11c6d41</id>
<content type='text'>
"git apply --3way" bypasses the attempt to do a three-way
application in more cases to address the regression caused by the
recent change to use direct application as a fallback.

* jz/apply-3-corner-cases:
  git-apply: skip threeway in add / rename cases
</content>
</entry>
<entry>
<title>i18n: factorize "--foo outside a repository"</title>
<updated>2022-01-05T21:31:00Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2022-01-05T20:02:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=59bb00090eb63434d46ee0ffa37482ba419aebb1'/>
<id>urn:sha1:59bb00090eb63434d46ee0ffa37482ba419aebb1</id>
<content type='text'>
Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Reviewed-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: turn "options are incompatible" into "cannot be used together"</title>
<updated>2022-01-05T21:29:23Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2022-01-05T20:02:16Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=12909b6b8a4a51e9d2b46610be4f93c782949c80'/>
<id>urn:sha1:12909b6b8a4a51e9d2b46610be4f93c782949c80</id>
<content type='text'>
Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Reviewed-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-apply: skip threeway in add / rename cases</title>
<updated>2021-12-20T20:39:45Z</updated>
<author>
<name>Jerry Zhang</name>
<email>jerry@skydio.com</email>
</author>
<published>2021-12-17T23:29:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=34d607032c0db6a6c68754e7a339c3caf08d6a79'/>
<id>urn:sha1:34d607032c0db6a6c68754e7a339c3caf08d6a79</id>
<content type='text'>
Certain invocations of "git apply --3way" will attempt threeway and
fail due to missing objects, even though git is able to fall back on
apply_fragments and apply the patch successfully with a return value
of 0. To fix, return early from try_threeway() in the following
cases:

 - When the patch is a rename and no lines have changed. In this
   case, "git diff" doesn't record the blob info, so 3way is neither
   possible nor necessary.

 - When the patch is an addition and there is no add/add conflict,
   i.e. direct_to_threeway is false. In this case, threeway will
   fail since the preimage is not in cache, but isn't necessary
   anyway since there is no conflict.

This fixes a few unecessary error messages when applying these kinds
of patches with --3way.

It also fixes a reported issue where applying a concatenation of
several git produced patches will fail when those patches involve a
deletion followed by creation of the same file.  Add a test for this
case too.  (test provided by &lt;i@zenithal.me&gt;)

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: add --allow-empty flag</title>
<updated>2021-12-13T22:30:25Z</updated>
<author>
<name>Jerry Zhang</name>
<email>jerry@skydio.com</email>
</author>
<published>2021-12-13T22:03:27Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=324eb77ee76277be99bdc54ef0b74ff30f5f567b'/>
<id>urn:sha1:324eb77ee76277be99bdc54ef0b74ff30f5f567b</id>
<content type='text'>
Some users or scripts will pipe "git diff"
output to "git apply" when replaying diffs
or commits. In these cases, they will rely
on the return value of "git apply" to know
whether the diff was applied successfully.

However, for empty commits, "git apply" will
fail. This complicates scripts since they
have to either buffer the diff and check
its length, or run diff again with "exit-code",
essentially doing the diff twice.

Add the "--allow-empty" flag to "git apply"
which allows it to handle both empty diffs
and empty commits created by "git format-patch
--always" by doing nothing and returning 0.

Add tests for both with and without --allow-empty.

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: add --quiet flag</title>
<updated>2021-12-13T22:30:22Z</updated>
<author>
<name>Jerry Zhang</name>
<email>jerry@skydio.com</email>
</author>
<published>2021-12-13T22:03:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c21b8ae857d0d58b67ca77384ccc1880d834c2d5'/>
<id>urn:sha1:c21b8ae857d0d58b67ca77384ccc1880d834c2d5</id>
<content type='text'>
Replace OPT_VERBOSE with OPT_VERBOSITY.

This adds a --quiet flag to "git apply" so
the user can turn down the verbosity.

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 'jc/trivial-threeway-binary-merge'</title>
<updated>2021-09-15T20:15:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-15T20:15:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c76fcf3e46a86d389739b7ee94b3d4faa351af84'/>
<id>urn:sha1:c76fcf3e46a86d389739b7ee94b3d4faa351af84</id>
<content type='text'>
The "git apply -3" code path learned not to bother the lower level
merge machinery when the three-way merge can be trivially resolved
without the content level merge.

* jc/trivial-threeway-binary-merge:
  apply: resolve trivial merge without hitting ll-merge with "--3way"
</content>
</entry>
<entry>
<title>apply: resolve trivial merge without hitting ll-merge with "--3way"</title>
<updated>2021-09-05T22:39:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-05T19:06:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=57f183b698ca4f967266577687f09b09a79f0b8c'/>
<id>urn:sha1:57f183b698ca4f967266577687f09b09a79f0b8c</id>
<content type='text'>
The ll_binary_merge() function assumes that the ancestor blob is
different from either side of the new versions, and always fails
the merge in conflict, unless -Xours or -Xtheirs is in effect.

The normal "merge" machineries all resolve the trivial cases
(e.g. if our side changed while their side did not, the result
is ours) without triggering the file-level merge drivers, so the
assumption is warranted.

The code path in "git apply --3way", however, does not check for
the trivial three-way merge situation and always calls the
file-level merge drivers.  This used to be perfectly OK back
when we always first attempted a straight patch application and
used the three-way code path only as a fallback.  Any binary
patch that can be applied as a trivial three-way merge (e.g. the
patch is based exactly on the version we happen to have) would
always cleanly apply, so the ll_binary_merge() that is not
prepared to see the trivial case would not have to handle such a
case.

This no longer is true after we made "--3way" to mean "first try
three-way and then fall back to straight application", and made
"git apply -3" on a binary patch that is based on the current
version no longer apply.

Teach "git apply -3" to first check for the trivial merge cases
and resolve them without hitting the file-level merge drivers.

Signed-off-by: Jerry Zhang &lt;jerry@skydio.com&gt;
[jc: stolen tests from Jerry's patch]
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/apply-binary-hunk-parsing-fix'</title>
<updated>2021-08-30T23:06:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-08-30T23:06:04Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7e3b9d15344fa5a09fe5c70270c9f2c2f75d0f90'/>
<id>urn:sha1:7e3b9d15344fa5a09fe5c70270c9f2c2f75d0f90</id>
<content type='text'>
"git apply" miscounted the bytes and failed to read to the end of
binary hunks.

* jk/apply-binary-hunk-parsing-fix:
  apply: keep buffer/size pair in sync when parsing binary hunks
</content>
</entry>
</feed>
