<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/commit.c, branch ethomson/read_prefix</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>git_commit_create: freshen tree objects in commit</title>
<updated>2017-03-03T14:12:00+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2017-03-03T13:26:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=52d03f37f70ebde3e0a7794a60dbf68d0e69b9e8'/>
<id>52d03f37f70ebde3e0a7794a60dbf68d0e69b9e8</id>
<content type='text'>
Freshen the tree object that a commit points to during commit time.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Freshen the tree object that a commit points to during commit time.
</pre>
</div>
</content>
</entry>
<entry>
<title>commit: avoid possible use-after-free</title>
<updated>2017-02-13T12:50:52+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-02-13T12:46:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=ade0d9c658fdfc68d8046935f6908f033fe7a529'/>
<id>ade0d9c658fdfc68d8046935f6908f033fe7a529</id>
<content type='text'>
When extracting a commit's signature, we first free the object and only
afterwards put its signature contents into the result buffer. This works
in most cases - the free'd object will normally be cached anyway, so we
only end up decrementing its reference count without actually freeing
its contents. But in some more exotic setups, where caching is disabled,
this can definitly be a problem, as we might be the only instance
currently holding a reference to this object.

Fix this issue by first extracting the contents and freeing the object
afterwards only.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When extracting a commit's signature, we first free the object and only
afterwards put its signature contents into the result buffer. This works
in most cases - the free'd object will normally be cached anyway, so we
only end up decrementing its reference count without actually freeing
its contents. But in some more exotic setups, where caching is disabled,
this can definitly be a problem, as we might be the only instance
currently holding a reference to this object.

Fix this issue by first extracting the contents and freeing the object
afterwards only.
</pre>
</div>
</content>
</entry>
<entry>
<title>commit: clear user-provided buffers</title>
<updated>2017-02-13T12:50:52+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-02-13T12:42:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=dc851d9eae21db8671118d798e55990e199af6af'/>
<id>dc851d9eae21db8671118d798e55990e199af6af</id>
<content type='text'>
The functions `git_commit_header_field` and
`git_commit_extract_signature` both receive buffers used to hand back
the results to the user. While these functions called `git_buf_sanitize`
on these buffers, this is not the right thing to do, as it will simply
initialize or zero-terminate passed buffers. As we want to overwrite
contents, we instead have to call `git_buf_clear` to completely reset
them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The functions `git_commit_header_field` and
`git_commit_extract_signature` both receive buffers used to hand back
the results to the user. While these functions called `git_buf_sanitize`
on these buffers, this is not the right thing to do, as it will simply
initialize or zero-terminate passed buffers. As we want to overwrite
contents, we instead have to call `git_buf_clear` to completely reset
them.
</pre>
</div>
</content>
</entry>
<entry>
<title>giterr_set: consistent error messages</title>
<updated>2016-12-29T12:26:03+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-12-29T12:25:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=909d5494368a00809bc42f4780e86f4dd66e4422'/>
<id>909d5494368a00809bc42f4780e86f4dd66e4422</id>
<content type='text'>
Error messages should be sentence fragments, and therefore:

1. Should not begin with a capital letter,
2. Should not conclude with punctuation, and
3. Should not end a sentence and begin a new one
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Error messages should be sentence fragments, and therefore:

1. Should not begin with a capital letter,
2. Should not conclude with punctuation, and
3. Should not end a sentence and begin a new one
</pre>
</div>
</content>
</entry>
<entry>
<title>commit: always initialize commit message</title>
<updated>2016-10-09T11:26:21+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-10-07T07:31:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=a719ef5e6d4a1a8ec53469c7914032ed67922772'/>
<id>a719ef5e6d4a1a8ec53469c7914032ed67922772</id>
<content type='text'>
When parsing a commit, we will treat all bytes left after parsing
the headers as the commit message. When no bytes are left, we
leave the commit's message uninitialized. While uncommon to have
a commit without message, this is the right behavior as Git
unfortunately allows for empty commit messages.

Given that this scenario is so uncommon, most programs acting on
the commit message will never check if the message is actually
set, which may lead to errors. To work around the error and not
lay the burden of checking for empty commit messages to the
developer, initialize the commit message with an empty string
when no commit message is given.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When parsing a commit, we will treat all bytes left after parsing
the headers as the commit message. When no bytes are left, we
leave the commit's message uninitialized. While uncommon to have
a commit without message, this is the right behavior as Git
unfortunately allows for empty commit messages.

Given that this scenario is so uncommon, most programs acting on
the commit message will never check if the message is actually
set, which may lead to errors. To work around the error and not
lay the burden of checking for empty commit messages to the
developer, initialize the commit message with an empty string
when no commit message is given.
</pre>
</div>
</content>
</entry>
<entry>
<title>checkout: drop unused repo</title>
<updated>2016-06-01T15:03:51+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-05-26T17:28:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=0d77a56f397b4d65bfcc0a5d66884dcac1ba7a16'/>
<id>0d77a56f397b4d65bfcc0a5d66884dcac1ba7a16</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix `git_commit_create` for an initial commit</title>
<updated>2016-05-03T20:32:32+00:00</updated>
<author>
<name>John Haley</name>
<email>johnh@axosoft.com</email>
</author>
<published>2016-04-26T15:09:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=225cb8809ee5ec830fcfcca40efd62d1eba8241d'/>
<id>225cb8809ee5ec830fcfcca40efd62d1eba8241d</id>
<content type='text'>
When calling `git_commit_create` with an empty array of `parents` and `parent_count == 0` 
the call will segfault at https://github.com/libgit2/libgit2/blob/master/src/commit.c#L107 
when it's trying to compare `current_id` to a null parent oid. 

This just puts in a check to stop that segfault.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When calling `git_commit_create` with an empty array of `parents` and `parent_count == 0` 
the call will segfault at https://github.com/libgit2/libgit2/blob/master/src/commit.c#L107 
when it's trying to compare `current_id` to a null parent oid. 

This just puts in a check to stop that segfault.</pre>
</div>
</content>
</entry>
<entry>
<title>git_object_dup: introduce typesafe versions</title>
<updated>2016-03-23T21:08:37+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-02-17T18:04:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=f0224772ee4300d55e11ab6f84cb3dd64b35ecfd'/>
<id>f0224772ee4300d55e11ab6f84cb3dd64b35ecfd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #3673 from libgit2/cmn/commit-with-signature</title>
<updated>2016-03-17T13:57:56+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-03-17T13:57:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=ba3493228cd16136620757b03a4df01f8caf5057'/>
<id>ba3493228cd16136620757b03a4df01f8caf5057</id>
<content type='text'>
commit: add function to attach a signature to a commit</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit: add function to attach a signature to a commit</pre>
</div>
</content>
</entry>
<entry>
<title>commit: fix extraction of single-line signatures</title>
<updated>2016-03-17T09:48:06+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>carlosmn@github.com</email>
</author>
<published>2016-03-17T09:45:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=bf804d407e8d1fcff42e1113aa286270ae8925c0'/>
<id>bf804d407e8d1fcff42e1113aa286270ae8925c0</id>
<content type='text'>
The function to extract signatures suffers from a similar bug to the
header field finding one by having an unecessary line feed check as a
break condition of its loop.

Fix that and add a test for this single-line signature situation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function to extract signatures suffers from a similar bug to the
header field finding one by having an unecessary line feed check as a
break condition of its loop.

Fix that and add a test for this single-line signature situation.
</pre>
</div>
</content>
</entry>
</feed>
