<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.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-06-13T20:27:02Z</updated>
<entry>
<title>Merge branch 'sl/clean-d-ignored-fix' into maint</title>
<updated>2017-06-13T20:27:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-13T20:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f4683b4e9cad5e0077fe0a067b15f69c828581bb'/>
<id>urn:sha1:f4683b4e9cad5e0077fe0a067b15f69c828581bb</id>
<content type='text'>
"git clean -d" used to clean directories that has ignored files,
even though the command should not lose ignored ones without "-x".
"git status --ignored"  did not list ignored and untracked files
without "-uall".  These have been corrected.

* sl/clean-d-ignored-fix:
  clean: teach clean -d to preserve ignored paths
  dir: expose cmp_name() and check_contains()
  dir: hide untracked contents of untracked dirs
  dir: recurse into untracked dirs for ignored files
  t7061: status --ignored should search untracked dirs
  t7300: clean -d should skip dirs with ignored files
</content>
</entry>
<entry>
<title>dir: expose cmp_name() and check_contains()</title>
<updated>2017-05-22T03:14:13Z</updated>
<author>
<name>Samuel Lijin</name>
<email>sxlijin@gmail.com</email>
</author>
<published>2017-05-18T08:21:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bbf504a9957e8a2a262619641ffa30348d71a76f'/>
<id>urn:sha1:bbf504a9957e8a2a262619641ffa30348d71a76f</id>
<content type='text'>
We want to use cmp_name() and check_contains() (which both compare
`struct dir_entry`s, the former in terms of the sort order, the latter
in terms of whether one lexically contains another) outside of dir.c,
so we have to (1) change their linkage and (2) rename them as
appropriate for the global namespace. The second is achieved by
renaming cmp_name() to cmp_dir_entry() and check_contains() to
check_dir_entry_contains().

Signed-off-by: Samuel Lijin &lt;sxlijin@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir: hide untracked contents of untracked dirs</title>
<updated>2017-05-22T03:14:09Z</updated>
<author>
<name>Samuel Lijin</name>
<email>sxlijin@gmail.com</email>
</author>
<published>2017-05-18T08:21:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fb898888491b83c9a3396fb559032ca78807a0c0'/>
<id>urn:sha1:fb898888491b83c9a3396fb559032ca78807a0c0</id>
<content type='text'>
When we taught read_directory_recursive() to recurse into untracked
directories in search of ignored files given DIR_SHOW_IGNORED_TOO, that
had the side effect of teaching it to collect the untracked contents of
untracked directories. It doesn't always make sense to return these,
though (we do need them for `clean -d`), so we introduce a flag
(DIR_KEEP_UNTRACKED_CONTENTS) to control whether or not read_directory()
strips dir-&gt;entries of the untracked contents of untracked dirs.

We also introduce check_contains() to check if one dir_entry corresponds
to a path which contains the path corresponding to another dir_entry.

This also fixes known breakages in t7061, since status --ignored now
searches untracked directories for ignored files.

Signed-off-by: Samuel Lijin &lt;sxlijin@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir: recurse into untracked dirs for ignored files</title>
<updated>2017-05-22T03:06:52Z</updated>
<author>
<name>Samuel Lijin</name>
<email>sxlijin@gmail.com</email>
</author>
<published>2017-05-18T08:21:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df5bcdf83aeb94718602ebc8c0f597166bb493f1'/>
<id>urn:sha1:df5bcdf83aeb94718602ebc8c0f597166bb493f1</id>
<content type='text'>
We consider directories containing only untracked and ignored files to
be themselves untracked, which in the usual case means we don't have to
search these directories. This is problematic when we want to collect
ignored files with DIR_SHOW_IGNORED_TOO, though, so we teach
read_directory_recursive() to recurse into untracked directories to find
the ignored files they contain when DIR_SHOW_IGNORED_TOO is set. This
has the side effect of also collecting all untracked files in untracked
directories as well.

Signed-off-by: Samuel Lijin &lt;sxlijin@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/checkout-recurse-submodules'</title>
<updated>2017-03-28T21:05:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-28T21:05:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e394fa01d65a5e182639e226f5b46eca999cd8d7'/>
<id>urn:sha1:e394fa01d65a5e182639e226f5b46eca999cd8d7</id>
<content type='text'>
"git checkout" is taught the "--recurse-submodules" option.

