<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/include/git2/patch.h, branch ethomson/remote_completion</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>patch_generate: represent buffers as void pointers</title>
<updated>2017-07-10T09:46:25+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-07-10T09:42:26+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=9093ced6a10a050c6eee31a4ef3b9251f58ce561'/>
<id>9093ced6a10a050c6eee31a4ef3b9251f58ce561</id>
<content type='text'>
Pointers to general data should usually be used as a void pointer such
that it is possible to hand in variables of a different pointer type
without the need to cast. This is the same when creating patches from
buffers, where the buffers may contain arbitrary data. Instead of
requiring the caller to care whether his buffer is e.g. `char *` or
`unsigned char *`, we should instead just accept a `void *`. This is
also consistent in how we tread other types like for example `git_blob`,
which also just has a void pointer as its raw contents.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pointers to general data should usually be used as a void pointer such
that it is possible to hand in variables of a different pointer type
without the need to cast. This is the same when creating patches from
buffers, where the buffers may contain arbitrary data. Instead of
requiring the caller to care whether his buffer is e.g. `char *` or
`unsigned char *`, we should instead just accept a `void *`. This is
also consistent in how we tread other types like for example `git_blob`,
which also just has a void pointer as its raw contents.
</pre>
</div>
</content>
</entry>
<entry>
<title>patch: minor documentation fix.</title>
<updated>2016-10-15T23:43:27+00:00</updated>
<author>
<name>Davide Coppola</name>
<email>vivaladav@gmail.com</email>
</author>
<published>2016-10-15T23:43:27+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=6d8ecf087c35fa4f129c6e15017aba55ef3b4986'/>
<id>6d8ecf087c35fa4f129c6e15017aba55ef3b4986</id>
<content type='text'>
Fix @return description of git_patch_num_lines_in_hunk.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix @return description of git_patch_num_lines_in_hunk.
</pre>
</div>
</content>
</entry>
<entry>
<title>diff docs: update `git_diff_delta` description</title>
<updated>2015-02-03T18:41:35+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-02-03T18:41:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=3538f8f131e8ebe597c1172b381bb260ac66f1c0'/>
<id>3538f8f131e8ebe597c1172b381bb260ac66f1c0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix const-correctness of git_patch_get_delta, git_patch_num_hunks, git_patch_num_lines_in_hunk</title>
<updated>2014-04-11T19:55:36+00:00</updated>
<author>
<name>Jacques Germishuys</name>
<email>jacquesg@striata.com</email>
</author>
<published>2014-04-10T10:44:51+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=7a28f268adc1d2569ce504147af05834ae94c01a'/>
<id>7a28f268adc1d2569ce504147af05834ae94c01a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add buffer to buffer diff and patch APIs</title>
<updated>2014-02-27T22:13:22+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2014-02-27T22:13:22+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=6789b7a75d1e24a7f4ce34628c6b4561517f0b73'/>
<id>6789b7a75d1e24a7f4ce34628c6b4561517f0b73</id>
<content type='text'>
This adds `git_diff_buffers` and `git_patch_from_buffers`.  This
also includes a bunch of internal refactoring to increase the
shared code between these functions and the blob-to-blob and
blob-to-buffer APIs, as well as some higher level assert helpers
in the tests to also remove redundancy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds `git_diff_buffers` and `git_patch_from_buffers`.  This
also includes a bunch of internal refactoring to increase the
shared code between these functions and the blob-to-blob and
blob-to-buffer APIs, as well as some higher level assert helpers
in the tests to also remove redundancy.
</pre>
</div>
</content>
</entry>
<entry>
<title>Drop git_patch_to_str</title>
<updated>2014-01-22T16:51:32+00:00</updated>
<author>
<name>Nicolas Hake</name>
<email>nh@nosebud.de</email>
</author>
<published>2014-01-22T16:51:32+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=c05cd7924d2409741bb4cb1eb3ba843bea7ec4a2'/>
<id>c05cd7924d2409741bb4cb1eb3ba843bea7ec4a2</id>
<content type='text'>
It's hard or even impossible to correctly free the string buffer
allocated by git_patch_to_str in some circumstances. Drop the function
so people have to use git_patch_to_buf instead - git_buf has a dedicated
destructor.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's hard or even impossible to correctly free the string buffer
allocated by git_patch_to_str in some circumstances. Drop the function
so people have to use git_patch_to_buf instead - git_buf has a dedicated
destructor.
</pre>
</div>
</content>
</entry>
<entry>
<title>Expose patch serialization to git_buf</title>
<updated>2014-01-22T12:40:19+00:00</updated>
<author>
<name>Nicolas Hake</name>
<email>nh@nosebud.de</email>
</author>
<published>2014-01-22T12:22:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=450e8e9e623b8c172ba4628c146838cbf4c56519'/>
<id>450e8e9e623b8c172ba4628c146838cbf4c56519</id>
<content type='text'>
Returning library-allocated strings from libgit2 works fine on Linux,
but may cause problems on Windows because there is no one C Runtime that
everything links against. With libgit2 not exposing its own allocator,
freeing the string is a gamble.

