<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/attr.c, branch v2.45.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-12-28T21:21:52Z</updated>
<entry>
<title>attr: add builtin objectmode values support</title>
<updated>2023-12-28T21:21:52Z</updated>
<author>
<name>Joanna Wang</name>
<email>jojwang@google.com</email>
</author>
<published>2023-11-16T05:44:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2232a88ab6bfbe41faf73f85912937e20bf8b4ee'/>
<id>urn:sha1:2232a88ab6bfbe41faf73f85912937e20bf8b4ee</id>
<content type='text'>
Gives all paths builtin objectmode values based on the paths' modes
(one of 100644, 100755, 120000, 040000, 160000). Users may use
this feature to filter by file types. For example a pathspec such as
':(attr:builtin_objectmode=160000)' could filter for submodules without
needing to have `builtin_objectmode=160000` to be set in .gitattributes
for every submodule path.

These values are also reflected in `git check-attr` results.
If the git_attr_direction is set to GIT_ATTR_INDEX or GIT_ATTR_CHECKIN
and a path is not found in the index, the value will be unspecified.

This patch also reserves the builtin_* attribute namespace for objectmode
and any future builtin attributes. Any user defined attributes using this
reserved namespace will result in a warning. This is a breaking change for
any existing builtin_* attributes.
Pathspecs with some builtin_* attribute name (excluding builtin_objectmode)
will behave like any attribute where there are no user specified values.

Signed-off-by: Joanna Wang &lt;jojwang@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/attr-tree-config'</title>
<updated>2023-10-29T22:09:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-10-29T22:09:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=26dd307cfaabe3d3f0b01aad64969e76a317811a'/>
<id>urn:sha1:26dd307cfaabe3d3f0b01aad64969e76a317811a</id>
<content type='text'>
The attribute subsystem learned to honor `attr.tree` configuration
that specifies which tree to read the .gitattributes files from.

* jc/attr-tree-config:
  attr: add attr.tree for setting the treeish to read attributes from
  attr: read attributes from HEAD when bare repo
</content>
</entry>
<entry>
<title>attr: add attr.tree for setting the treeish to read attributes from</title>
<updated>2023-10-13T18:43:29Z</updated>
<author>
<name>John Cai</name>
<email>johncai86@gmail.com</email>
</author>
<published>2023-10-13T17:39:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9f9c40cf34c29d4ad700d9869435d159056fa6fb'/>
<id>urn:sha1:9f9c40cf34c29d4ad700d9869435d159056fa6fb</id>
<content type='text'>
44451a2 (attr: teach "--attr-source=&lt;tree&gt;" global option to "git",
2023-05-06) provided the ability to pass in a treeish as the attr
source. In the context of serving Git repositories as bare repos like we
do at GitLab however, it would be easier to point --attr-source to HEAD
for all commands by setting it once.

Add a new config attr.tree that allows this.

Signed-off-by: John Cai &lt;johncai86@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: read attributes from HEAD when bare repo</title>
<updated>2023-10-13T18:43:29Z</updated>
<author>
<name>John Cai</name>
<email>johncai86@gmail.com</email>
</author>
<published>2023-10-13T17:39:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2386535511d1181afd4e892e2a866ffe5e1d7d21'/>
<id>urn:sha1:2386535511d1181afd4e892e2a866ffe5e1d7d21</id>
<content type='text'>
The motivation for 44451a2e5e (attr: teach "--attr-source=&lt;tree&gt;" global
option to "git" , 2023-05-06), was to make it possible to use
gitattributes with bare repositories.

To make it easier to read gitattributes in bare repositories however,
let's just make HEAD:.gitattributes the default. This is in line with
how mailmap works, 8c473cecfd (mailmap: default mailmap.blob in bare
repositories, 2012-12-13).

Signed-off-by: John Cai &lt;johncai86@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse: separate out parsing functions from config.h</title>
<updated>2023-09-29T22:14:57Z</updated>
<author>
<name>Calvin Wan</name>
<email>calvinwan@google.com</email>
</author>
<published>2023-09-29T21:20:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1bda751739d90e1a94b47397676bcb8eebf16d5'/>
<id>urn:sha1:b1bda751739d90e1a94b47397676bcb8eebf16d5</id>
<content type='text'>
The files config.{h,c} contain functions that have to do with parsing,
but not config.

In order to further reduce all-in-one headers, separate out functions in
config.c that do not operate on config into its own file, parse.h,
and update the include directives in the .c files that need only such
functions accordingly.