* sb/checkout-recurse-submodules:
  builtin/read-tree: add --recurse-submodules switch
  builtin/checkout: add --recurse-submodules switch
  entry.c: create submodules when interesting
  unpack-trees: check if we can perform the operation for submodules
  unpack-trees: pass old oid to verify_clean_submodule
  update submodules: add submodule_move_head
  submodule.c: get_super_prefix_or_empty
  update submodules: move up prepare_submodule_repo_env
  submodules: introduce check to see whether to touch a submodule
  update submodules: add a config option to determine if submodules are updated
  update submodules: add submodule config parsing
  make is_submodule_populated gently
  lib-submodule-update.sh: define tests for recursing into submodules
  lib-submodule-update.sh: replace sha1 by hash
  lib-submodule-update: teach test_submodule_content the -C &lt;dir&gt; flag
  lib-submodule-update.sh: do not use ./. as submodule remote
  lib-submodule-update.sh: reorder create_lib_submodule_repo
  submodule--helper.c: remove duplicate code
  connect_work_tree_and_git_dir: safely create leading directories
</content>
</entry>
<entry>
<title>Merge branch 'bw/attr-pathspec'</title>
<updated>2017-03-17T20:50:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-17T20:50:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f6c64c648ade843b44d517b2de41b8b882f112c0'/>
<id>urn:sha1:f6c64c648ade843b44d517b2de41b8b882f112c0</id>
<content type='text'>
The pathspec mechanism learned to further limit the paths that
match the pattern to those that have specified attributes attached
via the gitattributes mechanism.

* bw/attr-pathspec:
  pathspec: allow escaped query values
  pathspec: allow querying for attributes
</content>
</entry>
<entry>
<title>connect_work_tree_and_git_dir: safely create leading directories</title>
<updated>2017-03-16T01:15:53Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-03-14T21:46:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=365444a6a55391e192662964d523e2b0887557bd'/>
<id>urn:sha1:365444a6a55391e192662964d523e2b0887557bd</id>
<content type='text'>
In a later patch we'll use connect_work_tree_and_git_dir when the
directory for the gitlink file doesn't exist yet. This patch makes
connect_work_tree_and_git_dir safe to use for both cases of
either the git dir or the working dir missing.

To do so, we need to call safe_create_leading_directories[_const]
on both directories. However this has to happen before we construct
the absolute paths as real_pathdup assumes the directories to
be there already.

So for both the config file in the git dir as well as the .git link
file we need to
a) construct the name
b) call SCLD
c) get the absolute path
d) once a-c is done for both we can consume the absolute path
   to compute the relative path to each other and store those
   relative paths.

The implementation provided here puts a) and b) for both cases first,
and then performs c and d after.

One of the two users of 'connect_work_tree_and_git_dir' already checked
for the directory being there, so we can loose that check as
connect_work_tree_and_git_dir handles this functionality now.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>real_pathdup(): fix callsites that wanted it to die on error</title>
<updated>2017-03-08T22:38:41Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-03-08T15:43:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce83eadd9a2c63db6263df91933da1b1b865d26a'/>
<id>urn:sha1:ce83eadd9a2c63db6263df91933da1b1b865d26a</id>
<content type='text'>
In 4ac9006f832 (real_path: have callers use real_pathdup and
strbuf_realpath, 2016-12-12), we changed the xstrdup(real_path())
pattern to use real_pathdup() directly.

The problem with this change is that real_path() calls
strbuf_realpath() with die_on_error = 1 while real_pathdup() calls
it with die_on_error = 0. Meaning that in cases where real_path()
causes Git to die() with an error message, real_pathdup() is silent
and returns NULL instead.

The callers, however, are ill-prepared for that change, as they expect
the return value to be non-NULL (and otherwise the function died
with an appropriate error message).

Fix this by extending real_pathdup()'s signature to accept the
die_on_error flag and simply pass it through to strbuf_realpath(),
and then adjust all callers after a careful audit whether they would
handle NULLs well.

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>dir: avoid allocation in fill_directory()</title>
<updated>2017-02-08T21:38:41Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-02-07T22:04:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bec5ab8997c2391fa2241520f52f301397ebd538'/>
<id>urn:sha1:bec5ab8997c2391fa2241520f52f301397ebd538</id>
<content type='text'>
Pass the match member of the first pathspec item directly to
read_directory() instead of using common_prefix() to duplicate it first,
thus avoiding memory duplication, strlen(3) and free(3).

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>
</feed>
