<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.c, branch v2.12.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.12.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.12.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-03-08T22:38:41Z</updated>
<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>
<entry>
<title>Merge branch 'bw/realpath-wo-chdir'</title>
<updated>2017-01-18T23:12:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-18T23:12:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1c16df23b19e8d37d896e68c92d8341d6e60b4dc'/>
<id>urn:sha1:1c16df23b19e8d37d896e68c92d8341d6e60b4dc</id>
<content type='text'>
The implementation of "real_path()" was to go there with chdir(2)
and call getcwd(3), but this obviously wouldn't be usable in a
threaded environment.  Rewrite it to manually resolve relative
paths including symbolic links in path components.

* bw/realpath-wo-chdir:
  real_path: set errno when max number of symlinks is exceeded
  real_path: prevent redefinition of MAXSYMLINKS
</content>
</entry>
<entry>
<title>Merge branch 'bw/pathspec-cleanup'</title>
<updated>2017-01-18T23:12:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-18T23:12:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe9ec8bdf65657c11f08f8858bb2a707bdf7aafe'/>
<id>urn:sha1:fe9ec8bdf65657c11f08f8858bb2a707bdf7aafe</id>
<content type='text'>
Code clean-up in the pathspec API.

* bw/pathspec-cleanup:
  pathspec: rename prefix_pathspec to init_pathspec_item
  pathspec: small readability changes
  pathspec: create strip submodule slash helpers
  pathspec: create parse_element_magic helper
  pathspec: create parse_long_magic function
  pathspec: create parse_short_magic function
  pathspec: factor global magic into its own function
  pathspec: simpler logic to prefix original pathspec elements
  pathspec: always show mnemonic and name in unsupported_magic
  pathspec: remove unused variable from unsupported_magic
  pathspec: copy and free owned memory
  pathspec: remove the deprecated get_pathspec function
  ls-tree: convert show_recursive to use the pathspec struct interface
  dir: convert fill_directory to use the pathspec struct interface
  dir: remove struct path_simplify
  mv: remove use of deprecated 'get_pathspec()'
</content>
</entry>
<entry>
<title>dir: convert fill_directory to use the pathspec struct interface</title>
<updated>2017-01-09T02:04:17Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-04T18:03:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=966de3028b190993329d2ed3af4d3d50059f6483'/>
<id>urn:sha1:966de3028b190993329d2ed3af4d3d50059f6483</id>
<content type='text'>
Convert 'fill_directory()' to use the pathspec struct interface from
using the '_raw' entry in the pathspec struct.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Reviewed-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir: remove struct path_simplify</title>
<updated>2017-01-09T02:04:17Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-01-04T18:03:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e1b8c7bdc0ceba64e4d9fa91b951af3d1de18870'/>
<id>urn:sha1:e1b8c7bdc0ceba64e4d9fa91b951af3d1de18870</id>
<content type='text'>
Teach simplify_away() and exclude_matches_pathspec() to handle struct
pathspec directly, eliminating the need for the struct path_simplify.

Also renamed the len parameter to pathlen in exclude_matches_pathspec()
to match the parameter names used in simplify_away().

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Reviewed-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: add absorb-git-dir function</title>
<updated>2016-12-12T23:15:07Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-12-12T19:04:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f6f858614003a3da794385cefdbddf00b85f7501'/>
<id>urn:sha1:f6f858614003a3da794385cefdbddf00b85f7501</id>
<content type='text'>
When a submodule has its git dir inside the working dir, the submodule
support for checkout that we plan to add in a later patch will fail.

Add functionality to migrate the git directory to be absorbed
into the superprojects git directory.

The newly added code in this patch is structured such that other areas of
Git can also make use of it. The code in the submodule--helper is a mere
wrapper and option parser for the function
`absorb_git_dir_into_superproject`, that takes care of embedding the
submodules git directory into the superprojects git dir. That function
makes use of the more abstract function for this use case
`relocate_gitdir`, which can be used by e.g. the worktree code eventually
to move around a git directory.

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>move connect_work_tree_and_git_dir to dir.h</title>
<updated>2016-12-12T23:15:07Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-12-12T19:04:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47e83eb3b7d5410769d7f4d3930ba7fa12915680'/>
<id>urn:sha1:47e83eb3b7d5410769d7f4d3930ba7fa12915680</id>
<content type='text'>
That function was primarily used by submodule code, but the function
itself is not inherently about submodules. In the next patch we'll
introduce relocate_git_dir, which can be used by worktrees as well,
so find a neutral middle ground in dir.h.

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>read info/{attributes,exclude} only when in repository</title>
<updated>2016-10-26T20:30:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-20T06:16:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f0056f6419deb6b4e226976c571f6429875519f1'/>
<id>urn:sha1:f0056f6419deb6b4e226976c571f6429875519f1</id>
<content type='text'>
The low-level attribute and gitignore code will try to look
in $GIT_DIR/info for any repo-level configuration files,
even if we have not actually determined that we are in a
repository (e.g., running "git grep --no-index"). In such a
case they end up looking for ".git/info/attributes", etc.

This is generally harmless, as such a file is unlikely to
exist outside of a repository, but it's still conceptually
the wrong thing to do.

Let's detect this situation explicitly and skip reading the
file (i.e., the same behavior we'd get if we were in a
repository and the file did not exist).

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>Merge branch 'bw/ls-files-recurse-submodules'</title>
<updated>2016-10-26T20:14:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-26T20:14:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1c2b1f7018ba7d5f6a5d949e29e4eaeeef3261e2'/>
<id>urn:sha1:1c2b1f7018ba7d5f6a5d949e29e4eaeeef3261e2</id>
<content type='text'>
"git ls-files" learned "--recurse-submodules" option that can be
used to get a listing of tracked files across submodules (i.e. this
only works with "--cached" option, not for listing untracked or
ignored files).  This would be a useful tool to sit on the upstream
side of a pipe that is read with xargs to work on all working tree
files from the top-level superproject.

* bw/ls-files-recurse-submodules:
  ls-files: add pathspec matching for submodules
  ls-files: pass through safe options for --recurse-submodules
  ls-files: optionally recurse into submodules
  git: make super-prefix option
</content>
</entry>
</feed>
