<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ref-filter.c, branch v2.20.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.20.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.20.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-11-19T07:24:41Z</updated>
<entry>
<title>Merge branch 'tb/print-size-t-with-uintmax-format'</title>
<updated>2018-11-19T07:24:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-19T07:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5f0f68d61301c3ffb2f8da84f627547e8f9a94c'/>
<id>urn:sha1:f5f0f68d61301c3ffb2f8da84f627547e8f9a94c</id>
<content type='text'>
Code preparation to replace ulong vars with size_t vars where
appropriate.

* tb/print-size-t-with-uintmax-format:
  Upcast size_t variables to uintmax_t when printing
</content>
</entry>
<entry>
<title>Merge branch 'sg/ref-filter-wo-repository'</title>
<updated>2018-11-18T09:23:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-18T09:23:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7bdebaa646787b98679799ee27bfb42fb7daa8ca'/>
<id>urn:sha1:7bdebaa646787b98679799ee27bfb42fb7daa8ca</id>
<content type='text'>
"git ls-remote --sort=&lt;thing&gt;" can feed an object that is not yet
available into the comparison machinery and segfault, which has
been corrected to check such a request upfront and reject it.

* sg/ref-filter-wo-repository:
  ref-filter: don't look for objects when outside of a repository
</content>
</entry>
<entry>
<title>ref-filter: don't look for objects when outside of a repository</title>
<updated>2018-11-16T04:49:08Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2018-11-14T12:27:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47bd3d0c14f081a3ea32b0720f7d59559802904d'/>
<id>urn:sha1:47bd3d0c14f081a3ea32b0720f7d59559802904d</id>
<content type='text'>
The command 'git ls-remote --sort=authordate &lt;remote&gt;' segfaults when
run outside of a repository, ever since the introduction of its
'--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option,
2018-04-09).

While in general the 'git ls-remote' command can be run outside of a
repository just fine, its '--sort=&lt;key&gt;' option with certain keys does
require access to the referenced objects.  This sorting is implemented
using the generic ref-filter sorting facility, which already handles
missing objects gracefully with the appropriate 'missing object
deadbeef for HEAD' message.  However, being generic means that it
checks replace refs while trying to retrieve an object, and while
doing so it accesses the 'git_replace_ref_base' variable, which has
not been initialized and is still a NULL pointer when outside of a
repository, thus causing the segfault.

Make ref-filter more careful upfront while parsing the format string,
and make it error out when encountering a format atom requiring object
access when we are not in a repository.  Also add a test to ensure
that 'git ls-remote --sort' fails gracefully when executed outside of
a repository.

Reported-by: H.Merijn Brand &lt;h.m.brand@xs4all.nl&gt;
Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Upcast size_t variables to uintmax_t when printing</title>
<updated>2018-11-12T07:43:52Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2018-11-11T07:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca473cef9140f55d68d6758fe226ef47c216669c'/>
<id>urn:sha1:ca473cef9140f55d68d6758fe226ef47c216669c</id>
<content type='text'>
When printing variables which contain a size, today "unsigned long"
is used at many places.
In order to be able to change the type from "unsigned long" into size_t
some day in the future, we need to have a way to print 64 bit variables
on a system that has "unsigned long" defined to be 32 bit, like Win64.

Upcast all those variables into uintmax_t before they are printed.
This is to prepare for a bigger change, when "unsigned long"
will be converted into size_t for variables which may be &gt; 4Gib.

Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>assert NOARG/NONEG behavior of parse-options callbacks</title>
<updated>2018-11-06T03:56:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-11-05T06:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=517fe807d6903c629a739b23fe0e75b892096998'/>
<id>urn:sha1:517fe807d6903c629a739b23fe0e75b892096998</id>
<content type='text'>
When we define a parse-options callback, the flags we put in the option
struct must match what the callback expects. For example, a callback
which does not handle the "unset" parameter should only be used with
PARSE_OPT_NONEG. But since the callback and the option struct are not
defined next to each other, it's easy to get this wrong (as earlier
patches in this series show).

Fortunately, the compiler can help us here: compiling with
-Wunused-parameters can show us which callbacks ignore their "unset"
parameters (and likewise, ones that ignore "arg" expect to be triggered
with PARSE_OPT_NOARG).

But after we've inspected a callback and determined that all of its
callers use the right flags, what do we do next? We'd like to silence
the compiler warning, but do so in a way that will catch any wrong calls
in the future.

