<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/attr.c, branch v2.34.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.34.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.34.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-09-08T05:41:10Z</updated>
<entry>
<title>attr: be careful about sparse directories</title>
<updated>2021-09-08T05:41:10Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-09-08T01:42:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77efbb366abe53792511580b96a39c636c5b0401'/>
<id>urn:sha1:77efbb366abe53792511580b96a39c636c5b0401</id>
<content type='text'>
Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>*: fix typos which duplicate a word</title>
<updated>2021-06-14T01:16:06Z</updated>
<author>
<name>Andrei Rybak</name>
<email>rybak.a.v@gmail.com</email>
</author>
<published>2021-06-11T11:18:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=abcb66c614c574cfa1afccb230bf22cbde4d5557'/>
<id>urn:sha1:abcb66c614c574cfa1afccb230bf22cbde4d5557</id>
<content type='text'>
Fix typos in documentation, code comments, and RelNotes which repeat
various words.  In trivial cases, just delete the duplicated word and
rewrap text, if needed.  Reword the affected sentence in
Documentation/RelNotes/1.8.4.txt for it to make sense.

Signed-off-by: Andrei Rybak &lt;rybak.a.v@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ds/sparse-index-protections'</title>
<updated>2021-04-30T04:50:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-30T04:50:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e97852919fa422bc5fe57bc7e71826cf2b5224d'/>
<id>urn:sha1:8e97852919fa422bc5fe57bc7e71826cf2b5224d</id>
<content type='text'>
Builds on top of the sparse-index infrastructure to mark operations
that are not ready to mark with the sparse index, causing them to
fall back on fully-populated index that they always have worked with.

* ds/sparse-index-protections: (47 commits)
  name-hash: use expand_to_path()
  sparse-index: expand_to_path()
  name-hash: don't add directories to name_hash
  revision: ensure full index
  resolve-undo: ensure full index
  read-cache: ensure full index
  pathspec: ensure full index
  merge-recursive: ensure full index
  entry: ensure full index
  dir: ensure full index
  update-index: ensure full index
  stash: ensure full index
  rm: ensure full index
  merge-index: ensure full index
  ls-files: ensure full index
  grep: ensure full index
  fsck: ensure full index
  difftool: ensure full index
  commit: ensure full index
  checkout: ensure full index
  ...
</content>
</entry>
<entry>
<title>*: remove 'const' qualifier for struct index_state</title>
<updated>2021-04-14T20:46:00Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-04-01T01:49:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=847a9e5d4f876646e128c89f0818b1a8ce792509'/>
<id>urn:sha1:847a9e5d4f876646e128c89f0818b1a8ce792509</id>
<content type='text'>
Several methods specify that they take a 'struct index_state' pointer
with the 'const' qualifier because they intend to only query the data,
not change it. However, we will be introducing a step very low in the
method stack that might modify a sparse-index to become a full index in
the case that our queries venture inside a sparse-directory entry.

This change only removes the 'const' qualifiers that are necessary for
the following change which will actually modify the implementation of
index_name_stage_pos().

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/open-dotgitx-with-nofollow'</title>
<updated>2021-03-22T21:00:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-03-22T21:00:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=204333b015a663a339c855c72b86034203b66a6a'/>
<id>urn:sha1:204333b015a663a339c855c72b86034203b66a6a</id>
<content type='text'>
It does not make sense to make ".gitattributes", ".gitignore" and
".mailmap" symlinks, as they are supposed to be usable from the
object store (think: bare repositories where HEAD:.mailmap etc. are
used).  When these files are symbolic links, we used to read the
contents of the files pointed by them by mistake, which has been
corrected.

* jk/open-dotgitx-with-nofollow:
  mailmap: do not respect symlinks for in-tree .mailmap
  exclude: do not respect symlinks for in-tree .gitignore
  attr: do not respect symlinks for in-tree .gitattributes
  exclude: add flags parameter to add_patterns()
  attr: convert "macro_ok" into a flags field
  add open_nofollow() helper