Signed-off-by: Calvin Wan &lt;calvinwan@google.com&gt;
Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sl/sparse-check-attr'</title>
<updated>2023-08-29T20:51:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-08-29T20:51:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=354356feffed7b3c72d62cd78fc7575efd5bad42'/>
<id>urn:sha1:354356feffed7b3c72d62cd78fc7575efd5bad42</id>
<content type='text'>
Teach "git check-attr" work better with sparse-index.

* sl/sparse-check-attr:
  check-attr: integrate with sparse-index
  attr.c: read attributes in a sparse directory
  t1092: add tests for 'git check-attr'
</content>
</entry>
<entry>
<title>attr.c: read attributes in a sparse directory</title>
<updated>2023-08-11T16:44:51Z</updated>
<author>
<name>Shuqi Liang</name>
<email>cheskaqiqi@gmail.com</email>
</author>
<published>2023-08-11T14:22:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4723ae1007f94cbb391c4fb5a042adccd038d9ae'/>
<id>urn:sha1:4723ae1007f94cbb391c4fb5a042adccd038d9ae</id>
<content type='text'>
Before this patch, git check-attr was unable to read the attributes from
a .gitattributes file within a sparse directory. The original comment
was operating under the assumption that users are only interested in
files or directories inside the cones. Therefore, in the original code,
in the case of a cone-mode sparse-checkout, we didn't load the
.gitattributes file.

However, this behavior can lead to missing attributes for files inside
sparse directories, causing inconsistencies in file handling.

To resolve this, revise 'git check-attr' to allow attribute reading for
files in sparse directories from the corresponding .gitattributes files:

1.Utilize path_in_cone_mode_sparse_checkout() and index_name_pos_sparse
to check if a path falls within a sparse directory.

2.If path is inside a sparse directory, employ the value of
index_name_pos_sparse() to find the sparse directory containing path and
path relative to sparse directory. Proceed to read attributes from the
tree OID of the sparse directory using read_attr_from_blob().

3.If path is not inside a sparse directory，ensure that attributes are
fetched from the index blob with read_blob_data_from_index().

Change the test 'check-attr with pathspec outside sparse definition' to
'test_expect_success' to reflect that the attributes inside a sparse
directory can now be read. Ensure that the sparse index case works
correctly for git check-attr to illustrate the successful handling of
attributes within sparse directories.

Helped-by: Victoria Dye &lt;vdye@github.com&gt;
Signed-off-by: Shuqi Liang &lt;cheskaqiqi@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cw/compat-util-header-cleanup'</title>
<updated>2023-07-17T18:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-07-17T18:30:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce481ac8b31c9061eeecd1ba0d7174b621f96632'/>
<id>urn:sha1:ce481ac8b31c9061eeecd1ba0d7174b621f96632</id>
<content type='text'>
Further shuffling of declarations across header files to streamline
file dependencies.

* cw/compat-util-header-cleanup:
  git-compat-util: move alloc macros to git-compat-util.h
  treewide: remove unnecessary includes for wrapper.h
  kwset: move translation table from ctype
  sane-ctype.h: create header for sane-ctype macros
  git-compat-util: move wrapper.c funcs to its header
  git-compat-util: move strbuf.c funcs to its header
</content>
</entry>
<entry>
<title>git-compat-util: move alloc macros to git-compat-util.h</title>
<updated>2023-07-05T18:42:31Z</updated>
<author>
<name>Calvin Wan</name>
<email>calvinwan@google.com</email>
</author>
<published>2023-07-05T17:09:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=91c080dff511b7a81f91d1cc79589b49e16a2b7a'/>
<id>urn:sha1:91c080dff511b7a81f91d1cc79589b49e16a2b7a</id>
<content type='text'>
alloc_nr, ALLOC_GROW, and ALLOC_GROW_BY are commonly used macros for
dynamic array allocation. Moving these macros to git-compat-util.h with
the other alloc macros focuses alloc.[ch] to allocation for Git objects
and additionally allows us to remove inclusions to alloc.h from files
that solely used the above macros.

Signed-off-by: Calvin Wan &lt;calvinwan@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bc/more-git-var'</title>
<updated>2023-07-04T23:08:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-07-04T23:08:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89d62d5e8ef42be3a73493e8ffbede589c7a31d1'/>
<id>urn:sha1:89d62d5e8ef42be3a73493e8ffbede589c7a31d1</id>
<content type='text'>
Add more "git var" for toolsmiths to learn various locations Git is
configured with either via the configuration or hardcoded defaults.

* bc/more-git-var:
  var: add config file locations
  var: add attributes files locations
  attr: expose and rename accessor functions
  var: adjust memory allocation for strings
  var: format variable structure with C99 initializers
  var: add support for listing the shell
  t: add a function to check executable bit
  var: mark unused parameters in git_var callbacks
</content>
</entry>
</feed>