We can do that by actually checking those variables and asserting that
they match our expectations. Because this is such a common pattern,
we'll introduce some helper macros. The resulting messages aren't
as descriptive as we could make them, but the file/line information from
BUG() is enough to identify the problem (and anyway, the point is that
these should never be seen).

Each of the annotated callbacks in this patch triggers
-Wunused-parameters, and was manually inspected to make sure all callers
use the correct options (so none of these BUGs should be triggerable).

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>Merge branch 'ot/ref-filter-plug-leaks'</title>
<updated>2018-10-30T06:43:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-30T06:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9d00100c3890b1f2fb4b2ea71dda49ba70be5811'/>
<id>urn:sha1:9d00100c3890b1f2fb4b2ea71dda49ba70be5811</id>
<content type='text'>
Plugging a handful of memory leaks in the ref-filter codepath.

* ot/ref-filter-plug-leaks:
  ref-filter: free item-&gt;value and item-&gt;value-&gt;s
  ls-remote: release memory instead of UNLEAK
  ref-filter: free memory from used_atom
</content>
</entry>
<entry>
<title>Merge branch 'nd/the-index'</title>
<updated>2018-10-19T04:34:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-19T04:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=11877b9ebec87175a9cc55676311ef2d98585cca'/>
<id>urn:sha1:11877b9ebec87175a9cc55676311ef2d98585cca</id>
<content type='text'>
Various codepaths in the core-ish part learn to work on an
arbitrary in-core index structure, not necessarily the default
instance "the_index".

* nd/the-index: (23 commits)
  revision.c: reduce implicit dependency the_repository
  revision.c: remove implicit dependency on the_index
  ws.c: remove implicit dependency on the_index
  tree-diff.c: remove implicit dependency on the_index
  submodule.c: remove implicit dependency on the_index
  line-range.c: remove implicit dependency on the_index
  userdiff.c: remove implicit dependency on the_index
  rerere.c: remove implicit dependency on the_index
  sha1-file.c: remove implicit dependency on the_index
  patch-ids.c: remove implicit dependency on the_index
  merge.c: remove implicit dependency on the_index
  merge-blobs.c: remove implicit dependency on the_index
  ll-merge.c: remove implicit dependency on the_index
  diff-lib.c: remove implicit dependency on the_index
  read-cache.c: remove implicit dependency on the_index
  diff.c: remove implicit dependency on the_index
  grep.c: remove implicit dependency on the_index
  diff.c: remove the_index dependency in textconv() functions
  blame.c: rename "repo" argument to "r"
  combine-diff.c: remove implicit dependency on the_index
  ...
</content>
</entry>
<entry>
<title>ref-filter: free item-&gt;value and item-&gt;value-&gt;s</title>
<updated>2018-10-19T02:28:13Z</updated>
<author>
<name>Olga Telezhnaya</name>
<email>olyatelezhnaya@gmail.com</email>
</author>
<published>2018-10-18T07:28:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f0062d3b74cfd4425188e16cbda358b1e0228d85'/>
<id>urn:sha1:f0062d3b74cfd4425188e16cbda358b1e0228d85</id>
<content type='text'>
Release item-&gt;value.
Initialize item-&gt;value-&gt;s dynamically and then release its resources.
Release some local variables.

Final goal of this patch is to reduce number of memory leaks.

Signed-off-by: Olga Telezhnaia &lt;olyatelezhnaya@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: free memory from used_atom</title>
<updated>2018-10-19T02:28:10Z</updated>
<author>
<name>Olga Telezhnaya</name>
<email>olyatelezhnaya@gmail.com</email>
</author>
<published>2018-10-18T07:28:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=23941dd7b8f30946505118139fb861b86c1a5cc2'/>
<id>urn:sha1:23941dd7b8f30946505118139fb861b86c1a5cc2</id>
<content type='text'>
Release memory from used_atom variable for reducing number of memory
leaks.

Signed-off-by: Olga Telezhnaia &lt;olyatelezhnaya@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>revision.c: remove implicit dependency on the_index</title>
<updated>2018-09-21T16:51:19Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-09-21T15:57:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2abf3503854e27e18b2fb5ba97ceeb3f79240ee5'/>
<id>urn:sha1:2abf3503854e27e18b2fb5ba97ceeb3f79240ee5</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
