<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/attr.c, branch v2.4.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.4.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-12-29T20:40:48Z</updated>
<entry>
<title>attr: avoid heavy work when we know the specified attr is not defined</title>
<updated>2014-12-29T20:40:48Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-12-27T23:39:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06a604e67051b9342c158432a49e42a5440f9280'/>
<id>urn:sha1:06a604e67051b9342c158432a49e42a5440f9280</id>
<content type='text'>
If we have never seen attr 'X' in any .gitattributes file we have
examined so far, we can be sure that 'X' is not defined. So no need to
go over all the attr stack to look for attr 'X'. This is the purpose
behind this new field maybe_real.

This optimization breaks down if macros are involved because we can't
know for sure what macro would expand to 'X' at attr parsing time. But
if we go the pessimistic way and assume all macros are expanded, we hit
the builtin "binary" macro. At least the "diff" attr defined in this
macro will disable this optimization for git-grep. So we wait until
any attr lines _may_ reference to a macro before we turn this off.

In git.git, this reduces the number of fill_one() call for "git grep
abcdefghi" from ~5348 to 2955. The optimization stops when it reads
t/.gitattributes, which uses 'binary' macro. We could probably reduce
it further by limiting the 'binary' reference to t/ and subdirs only
in this case.

"git grep" is actually a good example to justify this patch. The
command checks "diff" attribute on every file. People usually don't
define this attribute. But they pay the attr lookup penalty anyway
without this patch, proportional to the number of attr lines they have
in repo.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>
<entry>
<title>attr: do not attempt to expand when we know it's not a macro</title>
<updated>2014-12-29T20:40:45Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-12-27T23:39:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fad32bcd83ec4e4f88013e4a0b05f42e32e2c6f5'/>
<id>urn:sha1:fad32bcd83ec4e4f88013e4a0b05f42e32e2c6f5</id>
<content type='text'>
Keep track of all recognized macros in the new "maybe_macro" field.
If this field is true, it _may_ be a macro (depending on what's in the
current attr stack). But if the field is false, it's definitely not a
macro, no need to go through the whole attr stack in macroexpand_one()
to search for one.

Without this, "git grep abcdefghi" on git.git hits the inner loop in
macroexpand_one() 2481 times. With this, it's 66 times.

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
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>
<entry>
<title>attr.c: rename arg name attr_nr to avoid shadowing the global one</title>
<updated>2014-12-29T20:40:42Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-12-27T23:39:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa7710e064a9ee644e1e86bd6f89193200ac4ccd'/>
<id>urn:sha1:aa7710e064a9ee644e1e86bd6f89193200ac4ccd</id>
<content type='text'>
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>
<entry>
<title>use REALLOC_ARRAY for changing the allocation size of arrays</title>
<updated>2014-09-18T16:13:42Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-09-16T18:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2756ca4347cbda05b16954cd7f445c216b935e76'/>
<id>urn:sha1:2756ca4347cbda05b16954cd7f445c216b935e76</id>
<content type='text'>
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr.c: use ALLOC_GROW() in handle_attr_line()</title>
<updated>2014-03-03T22:54:37Z</updated>
<author>
<name>Dmitry S. Dolzhenko</name>
<email>dmitrys.dolzhenko@yandex.ru</email>
</author>
<published>2014-03-03T22:31:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a7fa03db97eddec274af2ef22d96fc6f486f7c0'/>
<id>urn:sha1:3a7fa03db97eddec274af2ef22d96fc6f486f7c0</id>
<content type='text'>
Signed-off-by: Dmitry S. Dolzhenko &lt;dmitrys.dolzhenko@yandex.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>replace {pre,suf}fixcmp() with {starts,ends}_with()</title>
<updated>2013-12-05T22:13:21Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-11-30T20:55:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=59556548230e617b837343c2c07e357e688e2ca4'/>
<id>urn:sha1:59556548230e617b837343c2c07e357e688e2ca4</id>
<content type='text'>
Leaving only the function definitions and declarations so that any
new topic in flight can still make use of the old functions, replace
existing uses of the prefixcmp() and suffixcmp() with new API
functions.

The change can be recreated by mechanically applying this:

    $ git grep -l -e prefixcmp -e suffixcmp -- \*.c |
      grep -v strbuf\\.c |
      xargs perl -pi -e '
        s|!prefixcmp\(|starts_with\(|g;
        s|prefixcmp\(|!starts_with\(|g;
        s|!suffixcmp\(|ends_with\(|g;
        s|suffixcmp\(|!ends_with\(|g;
      '

on the result of preparatory changes in this series.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'lf/read-blob-data-from-index'</title>
<updated>2013-04-22T01:39:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-04-22T01:39:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4b35b007a6bd8b76bd37589fa397c12265935029'/>
<id>urn:sha1:4b35b007a6bd8b76bd37589fa397c12265935029</id>
<content type='text'>
Reduce duplicated code between convert.c and attr.c.

* lf/read-blob-data-from-index:
  convert.c: remove duplicate code
  read_blob_data_from_index(): optionally return the size of blob data
  attr.c: extract read_index_data() as read_blob_data_from_index()
</content>
</entry>
<entry>
<title>read_blob_data_from_index(): optionally return the size of blob data</title>
<updated>2013-04-17T16:51:47Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>git@cryptocrack.de</email>
</author>
<published>2013-04-13T13:28:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ff36682505dfb580172306fe1b265b860f89bcea'/>
<id>urn:sha1:ff36682505dfb580172306fe1b265b860f89bcea</id>
<content type='text'>
This allows for optionally getting the size of the returned data and
will be used in a follow-up patch.

Signed-off-by: Lukas Fleischer &lt;git@cryptocrack.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr.c: extract read_index_data() as read_blob_data_from_index()</title>
<updated>2013-04-17T16:49:11Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>git@cryptocrack.de</email>
</author>
<published>2013-04-13T13:28:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=29fb37b272debaf4f5f6eb7cf476de9274492930'/>
<id>urn:sha1:29fb37b272debaf4f5f6eb7cf476de9274492930</id>
<content type='text'>
Extract the read_index_data() function from attr.c and move it to
read-cache.c; rename it to read_blob_data_from_index() and update
the function signature of it to align better with index/cache API
functions.

This allows for reusing the function in convert.c later.

Signed-off-by: Lukas Fleischer &lt;git@cryptocrack.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/directory-attrs-regression-fix' into maint-1.8.1</title>
<updated>2013-04-07T15:45:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-04-07T15:45:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4bbb830a35c5134b612a990f04ee16678ec0c674'/>
<id>urn:sha1:4bbb830a35c5134b612a990f04ee16678ec0c674</id>
<content type='text'>
A pattern "dir" (without trailing slash) in the attributes file
stopped matching a directory "dir" by mistake with an earlier change
that wanted to allow pattern "dir/" to also match.

* jc/directory-attrs-regression-fix:
  t: check that a pattern without trailing slash matches a directory
  dir.c::match_pathname(): pay attention to the length of string parameters
  dir.c::match_pathname(): adjust patternlen when shifting pattern
  dir.c::match_basename(): pay attention to the length of string parameters
  attr.c::path_matches(): special case paths that end with a slash
  attr.c::path_matches(): the basename is part of the pathname
</content>
</entry>
</feed>
