<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/xdiff-interface.h, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-26T02:23:22Z</updated>
<entry>
<title>xdiff-interface: export comparing and hashing strings</title>
<updated>2017-10-26T02:23:22Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-10-25T18:49:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ec8274b8424f76bf998059e66facff1b241337e'/>
<id>urn:sha1:5ec8274b8424f76bf998059e66facff1b241337e</id>
<content type='text'>
This will turn out to be useful in a later patch.

xdl_recmatch is exported in xdiff/xutils.h, to be used by various
xdiff/*.c files, but not outside of xdiff/. This one makes it available
to the outside, too.

While at it, add documentation.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Convert read_mmblob to take struct object_id.</title>
<updated>2016-09-07T19:59:42Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2016-09-05T20:08:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d449347d080cd97a9d6dc029014383d4817e34bf'/>
<id>urn:sha1:d449347d080cd97a9d6dc029014383d4817e34bf</id>
<content type='text'>
Since all of its callers have been updated, convert read_mmblob to take
a pointer to struct object_id.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>xdiff: reject files larger than ~1GB</title>
<updated>2015-09-28T21:57:23Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-24T23:12:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dcd1742e56ebb944c4ff62346da4548e1e3be675'/>
<id>urn:sha1:dcd1742e56ebb944c4ff62346da4548e1e3be675</id>
<content type='text'>
The xdiff code is not prepared to handle extremely large
files. It uses "int" in many places, which can overflow if
we have a very large number of lines or even bytes in our
input files. This can cause us to produce incorrect diffs,
with no indication that the output is wrong. Or worse, we
may even underallocate a buffer whose size is the result of
an overflowing addition.

We're much better off to tell the user that we cannot diff
or merge such a large file. This patch covers both cases,
but in slightly different ways:

  1. For merging, we notice the large file and cleanly fall
     back to a binary merge (which is effectively "we cannot
     merge this").

  2. For diffing, we make the binary/text distinction much
     earlier, and in many different places. For this case,
     we'll use the xdi_diff as our choke point, and reject
     any diff there before it hits the xdiff code.

     This means in most cases we'll die() immediately after.
     That's not ideal, but in practice we shouldn't
     generally hit this code path unless the user is trying
     to do something tricky. We already consider files
     larger than core.bigfilethreshold to be binary, so this
     code would only kick in when that is circumvented
     (either by bumping that value, or by using a
     .gitattribute to mark a file as diffable).

     In other words, we can avoid being "nice" here, because
     there is already nice code that tries to do the right
     thing. We are adding the suspenders to the nice code's
     belt, so notice when it has been worked around (both to
     protect the user from malicious inputs, and because it
     is better to die() than generate bogus output).

The maximum size was chosen after experimenting with feeding
large files to the xdiff code. It's just under a gigabyte,
which leaves room for two obvious cases:

  - a diff3 merge conflict result on files of maximum size X
    could be 3*X plus the size of the markers, which would
    still be only about 3G, which fits in a 32-bit int.

  - some of the diff code allocates arrays of one int per
    record. Even if each file consists only of blank lines,
    then a file smaller than 1G will have fewer than 1G
    records, and therefore the int array will fit in 4G.

Since the limit is arbitrary anyway, I chose to go under a
gigabyte, to leave a safety margin (e.g., we would not want
to overflow by allocating "(records + 1) * sizeof(int)" or
similar.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>xdiff: remove emit_func() and xdi_diff_hunks()</title>
<updated>2012-05-09T21:08:42Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2012-05-09T20:24:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3319e606336c13ba6475d83e700ca53537cedfd9'/>
<id>urn:sha1:3319e606336c13ba6475d83e700ca53537cedfd9</id>
<content type='text'>
The functions are unused now, remove them.

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint-1.7.0' into maint</title>
<updated>2010-05-04T22:20:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-05-04T22:20:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b6f5d4664c9088636418653a61f600b5e3a9ea4'/>
<id>urn:sha1:6b6f5d4664c9088636418653a61f600b5e3a9ea4</id>
<content type='text'>
* maint-1.7.0:
  remove ecb parameter from xdi_diff_outf()
</content>
</entry>
<entry>
<title>remove ecb parameter from xdi_diff_outf()</title>
<updated>2010-05-04T22:19:14Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2010-05-04T20:41:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dfea79004c54bc96143386d6ac22de500ba4f747'/>
<id>urn:sha1:dfea79004c54bc96143386d6ac22de500ba4f747</id>
<content type='text'>
xdi_diff_outf() overrides the structure members of its last parameter,
ignoring any value that callers pass in.  It's no surprise then that all
callers pass a pointer to an uninitialized structure.  They also don't
read it after the call, so the parameter is neither used for input nor
for output.   Turn it into a local variable of xdi_diff_outf().

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refactor duplicated fill_mm() in checkout and merge-recursive</title>
<updated>2010-02-17T23:11:33Z</updated>
<author>
<name>Michael Lukashov</name>
<email>michael.lukashov@gmail.com</email>
</author>
<published>2010-02-16T23:42:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06b65939b083ba1b71043005bf83b4883e98264e'/>
<id>urn:sha1:06b65939b083ba1b71043005bf83b4883e98264e</id>
<content type='text'>
The following function is duplicated:

  fill_mm

Move it to xdiff-interface.c and rename it 'read_mmblob', as suggested
by Junio C Hamano.

Also, change parameters order for consistency with read_mmfile().

Signed-off-by: Michael Lukashov &lt;michael.lukashov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff: add xdiff_clear_find_func()</title>
<updated>2009-07-02T02:16:37Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-07-01T22:01:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8cfe5f1cd5dabc3a21bc792327747deefeff6dff'/>
<id>urn:sha1:8cfe5f1cd5dabc3a21bc792327747deefeff6dff</id>
<content type='text'>
xdiff_set_find_func() is used to set user defined regular expressions
for finding function signatures.  Add xdiff_clear_find_func(), which
frees the memory allocated by the former, making the API complete.

Also, use the new function in diff.c (the only call site of
xdiff_set_find_func()) to clean up after ourselves.

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add xdi_diff_hunks() for callers that only need hunk lengths</title>
<updated>2008-10-25T19:09:31Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2008-10-25T13:31:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=86295bb6bac1482d29650d1f77f19d8e7a7cc2fe'/>
<id>urn:sha1:86295bb6bac1482d29650d1f77f19d8e7a7cc2fe</id>
<content type='text'>
Based on a patch by Brian Downing, this uses the xdiff emit_func feature
to implement xdi_diff_hunks().  It's a function that calls a callback for
each hunk of a diff, passing its lengths.

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bc/master-diff-hunk-header-fix'</title>
<updated>2008-09-29T18:04:20Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2008-09-29T18:04:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9800c0df412869c7949935b61581b9361fc49bd1'/>
<id>urn:sha1:9800c0df412869c7949935b61581b9361fc49bd1</id>
<content type='text'>
* bc/master-diff-hunk-header-fix:
  Clarify commit error message for unmerged files
  Use strchrnul() instead of strchr() plus manual workaround
  Use remove_path from dir.c instead of own implementation
  Add remove_path: a function to remove as much as possible of a path
  git-submodule: Fix "Unable to checkout" for the initial 'update'
  Clarify how the user can satisfy stash's 'dirty state' check.
  t4018-diff-funcname: test syntax of builtin xfuncname patterns
  t4018-diff-funcname: test syntax of builtin xfuncname patterns
  make "git remote" report multiple URLs
  diff hunk pattern: fix misconverted "\{" tex macro introducers
  diff: fix "multiple regexp" semantics to find hunk header comment
  diff: use extended regexp to find hunk headers
  diff: use extended regexp to find hunk headers
  diff.*.xfuncname which uses "extended" regex's for hunk header selection
  diff.c: associate a flag with each pattern and use it for compiling regex
  diff.c: return pattern entry pointer rather than just the hunk header pattern

Conflicts:
	builtin-merge-recursive.c
	t/t7201-co.sh
	xdiff-interface.h
</content>
</entry>
</feed>
