<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/attr.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-01-23T21:39:51Z</updated>
<entry>
<title>Merge branch 'kn/attr-from-tree'</title>
<updated>2023-01-23T21:39:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-01-23T21:39:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=577bff3a81079ebaf278eb98e10453f65678c135'/>
<id>urn:sha1:577bff3a81079ebaf278eb98e10453f65678c135</id>
<content type='text'>
"git check-attr" learned to take an optional tree-ish to read the
.gitattributes file from.

* kn/attr-from-tree:
  attr: add flag `--source` to work with tree-ish
  t0003: move setup for `--all` into new block
</content>
</entry>
<entry>
<title>Merge branch 'rs/dup-array'</title>
<updated>2023-01-22T01:21:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-01-22T01:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=60ce816cb637f8fac5e8e5b8a53dff8707b2c04c'/>
<id>urn:sha1:60ce816cb637f8fac5e8e5b8a53dff8707b2c04c</id>
<content type='text'>
Code cleaning.

* rs/dup-array:
  use DUP_ARRAY
  add DUP_ARRAY
  do full type check in BARF_UNLESS_COPYABLE
  factor out BARF_UNLESS_COPYABLE
  mingw: make argv2 in try_shell_exec() non-const
</content>
</entry>
<entry>
<title>attr: adjust a mismatched data type</title>
<updated>2023-01-17T14:58:20Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2023-01-12T00:05:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=37537d6472d87098d455b6a0c36885997ea81a85'/>
<id>urn:sha1:37537d6472d87098d455b6a0c36885997ea81a85</id>
<content type='text'>
On platforms where `size_t` does not have the same width as `unsigned
long`, passing a pointer to the former when a pointer to the latter is
expected can lead to problems.

Windows and 32-bit Linux are among the affected platforms.

In this instance, we want to store the size of the blob that was read in
that variable. However, `read_blob_data_from_index()` passes that
pointer to `read_object_file()` which expects an `unsigned long *`.
Which means that on affected platforms, the variable is not fully
populated and part of its value is left uninitialized. (On Big-Endian
platforms, this problem would be even worse.)

The consequence is that depending on the uninitialized memory's
contents, we may erroneously reject perfectly fine attributes.

Let's address this by passing a pointer to a variable of the expected
data type.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: add flag `--source` to work with tree-ish</title>
<updated>2023-01-14T16:49:55Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2023-01-14T08:30:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47cfc9bd7d0add617cf6d928e96b7d207be614f1'/>
<id>urn:sha1:47cfc9bd7d0add617cf6d928e96b7d207be614f1</id>
<content type='text'>
The contents of the .gitattributes files may evolve over time, but "git
check-attr" always checks attributes against them in the working tree
and/or in the index. It may be beneficial to optionally allow the users
to check attributes taken from a commit other than HEAD against paths.

Add a new flag `--source` which will allow users to check the
attributes against a commit (actually any tree-ish would do). When the
user uses this flag, we go through the stack of .gitattributes files but
instead of checking the current working tree and/or in the index, we
check the blobs from the provided tree-ish object. This allows the
command to also be used in bare repositories.

Since we use a tree-ish object, the user can pass "--source
HEAD:subdirectory" and all the attributes will be looked up as if
subdirectory was the root directory of the repository.

We cannot simply use the `&lt;rev&gt;:&lt;path&gt;` syntax without the `--source`
flag, similar to how it is used in `git show` because any non-flag
parameter before `--` is treated as an attribute and any parameter after
`--` is treated as a pathname.

The change involves creating a new function `read_attr_from_blob`, which
given the path reads the blob for the path against the provided source and
parses the attributes line by line. This function is plugged into
`read_attr()` function wherein we go through the stack of attributes
files.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Toon Claes &lt;toon@iotcl.com&gt;
Co-authored-by: toon@iotcl.com
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use DUP_ARRAY</title>
<updated>2023-01-09T04:28:36Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-01-01T21:16:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e578410960d9ceb35ec98ad4b6fc711f1a9c85c'/>
<id>urn:sha1:6e578410960d9ceb35ec98ad4b6fc711f1a9c85c</id>
<content type='text'>
Add a semantic patch for replace ALLOC_ARRAY+COPY_ARRAY with DUP_ARRAY
to reduce code duplication and apply its results.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Sync with Git 2.37.5</title>
<updated>2022-12-13T12:23:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-13T12:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fea9f607a88dc43e479c7c9105663f28b8a0deb9'/>
<id>urn:sha1:fea9f607a88dc43e479c7c9105663f28b8a0deb9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'maint-2.35' into maint-2.36</title>
<updated>2022-12-13T12:19:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-13T12:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8253c0042147e005aecc4fdf24520d1ec2ab1642'/>
<id>urn:sha1:8253c0042147e005aecc4fdf24520d1ec2ab1642</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'maint-2.33' into maint-2.34</title>
<updated>2022-12-13T12:15:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-13T12:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3748b5b7f5648b007dc3743e918ce5eaf44ee6fc'/>
<id>urn:sha1:3748b5b7f5648b007dc3743e918ce5eaf44ee6fc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Sync with Git 2.32.5</title>
<updated>2022-12-13T12:13:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-13T12:13:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f22dcc02df6e69145489c8bec6872e9452688b8'/>
<id>urn:sha1:5f22dcc02df6e69145489c8bec6872e9452688b8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Sync with Git 2.31.6</title>
<updated>2022-12-13T12:09:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-13T12:09:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a755eddf5bf256613bc584f32cd44401a25897c'/>
<id>urn:sha1:8a755eddf5bf256613bc584f32cd44401a25897c</id>
<content type='text'>
</content>
</entry>
</feed>
