<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/patch_parse.c, branch v0.26.2</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>patch_parse: check if advancing over header newline succeeds</title>
<updated>2017-03-21T14:48:16+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-03-20T08:35:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=723bdf48641736ece6a03032bae514ef28979dfe'/>
<id>723bdf48641736ece6a03032bae514ef28979dfe</id>
<content type='text'>
While parsing patch header lines, we iterate over each line and check if
the line has trailing garbage. What we do not check though is that the
line is actually a line ending with a trailing newline.

Fix this by checking the return code of `parse_advance_expected_str`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While parsing patch header lines, we iterate over each line and check if
the line has trailing garbage. What we do not check though is that the
line is actually a line ending with a trailing newline.

Fix this by checking the return code of `parse_advance_expected_str`.
</pre>
</div>
</content>
</entry>
<entry>
<title>patch_parse: fix parsing minimal trailing diff line</title>
<updated>2017-03-14T12:09:13+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-03-14T08:39:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=ad5a909cfbb07541e3e2548313043cc3f3a0918a'/>
<id>ad5a909cfbb07541e3e2548313043cc3f3a0918a</id>
<content type='text'>
In a diff, the shortest possible hunk with a modification (that is, no
deletion) results from a file with only one line with a single character
which is removed. Thus the following hunk

    @@ -1 +1 @@
    -a
    +

is the shortest valid hunk modifying a line. The function parsing the
hunk body though assumes that there must always be at least 4 bytes
present to make up a valid hunk, which is obviously wrong in this case.
The absolute minimum number of bytes required for a modification is
actually 2 bytes, that is the "+" and the following newline. Note: if
there is no trailing newline, the assumption will not be offended as the
diff will have a line "\ No trailing newline" at its end.

This patch fixes the issue by lowering the amount of bytes required.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a diff, the shortest possible hunk with a modification (that is, no
deletion) results from a file with only one line with a single character
which is removed. Thus the following hunk

    @@ -1 +1 @@
    -a
    +

is the shortest valid hunk modifying a line. The function parsing the
hunk body though assumes that there must always be at least 4 bytes
present to make up a valid hunk, which is obviously wrong in this case.
The absolute minimum number of bytes required for a modification is
actually 2 bytes, that is the "+" and the following newline. Note: if
there is no trailing newline, the assumption will not be offended as the
diff will have a line "\ No trailing newline" at its end.

This patch fixes the issue by lowering the amount of bytes required.
</pre>
</div>
</content>
</entry>
<entry>
<title>patch_parse: fix memory leak</title>
<updated>2016-11-15T12:33:05+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-11-15T12:33:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=613381fc1461514fdbb1518799bcee0345fdece6'/>
<id>613381fc1461514fdbb1518799bcee0345fdece6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>common: use PRIuZ for size_t in `giterr_set` calls</title>
<updated>2016-11-14T09:05:59+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-11-14T09:05:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=c77a55a917c60bc052d8702d4c3e170b0b5fe964'/>
<id>c77a55a917c60bc052d8702d4c3e170b0b5fe964</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>diff: treat binary patches with no data special</title>
<updated>2016-09-05T17:26:47+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-09-02T07:03:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=adedac5aba9e4525475fd59d751cd02c6f2b3a4f'/>
<id>adedac5aba9e4525475fd59d751cd02c6f2b3a4f</id>
<content type='text'>
When creating and printing diffs, deal with binary deltas that have
binary data specially, versus diffs that have a binary file but lack the
actual binary data.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When creating and printing diffs, deal with binary deltas that have
binary data specially, versus diffs that have a binary file but lack the
actual binary data.
</pre>
</div>
</content>
</entry>
<entry>
<title>Teach `git_patch_from_diff` about parsed diffs</title>
<updated>2016-08-24T14:08:57+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-08-24T04:38:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b859faa61ce3f1fda5c29ac1e72a3d58fee2ede6'/>
<id>b859faa61ce3f1fda5c29ac1e72a3d58fee2ede6</id>
<content type='text'>
Ensure that `git_patch_from_diff` can return the patch for parsed diffs,
not just generate a patch for a generated diff.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ensure that `git_patch_from_diff` can return the patch for parsed diffs,
not just generate a patch for a generated diff.
</pre>
</div>
</content>
</entry>
<entry>
<title>git_diff_file: move `id_abbrev`</title>
<updated>2016-08-03T21:57:37+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-08-03T21:09:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=002c8e29a1bbe7bf5c07c9c26037d4f6a1ac81a6'/>
<id>002c8e29a1bbe7bf5c07c9c26037d4f6a1ac81a6</id>
<content type='text'>
Move `id_abbrev` to a more reasonable place where it packs more nicely
(before anybody starts using it).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move `id_abbrev` to a more reasonable place where it packs more nicely
(before anybody starts using it).
</pre>
</div>
</content>
</entry>
<entry>
<title>apply: check allocation properly</title>
<updated>2016-07-24T19:49:19+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-07-15T03:04:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=c065f6a1d2b9c7c64646a6c0e65abbb3ca0dc4b1'/>
<id>c065f6a1d2b9c7c64646a6c0e65abbb3ca0dc4b1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>patch: show copy information for identical copies</title>
<updated>2016-06-26T03:08:30+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-04-26T05:18:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=1a79cd959ba2991dd3295f9940b28b606e494ccf'/>
<id>1a79cd959ba2991dd3295f9940b28b606e494ccf</id>
<content type='text'>
When showing copy information because we are duplicating contents,
for example, when performing a `diff --find-copies-harder -M100 -B100`,
then show copy from/to lines in a patch, and do not show context.
Ensure that we can also parse such patches.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When showing copy information because we are duplicating contents,
for example, when performing a `diff --find-copies-harder -M100 -B100`,
then show copy from/to lines in a patch, and do not show context.
Ensure that we can also parse such patches.
</pre>
</div>
</content>
</entry>
<entry>
<title>patch::parse: handle patches with no hunks</title>
<updated>2016-06-26T03:08:06+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-04-25T21:52:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=38a347ea5d9d039735d6b8e436c0c144b342aabe'/>
<id>38a347ea5d9d039735d6b8e436c0c144b342aabe</id>
<content type='text'>
Patches may have no hunks when there's no modifications (for example,
in a rename).  Handle them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Patches may have no hunks when there's no modifications (for example,
in a rename).  Handle them.
</pre>
</div>
</content>
</entry>
</feed>
