<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/attr.c, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-03-13T22:28:54Z</updated>
<entry>
<title>pathspec: allow querying for attributes</title>
<updated>2017-03-13T22:28:54Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-03-13T18:23:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b0db70465246bb8309d3d12c9bc34ac3f0c1e203'/>
<id>urn:sha1:b0db70465246bb8309d3d12c9bc34ac3f0c1e203</id>
<content type='text'>
The pathspec mechanism is extended via the new
":(attr:eol=input)pattern/to/match" syntax to filter paths so that it
requires paths to not just match the given pattern but also have the
specified attrs attached for them to be chosen.

Based on a patch by Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: reformat git_attr_set_direction() function</title>
<updated>2017-02-01T21:46:53Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-28T02:02:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f0dd042148233ad4681b29f35f3bc3ba3b962474'/>
<id>urn:sha1:f0dd042148233ad4681b29f35f3bc3ba3b962474</id>
<content type='text'>
Move the 'git_attr_set_direction()' up to be closer to the variables
that it modifies as well as a small formatting by renaming the variable
'new' to 'new_direction' so that it is more descriptive.

Update the comment about how 'direction' is used to read the state of
the world.  It should be noted that callers of
'git_attr_set_direction()' should ensure that other threads are not
making calls into the attribute system until after the call to
'git_attr_set_direction()' completes.  This function essentially acts as
reset button for the attribute system and should be handled with care.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: push the bare repo check into read_attr()</title>
<updated>2017-02-01T21:46:53Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-28T02:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0787dafdccfb09b26501293f72db74638c3834ad'/>
<id>urn:sha1:0787dafdccfb09b26501293f72db74638c3834ad</id>
<content type='text'>
Push the bare repository check into the 'read_attr()' function.  This
avoids needing to have extra logic which creates an empty stack frame
when inside a bare repo as a similar bit of logic already exists in the
'read_attr()' function.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: store attribute stack in attr_check structure</title>
<updated>2017-02-01T21:46:53Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-28T02:02:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc81cf377cd25193a9cf044767917e4f5553c285'/>
<id>urn:sha1:dc81cf377cd25193a9cf044767917e4f5553c285</id>
<content type='text'>
The last big hurdle towards a thread-safe API for the attribute system
is the reliance on a global attribute stack that is modified during each
call into the attribute system.

This patch removes this global stack and instead a stack is stored
locally in each attr_check instance.  This opens up the opportunity for
future optimizations to customize the attribute stack for the attributes
that a particular attr_check struct is interested in.

One caveat with pushing the attribute stack into the attr_check
structure is that the attribute system now needs to keep track of all
active attr_check instances.  Due to the direction mechanism the stack
needs to be dropped when the direction is switched.  In order to ensure
correctness when the direction is changed the attribute system needs to
iterate through all active attr_check instances and drop each of their
stacks.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: tighten const correctness with git_attr and match_attr</title>
<updated>2017-02-01T21:46:53Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-28T02:02:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e810e0635767afbc9b304d5256fbdb26b59644fa'/>
<id>urn:sha1:e810e0635767afbc9b304d5256fbdb26b59644fa</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: remove maybe-real, maybe-macro from git_attr</title>
<updated>2017-02-01T21:46:53Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-28T02:02:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=60a12722ac80bc55b43581a7719d25d1bb7a9882'/>
<id>urn:sha1:60a12722ac80bc55b43581a7719d25d1bb7a9882</id>
<content type='text'>
Whether or not a git attribute is real or a macro isn't a property of
the attribute but rather it depends on the attribute stack (which
.gitattribute files were read).

This patch removes the 'maybe_real' and 'maybe_macro' fields in a
git_attr and instead adds the 'macro' field to a attr_check_item.  The
'macro' indicates (if non-NULL) that a particular attribute is a macro
for the given attribute stack.  It's populated, through a quick scan of
the attribute stack, with the match_attr that corresponds to the macro's
definition.  This way the attribute stack only needs to be scanned a
single time prior to attribute collection instead of each time a macro
needs to be expanded.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: eliminate global check_all_attr array</title>
<updated>2017-02-01T21:46:53Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-28T02:02:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=685b2925757e98624e37abe09d49c205a7db5943'/>
<id>urn:sha1:685b2925757e98624e37abe09d49c205a7db5943</id>
<content type='text'>
Currently there is a reliance on 'check_all_attr' which is a global
array of 'attr_check_item' items which is used to store the value of
each attribute during the collection process.

This patch eliminates this global and instead creates an array per
'attr_check' instance which is then used in the attribute collection
process.  This brings the attribute system one step closer to being
thread-safe.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: use hashmap for attribute dictionary</title>
<updated>2017-02-01T21:46:53Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-28T02:02:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a600b7555205f80b276659db4fd521658642505'/>
<id>urn:sha1:1a600b7555205f80b276659db4fd521658642505</id>
<content type='text'>
The current implementation of the attribute dictionary uses a custom
hashtable.  This modernizes the dictionary by converting it to the builtin
'hashmap' structure.

Also, in order to enable a threaded API in the future add an
accompanying mutex which must be acquired prior to accessing the
dictionary of interned attributes.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: change validity check for attribute names to use positive logic</title>
<updated>2017-02-01T21:46:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-28T02:02:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=428103c7f1a0cb8bb1432214efa60abc5bd5f198'/>
<id>urn:sha1:428103c7f1a0cb8bb1432214efa60abc5bd5f198</id>
<content type='text'>
Convert 'invalid_attr_name()' to 'attr_name_valid()' and use positive
logic for the return value.  In addition create a helper function that
prints out an error message when an invalid attribute name is used.

We could later update the message to exactly spell out what the
rules for a good attribute name are, etc.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: pass struct attr_check to collect_some_attrs</title>
<updated>2017-02-01T21:46:52Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-28T02:01:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6bc2e3f709d04e416f3b5d1e23f2ac31f4cbc1d1'/>
<id>urn:sha1:6bc2e3f709d04e416f3b5d1e23f2ac31f4cbc1d1</id>
<content type='text'>
The old callchain used to take an array of attr_check_item items.
Instead pass the 'attr_check' container object to 'collect_some_attrs()'
and access the fields in the data structure directly.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
