<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/tree-diff.c, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-02-05T18:49:07Z</updated>
<entry>
<title>tree-diff: convert diff_root_tree_sha1() to just call diff_tree_sha1 with old=NULL</title>
<updated>2014-02-05T18:49:07Z</updated>
<author>
<name>Kirill Smelkov</name>
<email>kirr@mns.spb.ru</email>
</author>
<published>2014-02-05T16:57:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b707c3319f37f2ec3700638d62f3199af40c138'/>
<id>urn:sha1:0b707c3319f37f2ec3700638d62f3199af40c138</id>
<content type='text'>
Now since diff_tree_sha1 understands NULL for both old and new, we could
indicate an empty tree for root commit by providing just NULL for old
sha1.

Signed-off-by: Kirill Smelkov &lt;kirr@mns.spb.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree-diff: allow diff_tree_sha1 to accept NULL sha1</title>
<updated>2014-02-05T18:48:14Z</updated>
<author>
<name>Kirill Smelkov</name>
<email>kirr@mns.spb.ru</email>
</author>
<published>2014-02-05T16:57:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=791303284cb3ede61729e33112d6923df406161f'/>
<id>urn:sha1:791303284cb3ede61729e33112d6923df406161f</id>
<content type='text'>
which would mean that corresponding tree - old or new - is empty.

As followup patches will show, that functionality was already needed in
several places of Git codebase, but there, we were preparing empty
tree_desc objects by hand, with some code duplication.

For handling sha1 = NULL case, let's reuse fill_tree_descriptor() which
returns just empty tree_desc in that case.

Signed-off-by: Kirill Smelkov &lt;kirr@mns.spb.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: stop --*-pathspecs impact on internal parse_pathspec() uses</title>
<updated>2013-10-28T16:57:36Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-10-26T02:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4a2d5ae262a6d372d0951da9cee3c7ad2a8dbca6'/>
<id>urn:sha1:4a2d5ae262a6d372d0951da9cee3c7ad2a8dbca6</id>
<content type='text'>
Normally parse_pathspec() is used on command line arguments where it
can do fancy thing like parsing magic on each argument or adding magic
for all pathspecs based on --*-pathspecs options.

There's another use of parse_pathspec(), where pathspec is needed, but
the input is known to be pure paths. In this case we usually don't
want --*-pathspecs to interfere. And we definitely do not want to
parse magic in these paths, regardless of --literal-pathspecs.

Add new flag PATHSPEC_LITERAL_PATH for this purpose. When it's set,
--*-pathspecs are ignored, no magic is parsed. And if the caller
allows PATHSPEC_LITERAL (i.e. the next calls can take literal magic),
then PATHSPEC_LITERAL will be set.

This fixes cases where git chokes when GIT_*_PATHSPECS are set because
parse_pathspec() indicates it won't take any magic. But
GIT_*_PATHSPECS add them anyway. These are

   export GIT_LITERAL_PATHSPECS=1
   git blame -- something
   git log --follow something
   git log --merge

"git ls-files --with-tree=path" (aka parse_pathspec() in
overlay_tree_on_cache()) is safe because the input is empty, and
producing one pathspec due to PATHSPEC_PREFER_CWD does not take any
magic into account.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: support :(literal) syntax for noglob pathspec</title>
<updated>2013-07-15T17:56:09Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:36:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c6933d201fab183a9779dca0fe43bf2f1eca098'/>
<id>urn:sha1:5c6933d201fab183a9779dca0fe43bf2f1eca098</id>
<content type='text'>
Signed-off-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>tree-diff: remove the use of pathspec's raw[] in follow-rename codepath</title>
<updated>2013-07-15T17:56:09Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:36:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=61588ccf78373f5211ecdc56d53f0e17d04283fe'/>
<id>urn:sha1:61588ccf78373f5211ecdc56d53f0e17d04283fe</id>
<content type='text'>
Put a checkpoint to guard unsupported pathspec features in future.

Signed-off-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>remove init_pathspec() in favor of parse_pathspec()</title>
<updated>2013-07-15T17:56:09Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:35:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a0872744315da67db3c81eb9270751e31fcc8f5'/>
<id>urn:sha1:9a0872744315da67db3c81eb9270751e31fcc8f5</id>
<content type='text'>
While at there, move free_pathspec() to pathspec.c

Signed-off-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>remove diff_tree_{setup,release}_paths</title>
<updated>2013-07-15T17:56:09Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:35:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bd1928df1d1cc6a10a7b275694d3504d9a041fae'/>
<id>urn:sha1:bd1928df1d1cc6a10a7b275694d3504d9a041fae</id>
<content type='text'>
Signed-off-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>guard against new pathspec magic in pathspec matching code</title>
<updated>2013-07-15T17:56:07Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:35:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8f4f8f4579fe8cc630e118cc736de2b8d5cf8e34'/>
<id>urn:sha1:8f4f8f4579fe8cc630e118cc736de2b8d5cf8e34</id>
<content type='text'>
GUARD_PATHSPEC() marks pathspec-sensitive code, basically all those
that touch anything in 'struct pathspec' except fields "nr" and
"original". GUARD_PATHSPEC() is not supposed to fail. It's mainly to
help the designers catch unsupported codepaths.

Signed-off-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>parse_pathspec: add special flag for max_depth feature</title>
<updated>2013-07-15T17:56:06Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-14T08:35:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6330a171996abbec7dac48788de851aea7d0a18f'/>
<id>urn:sha1:6330a171996abbec7dac48788de851aea7d0a18f</id>
<content type='text'>
match_pathspec_depth() and tree_entry_interesting() check max_depth
field in order to support "git grep --max-depth". The feature
activation is tied to "recursive" field, which led to some unwanted
activation, e.g. 5c8eeb8 (diff-index: enable recursive pathspec
matching in unpack_trees - 2012-01-15).

This patch decouples the activation from "recursive" field, puts it in
"magic" field instead. This makes sure that only "git grep" can
activate this feature. And because parse_pathspec knows when the
feature is not used, it does not need to sort pathspec (required for
max_depth to work correctly). A small win for non-grep cases.

Even though a new magic flag is introduced, no magic syntax is. The
magic can be only enabled by parse_pathspec() caller. We might someday
want to support ":(maxdepth:10)src." It all depends on actual use
cases.

max_depth feature cannot be enabled via init_pathspec() anymore. But
that's ok because init_pathspec() is on its way to /dev/null.

Signed-off-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>Merge branch 'jk/maint-null-in-trees'</title>
<updated>2012-08-27T18:54:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-08-27T18:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b753148b636be9dc821feebf85cd7f1739b07a1'/>
<id>urn:sha1:3b753148b636be9dc821feebf85cd7f1739b07a1</id>
<content type='text'>
We do not want a link to 0{40} object stored anywhere in our objects.

* jk/maint-null-in-trees:
  fsck: detect null sha1 in tree entries
  do not write null sha1s to on-disk index
  diff: do not use null sha1 as a sentinel value
</content>
</entry>
</feed>