git_patch_to_str already serializes to a buffer, then returns the
underlying memory. Expose the functionality directly, so callers can use
the git_buf_free function to free the memory later.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Returning library-allocated strings from libgit2 works fine on Linux,
but may cause problems on Windows because there is no one C Runtime that
everything links against. With libgit2 not exposing its own allocator,
freeing the string is a gamble.

git_patch_to_str already serializes to a buffer, then returns the
underlying memory. Expose the functionality directly, so callers can use
the git_buf_free function to free the memory later.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update docs for new callback return value behavior</title>
<updated>2013-12-11T18:57:50+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2013-12-09T18:17:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=373cf6a932a64d1cbe5f5cd8333546dcc2ca0b92'/>
<id>373cf6a932a64d1cbe5f5cd8333546dcc2ca0b92</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Create git_diff_line and extend git_diff_hunk</title>
<updated>2013-10-21T20:42:42+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2013-10-21T20:42:42+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=3b5f795446601868d52d09ebac70ae3b7aee157a'/>
<id>3b5f795446601868d52d09ebac70ae3b7aee157a</id>
<content type='text'>
Instead of having functions with so very many parameters to pass
hunk and line data, this takes the existing git_diff_hunk struct
and extends it with more hunk data, plus adds a git_diff_line.
Those structs are used to pass back hunk and line data instead of
the old APIs that took tons of parameters.

Some work that was previously only being done for git_diff_patch
creation (scanning the diff content for exact line counts) is now
done for all callbacks, but the performance difference should not
be noticable.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of having functions with so very many parameters to pass
hunk and line data, this takes the existing git_diff_hunk struct
and extends it with more hunk data, plus adds a git_diff_line.
Those structs are used to pass back hunk and line data instead of
the old APIs that took tons of parameters.

Some work that was previously only being done for git_diff_patch
creation (scanning the diff content for exact line counts) is now
done for all callbacks, but the performance difference should not
be noticable.
</pre>
</div>
</content>
</entry>
<entry>
<title>Diff API cleanup</title>
<updated>2013-10-15T22:10:07+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2013-10-15T22:10:07+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=10672e3e455eba2d4ca983070ed427caeeb24a6f'/>
<id>10672e3e455eba2d4ca983070ed427caeeb24a6f</id>
<content type='text'>
This lays groundwork for separating formatting options from diff
creation options.  This groups the formatting flags separately
from the diff list creation flags and reorders the options.  This
also tweaks some APIs to further separate code that uses patches
from code that just looks at git_diffs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This lays groundwork for separating formatting options from diff
creation options.  This groups the formatting flags separately
from the diff list creation flags and reorders the options.  This
also tweaks some APIs to further separate code that uses patches
from code that just looks at git_diffs.
</pre>
</div>
</content>
</entry>
</feed>
