<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/attr.c, branch v2.4.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.4.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.4.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-06-05T19:00:04Z</updated>
<entry>
<title>Merge branch 'pt/xdg-config-path' into maint</title>
<updated>2015-06-05T19:00:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-05T19:00:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9c82fa7a75ae617718f195bb5f5ff5c904f2687'/>
<id>urn:sha1:d9c82fa7a75ae617718f195bb5f5ff5c904f2687</id>
<content type='text'>
Code clean-up for xdg configuration path support.

* pt/xdg-config-path:
  path.c: remove home_config_paths()
  git-config: replace use of home_config_paths()
  git-commit: replace use of home_config_paths()
  credential-store.c: replace home_config_paths() with xdg_config_home()
  dir.c: replace home_config_paths() with xdg_config_home()
  attr.c: replace home_config_paths() with xdg_config_home()
  path.c: implement xdg_config_home()
  t0302: "unreadable" test needs POSIXPERM
  t0302: test credential-store support for XDG_CONFIG_HOME
  git-credential-store: support XDG_CONFIG_HOME
  git-credential-store: support multiple credential files
</content>
</entry>
<entry>
<title>Merge branch 'cn/bom-in-gitignore' into maint</title>
<updated>2015-05-13T21:05:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-05-13T21:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a1d89745d1b60d0d9e8bd91e4e9564673b6c22a'/>
<id>urn:sha1:8a1d89745d1b60d0d9e8bd91e4e9564673b6c22a</id>
<content type='text'>
Teach the codepaths that read .gitignore and .gitattributes files
that these files encoded in UTF-8 may have UTF-8 BOM marker at the
beginning; this makes it in line with what we do for configuration
files already.

* cn/bom-in-gitignore:
  attr: skip UTF8 BOM at the beginning of the input file
  config: use utf8_bom[] from utf.[ch] in git_parse_source()
  utf8-bom: introduce skip_utf8_bom() helper
  add_excludes_from_file: clarify the bom skipping logic
  dir: allow a BOM at the beginning of exclude files
</content>
</entry>
<entry>
<title>attr.c: replace home_config_paths() with xdg_config_home()</title>
<updated>2015-05-06T18:32:46Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-05-06T08:00:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2527bbce25dcfd952064cf02057ad8729134ed44'/>
<id>urn:sha1:2527bbce25dcfd952064cf02057ad8729134ed44</id>
<content type='text'>
Since only the xdg attributes file path is required, simplify the code
by using xdg_config_home() instead of home_config_paths().

Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: skip UTF8 BOM at the beginning of the input file</title>
<updated>2015-04-16T18:35:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-04-16T17:48:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27547e5fccda134560ad0441aa5bfa187387cec0'/>
<id>urn:sha1:27547e5fccda134560ad0441aa5bfa187387cec0</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>
</feed>
