<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/refspec.c, branch ethomson/clar_threads</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>refspec: do not set empty rhs for fetch refspecs</title>
<updated>2016-08-04T11:54:19+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-08-04T11:45:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=1eee631d1189312219773e699d76848680c02e19'/>
<id>1eee631d1189312219773e699d76848680c02e19</id>
<content type='text'>
According to git-fetch(1), "[t]he colon can be omitted when &lt;dst&gt;
is empty." So according to git, the refspec "refs/heads/master"
is the same as the refspec "refs/heads/master:" when fetching
changes. When trying to fetch from a remote with a trailing
colon with libgit2, though, the fetch actually fails while it
works when the trailing colon is left out. So obviously, libgit2
does _not_ treat these two refspec formats the same for fetches.

The problem results from parsing refspecs, where the resulting
refspec has its destination set to an empty string in the case of
a trailing colon and to a `NULL` pointer in the case of no
trailing colon. When passing this to our DWIM machinery, the
empty string gets translated to "refs/heads/", which is simply
wrong.

Fix the problem by having the parsing machinery treat both cases
the same for fetch refspecs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to git-fetch(1), "[t]he colon can be omitted when &lt;dst&gt;
is empty." So according to git, the refspec "refs/heads/master"
is the same as the refspec "refs/heads/master:" when fetching
changes. When trying to fetch from a remote with a trailing
colon with libgit2, though, the fetch actually fails while it
works when the trailing colon is left out. So obviously, libgit2
does _not_ treat these two refspec formats the same for fetches.

The problem results from parsing refspecs, where the resulting
refspec has its destination set to an empty string in the case of
a trailing colon and to a `NULL` pointer in the case of no
trailing colon. When passing this to our DWIM machinery, the
empty string gets translated to "refs/heads/", which is simply
wrong.

Fix the problem by having the parsing machinery treat both cases
the same for fetch refspecs.
</pre>
</div>
</content>
</entry>
<entry>
<title>refspec: check buffer with GITERR_CHECK_ALLOC_BUF</title>
<updated>2016-02-23T10:50:23+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-02-23T09:09:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b9f28b8d52d595943eb416fec8f5bd3f5ec21f5b'/>
<id>b9f28b8d52d595943eb416fec8f5bd3f5ec21f5b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix memory leak in refspec.c on errors.</title>
<updated>2015-06-30T13:41:17+00:00</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2015-06-29T21:32:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=64e6b5b0350f1c080a3c1e2753fa14a682270ed8'/>
<id>64e6b5b0350f1c080a3c1e2753fa14a682270ed8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refspec: make sure matching refspecs have src, dst and input strings</title>
<updated>2015-05-22T10:11:42+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-05-22T10:11:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=7cd4ba1b17d579134ac6cc172fc858021d4aa407'/>
<id>7cd4ba1b17d579134ac6cc172fc858021d4aa407</id>
<content type='text'>
When we find out that we're dealing with a matching refspec, we set the
flag and return immediately. This leaves the strings as NULL, which
breaks the contract.

Assign these pointers to a string with the correct values.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we find out that we're dealing with a matching refspec, we set the
flag and return immediately. This leaves the strings as NULL, which
breaks the contract.

Assign these pointers to a string with the correct values.
</pre>
</div>
</content>
</entry>
<entry>
<title>refspec: set err message on invalid refspec</title>
<updated>2015-03-10T20:31:26+00:00</updated>
<author>
<name>Adrien Thebo</name>
<email>git@somethingsinistral.net</email>
</author>
<published>2015-03-04T21:29:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b523194d219a9dc062bad89bf8ba5dbeca7dab17'/>
<id>b523194d219a9dc062bad89bf8ba5dbeca7dab17</id>
<content type='text'>
If a refspec could not be parsed, the git_refspec__parse function would
return an error value but would not provide additional error information
for the callers. This commit amends that function to set a more useful
error message.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a refspec could not be parsed, the git_refspec__parse function would
return an error value but would not provide additional error information
for the callers. This commit amends that function to set a more useful
error message.
</pre>
</div>
</content>
</entry>
<entry>
<title>push: use the common refspec parser</title>
<updated>2014-11-09T15:07:43+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2014-11-07T14:00:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=aad638f3a1e4d98296c2ec9c4ed08f217a652c5c'/>
<id>aad638f3a1e4d98296c2ec9c4ed08f217a652c5c</id>
<content type='text'>
There is one well-known and well-tested parser which we should use,
instead of implementing parsing a second time.

The common parser is also augmented to copy the LHS into the RHS if the
latter is empty.

The expressions test had to change a bit, as we now catch a bad RHS of a
refspec locally.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is one well-known and well-tested parser which we should use,
instead of implementing parsing a second time.

The common parser is also augmented to copy the LHS into the RHS if the
latter is empty.

The expressions test had to change a bit, as we now catch a bad RHS of a
refspec locally.
</pre>
</div>
</content>
</entry>
<entry>
<title>Check that the refspec matches before modifying the out buffer</title>
<updated>2014-08-21T16:53:43+00:00</updated>
<author>
<name>Jacques Germishuys</name>
<email>jacquesg@striata.com</email>
</author>
<published>2014-08-21T16:53:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=8f6073f63e42c2a3ff3b6fbb20729c7a911be30f'/>
<id>8f6073f63e42c2a3ff3b6fbb20729c7a911be30f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Check if the refspec matches before transforming</title>
<updated>2014-08-17T12:55:06+00:00</updated>
<author>
<name>Jacques Germishuys</name>
<email>jacquesg@striata.com</email>
</author>
<published>2014-08-17T12:55:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=4e53c28096f4b04ab9b573fc594a538f51e10049'/>
<id>4e53c28096f4b04ab9b573fc594a538f51e10049</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refspec: support asterisks in the middle of a pattern</title>
<updated>2014-07-04T16:00:20+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2014-07-04T15:17:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=f5287fa6c39762072e30140329c41e9f304d7c04'/>
<id>f5287fa6c39762072e30140329c41e9f304d7c04</id>
<content type='text'>
We used to assume a refspec would only have an asterisk in the middle of
their respective pattern. This has not been a valid assumption for some
time now with git.

Instead of assuming where the asterisk is going to be, change the logic
to treat each pattern as having two halves with a replacement bit in the
middle, where the asterisk is.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We used to assume a refspec would only have an asterisk in the middle of
their respective pattern. This has not been a valid assumption for some
time now with git.

Instead of assuming where the asterisk is going to be, change the logic
to treat each pattern as having two halves with a replacement bit in the
middle, where the asterisk is.
</pre>
</div>
</content>
</entry>
<entry>
<title>refspec: short-circuit non-pattern refspecs on transform</title>
<updated>2014-07-04T15:41:40+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2014-07-04T15:16:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=9ed104a8fa9fc28bb29a0ff53c68094696e13aea'/>
<id>9ed104a8fa9fc28bb29a0ff53c68094696e13aea</id>
<content type='text'>
When transforming a non-pattern refspec, we simply need to copy over the
opposite string. Move that logic up to the wrapper so we can assume a
pattern refspec in the transformation function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When transforming a non-pattern refspec, we simply need to copy over the
opposite string. Move that logic up to the wrapper so we can assume a
pattern refspec in the transformation function.
</pre>
</div>
</content>
</entry>
</feed>