</content>
</entry>
<entry>
<title>use CALLOC_ARRAY</title>
<updated>2021-03-14T00:00:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-03-13T16:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca56dadb4b65ccaeab809d80db80a312dc00941a'/>
<id>urn:sha1:ca56dadb4b65ccaeab809d80db80a312dc00941a</id>
<content type='text'>
Add and apply a semantic patch for converting code that open-codes
CALLOC_ARRAY to use it instead.  It shortens the code and infers the
element size automatically.

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>attr: do not respect symlinks for in-tree .gitattributes</title>
<updated>2021-02-16T17:41:33Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-02-16T14:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ef579e261fcd85a4eb6e0ce98ee4a01625fc210'/>
<id>urn:sha1:2ef579e261fcd85a4eb6e0ce98ee4a01625fc210</id>
<content type='text'>
The attributes system may sometimes read in-tree files from the
filesystem, and sometimes from the index. In the latter case, we do not
resolve symbolic links (and are not likely to ever start doing so).
Let's open filesystem links with O_NOFOLLOW so that the two cases behave
consistently.

As a bonus, this means that git will not follow such symlinks to read
and parse out-of-tree paths. In some cases this could have security
implications, as a malicious repository can cause Git to open and read
arbitrary files. It could already feed arbitrary content to the parser,
but in certain setups it might be able to exfiltrate data from those
paths (e.g., if an automated service operating on the malicious repo
reveals its stderr to an attacker).

Note that O_NOFOLLOW only prevents following links for the path itself,
not intermediate directories in the path.  At first glance, it seems
like

  ln -s /some/path in-repo

might still look at "in-repo/.gitattributes", following the symlink to
"/some/path/.gitattributes". However, if "in-repo" is a symbolic link,
then we know that it has no git paths below it, and will never look at
its .gitattributes file.

We will continue to support out-of-tree symbolic links (e.g., in
$GIT_DIR/info/attributes); this just affects in-tree links. When a
symbolic link is encountered, the contents are ignored and a warning is
printed. POSIX specifies ELOOP in this case, so the user would generally
see something like:

  warning: unable to access '.gitattributes': Too many levels of symbolic links

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: convert "macro_ok" into a flags field</title>
<updated>2021-02-16T17:41:32Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-02-16T14:44:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbf387d550d679369f3bbbcf2c25ed03f7ff851f'/>
<id>urn:sha1:dbf387d550d679369f3bbbcf2c25ed03f7ff851f</id>
<content type='text'>
The attribute code can have a rather deep callstack, through
which we have to pass the "macro_ok" flag. In anticipation
of adding other flags, let's convert this to a generic
bit-field.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Use new HASHMAP_INIT macro to simplify hashmap initialization</title>
<updated>2020-11-11T20:55:27Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2020-11-11T20:02:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b19315d8ab46ae50410dba9228a4c08ae5c73e38'/>
<id>urn:sha1:b19315d8ab46ae50410dba9228a4c08ae5c73e38</id>
<content type='text'>
Now that hashamp has lazy initialization and a HASHMAP_INIT macro,
hashmaps allocated on the stack can be initialized without a call to
hashmap_init() and in some cases makes the code a bit shorter.  Convert
some callsites over to take advantage of this.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: move doc to attr.h</title>
<updated>2019-11-18T06:21:28Z</updated>
<author>
<name>Heba Waly</name>
<email>heba.waly@gmail.com</email>
</author>
<published>2019-11-17T21:04:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a1b3415d9330cbe3d3cce125b971dff96d0aa4c'/>
<id>urn:sha1:3a1b3415d9330cbe3d3cce125b971dff96d0aa4c</id>
<content type='text'>
Move the documentation from Documentation/technical/api-gitattributes.txt
to attr.h as it's easier for the developers to find the usage
information beside the code instead of looking for it in another doc file.

Also documentation/technical/api-gitattributes.txt is removed because the
information it has is now redundant and it'll be hard to keep it up to
date and synchronized with the documentation in the header file.

Signed-off-by: Heba Waly &lt;heba.waly@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
