<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/archive.c, branch v2.2.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.2.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.2.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-10-08T20:05:26Z</updated>
<entry>
<title>Merge branch 'nd/archive-pathspec'</title>
<updated>2014-10-08T20:05:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-08T20:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2c45f5b961b3b5d894fb723d2031e8ff41cadf7'/>
<id>urn:sha1:b2c45f5b961b3b5d894fb723d2031e8ff41cadf7</id>
<content type='text'>
"git archive" learned to filter what gets archived with pathspec.

* nd/archive-pathspec:
  archive: support filtering paths with glob
</content>
</entry>
<entry>
<title>archive: support filtering paths with glob</title>
<updated>2014-09-22T19:04:29Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-09-21T03:55:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed22b4173bd8d6dbce6236480bd30a63dd54834e'/>
<id>urn:sha1:ed22b4173bd8d6dbce6236480bd30a63dd54834e</id>
<content type='text'>
This patch fixes two problems with using :(glob) (or even "*.c"
without ":(glob)").

The first one is we forgot to turn on the 'recursive' flag in struct
pathspec. Without that, tree_entry_interesting() will not mark
potential directories "interesting" so that it can confirm whether
those directories have anything matching the pathspec.

The marking directories interesting has a side effect that we need to
walk inside a directory to realize that there's nothing interested in
there. By that time, 'archive' code has already written the (empty)
directory down. That means lots of empty directories in the result
archive.

This problem is fixed by lazily writing directories down when we know
they are actually needed. There is a theoretical bug in this
implementation: we can't write empty trees/directories that match that
pathspec.

path_exists() is also made stricter in order to detect non-matching
pathspec because when this 'recursive' flag is on, we most likely
match some directories. The easiest way is not consider any
directories "matched".

Noticed-by: Peter Wu &lt;peter@lekensteyn.nl&gt;
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>archive.c: replace `git_config()` with `git_config_get_bool()` family</title>
<updated>2014-08-07T20:33:27Z</updated>
<author>
<name>Tanay Abhra</name>
<email>tanayabh@gmail.com</email>
</author>
<published>2014-08-07T16:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95790ff60d35e6a9e212fa0f9ffedaabddd1182c'/>
<id>urn:sha1:95790ff60d35e6a9e212fa0f9ffedaabddd1182c</id>
<content type='text'>
Use `git_config_get_bool()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra &lt;tanayabh@gmail.com&gt;
Reviewed-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rm/strchrnul-not-strlen'</title>
<updated>2014-03-18T20:51:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-18T20:51:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6f75e48323bc3071495025fd14105e9dffa9e8dd'/>
<id>urn:sha1:6f75e48323bc3071495025fd14105e9dffa9e8dd</id>
<content type='text'>
* rm/strchrnul-not-strlen:
  use strchrnul() in place of strchr() and strlen()
</content>
</entry>
<entry>
<title>use strchrnul() in place of strchr() and strlen()</title>
<updated>2014-03-10T15:35:30Z</updated>
<author>
<name>Rohit Mani</name>
<email>rohit.mani@outlook.com</email>
</author>
<published>2014-03-08T06:48:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2c5495f7b60d6ddcd6a411b48d2f6dbc4a24717a'/>
<id>urn:sha1:2c5495f7b60d6ddcd6a411b48d2f6dbc4a24717a</id>
<content type='text'>
Avoid scanning strings twice, once with strchr() and then with
strlen(), by using strchrnul().

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Rohit Mani &lt;rohit.mani@outlook.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add uploadarchive.allowUnreachable option</title>
<updated>2014-02-28T17:55:37Z</updated>
<author>
<name>Scott J. Goldman</name>
<email>scottjg@github.com</email>
</author>
<published>2014-02-28T10:04:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7671b63211712e5163ed46d4c93d0b75680c886c'/>
<id>urn:sha1:7671b63211712e5163ed46d4c93d0b75680c886c</id>
<content type='text'>
In commit ee27ca4, we started restricting remote git-archive
invocations to only accessing reachable commits. This
matches what upload-pack allows, but does restrict some
useful cases (e.g., HEAD:foo). We loosened this in 0f544ee,
which allows `foo:bar` as long as `foo` is a ref tip.
However, that still doesn't allow many useful things, like:

  1. Commits accessible from a ref, like `foo^:bar`, which
     are reachable

  2. Arbitrary sha1s, even if they are reachable.

We can do a full object-reachability check for these cases,
but it can be quite expensive if the client has sent us the
sha1 of a tree; we have to visit every sub-tree of every
commit in the worst case.

Let's instead give site admins an escape hatch, in case they
prefer the more liberal behavior.  For many sites, the full
object database is public anyway (e.g., if you allow dumb
walker access), or the site admin may simply decide the
security/convenience tradeoff is not worth it.

This patch adds a new config option to disable the
restrictions added in ee27ca4. It defaults to off, meaning
there is no change in behavior by default.

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>archive.c: have SP around arithmetic operators</title>
<updated>2013-10-16T17:27:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-10-15T22:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1cdfb54f10ca64dc57be0d9184dcb4c9c069eac'/>
<id>urn:sha1:b1cdfb54f10ca64dc57be0d9184dcb4c9c069eac</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>archive: convert to use parse_pathspec</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:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3e743a0d972e8ed3367d74c1152ff66f7cde416'/>
<id>urn:sha1:f3e743a0d972e8ed3367d74c1152ff66f7cde416</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>move struct pathspec and related functions to pathspec.[ch]</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:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64acde94efd2906c3e20560c31c2957ac0b242c4'/>
<id>urn:sha1:64acde94efd2906c3e20560c31c2957ac0b242c4</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>archive: handle commits with an empty tree</title>
<updated>2013-03-11T05:25:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-03-11T01:32:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bd54cf17a4acfb9555b8a83b7e74fb0274c38bb4'/>
<id>urn:sha1:bd54cf17a4acfb9555b8a83b7e74fb0274c38bb4</id>
<content type='text'>
git-archive relies on get_pathspec to convert its argv into
a list of pathspecs. When get_pathspec is given an empty
argv list, it returns a single pathspec, the empty string,
to indicate that everything matches. When we feed this to
our path_exists function, we typically see that the pathspec
turns up at least one item in the tree, and we are happy.

But when our tree is empty, we erroneously think it is
because the pathspec is too limited, when in fact it is
simply that there is nothing to be found in the tree. This
is a weird corner case, but the correct behavior is almost
certainly to produce an empty archive, not to exit with an
error.

This patch teaches git-archive to create empty archives when
there is no pathspec given (we continue to complain if a
pathspec is given, since it obviously is not matched). It
also confirms that the tar and zip writers produce sane
output in this instance.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
