<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/connected.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>2016-10-10T20:54:02Z</updated>
<entry>
<title>check_connected: accept an env argument</title>
<updated>2016-10-10T20:54:02Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-03T20:49:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=526f108a271b331af9ae92796215e560e5ec4677'/>
<id>urn:sha1:526f108a271b331af9ae92796215e560e5ec4677</id>
<content type='text'>
This lets callers influence the environment seen by
rev-list, which will be useful when we start providing
quarantined objects.

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>check_connected: add progress flag</title>
<updated>2016-07-20T19:11:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-07-15T10:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=70d5e2d77b4c2afdb442b37924bc252793e106d9'/>
<id>urn:sha1:70d5e2d77b4c2afdb442b37924bc252793e106d9</id>
<content type='text'>
Connectivity checks have to traverse the entire object graph
in the worst case (e.g., a full clone or a full push). For
large repositories like linux.git, this can take 30-60
seconds, during which time git may produce little or no
output.

Let's add the option of showing progress, which is taken
care of by rev-list.

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>check_connected: relay errors to alternate descriptor</title>
<updated>2016-07-20T19:11:01Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-07-15T10:32:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0331849a081fe4919f4130540165ce7d7355748'/>
<id>urn:sha1:e0331849a081fe4919f4130540165ce7d7355748</id>
<content type='text'>
Unless the "quiet" flag is given, check_connected sends any
errors to the stderr of the caller (because the child
rev-list inherits that descriptor). However, server-side
callers may want to send these over a sideband channel
instead.  Let's make that possible.

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>check_everything_connected: use a struct with named options</title>
<updated>2016-07-20T19:10:53Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-07-15T10:30:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7043c7071cdbdef60ce8413f425da622b8e6dc85'/>
<id>urn:sha1:7043c7071cdbdef60ce8413f425da622b8e6dc85</id>
<content type='text'>
The number of variants of check_everything_connected has
grown over the years, so that the "real" function takes
several possibly-zero, possibly-NULL arguments. We hid the
complexity behind some wrapper functions, but this doesn't
scale well when we want to add new options.

If we add more wrapper variants to handle the new options,
then we can get a combinatorial explosion when those options
might be used together (right now nobody wants to use both
"shallow" and "transport" together, so we get by with just a
few wrappers).

If instead we add new parameters to each function, each of
which can have a default value, then callers who want the
defaults end up with confusing invocations like:

  check_everything_connected(fn, 0, data, -1, 0, NULL);

where it is unclear which parameter is which (and every
caller needs updated when we add new options).

Instead, let's add a struct to hold all of the optional
parameters. This is a little more verbose for the callers
(who have to declare the struct and fill it in), but it
makes their code much easier to follow, because every option
is named as it is set (and unused options do not have to be
mentioned at all).

Note that we could also stick the iteration function and its
callback data into the option struct, too. But since those
are required for each call, by avoiding doing so, we can let
very simple callers just pass "NULL" for the options and not
worry about the struct at all.

While we're touching each site, let's also rename the
function to check_connected(). The existing name was quite
long, and not all of the wrappers even used the full name.

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>check_everything_connected: convert to argv_array</title>
<updated>2016-07-20T19:10:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-07-15T10:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3be89f9b86cb3891a7865ad004230a50977e3d8c'/>
<id>urn:sha1:3be89f9b86cb3891a7865ad004230a50977e3d8c</id>
<content type='text'>
This avoids the magic "9" array-size which we must avoid
overflowing, making further patches simpler.

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>check_everything_connected: always pass --quiet to rev-list</title>
<updated>2016-07-20T19:09:31Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-07-15T10:26:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f26eef302fc315394d1016eb06360637ac86f62e'/>
<id>urn:sha1:f26eef302fc315394d1016eb06360637ac86f62e</id>
<content type='text'>
The check_everything_connected function takes a "quiet"
parameter which does two things if non-zero:

  1. redirect rev-list's stderr to /dev/null to avoid
     showing errors to the user

  2. pass "--quiet" to rev-list

Item (1) is obviously useful. But item (2) is
surprisingly not. For rev-list, "--quiet" does not have
anything to do with chattiness on stderr; it tells rev-list
not to bother writing the list of traversed objects to
stdout, for efficiency.  And since we always redirect
rev-list's stdout to /dev/null in this function, there is no
point in asking it to ever write anything to stdout.

The efficiency gains are modest; a best-of-five run of "git
rev-list --objects --all" on linux.git dropped from 32.013s
to 30.502s when adding "--quiet". That's only about 5%, but
given how easy it is, it's worth doing.

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>connected.c: use error_errno()</title>
<updated>2016-05-09T19:29:08Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-05-08T09:47:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5cc026e218d0ad3962d10c0775fe9b5ac68eed09'/>
<id>urn:sha1:5cc026e218d0ad3962d10c0775fe9b5ac68eed09</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>run-command: introduce CHILD_PROCESS_INIT</title>
<updated>2014-08-20T16:53:37Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-08-19T19:09:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d3180279322c7450a47decf8833de47f444ca93f'/>
<id>urn:sha1:d3180279322c7450a47decf8833de47f444ca93f</id>
<content type='text'>
Most struct child_process variables are cleared using memset first after
declaration.  Provide a macro, CHILD_PROCESS_INIT, that can be used to
initialize them statically instead.  That's shorter, doesn't require a
function call and is slightly more readable (especially given that we
already have STRBUF_INIT, ARGV_ARRAY_INIT etc.).

Helped-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
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>use strip_suffix instead of ends_with in simple cases</title>
<updated>2014-06-30T20:43:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-30T16:58:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=26936bfd9bde1ec46901bea3e53d4fb9ae1b4a4c'/>
<id>urn:sha1:26936bfd9bde1ec46901bea3e53d4fb9ae1b4a4c</id>
<content type='text'>
When stripping a suffix like:

  if (ends_with(str, "foo"))
	buf = xmemdupz(str, strlen(str) - 3);

we can instead use strip_suffix to avoid the constant 3,
which must match the literal "foo" (we sometimes use
strlen("foo") instead, but that means we are repeating
ourselves). The example above becomes:

  if (strip_suffix(str, "foo", &amp;len))
	buf = xmemdupz(str, len);

This also saves a strlen(), since we calculate the string
length when detecting the suffix.

Note that in some cases we also switch from xstrndup to
xmemdupz, which saves a further strlen call.

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 'nd/shallow-clone'</title>
<updated>2014-01-17T20:21:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-01-17T20:21:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=92251b1b5b5e53ac9de890105e2a2bd9d15e2ecb'/>
<id>urn:sha1:92251b1b5b5e53ac9de890105e2a2bd9d15e2ecb</id>
<content type='text'>
Fetching from a shallow-cloned repository used to be forbidden,
primarily because the codepaths involved were not carefully vetted
and we did not bother supporting such usage. This attempts to allow
object transfer out of a shallow-cloned repository in a controlled
way (i.e. the receiver become a shallow repository with truncated
history).

* nd/shallow-clone: (31 commits)
  t5537: fix incorrect expectation in test case 10
  shallow: remove unused code
  send-pack.c: mark a file-local function static
  git-clone.txt: remove shallow clone limitations
  prune: clean .git/shallow after pruning objects
  clone: use git protocol for cloning shallow repo locally
  send-pack: support pushing from a shallow clone via http
  receive-pack: support pushing to a shallow clone via http
  smart-http: support shallow fetch/clone
  remote-curl: pass ref SHA-1 to fetch-pack as well
  send-pack: support pushing to a shallow clone
  receive-pack: allow pushes that update .git/shallow
  connected.c: add new variant that runs with --shallow-file
  add GIT_SHALLOW_FILE to propagate --shallow-file to subprocesses
  receive/send-pack: support pushing from a shallow clone
  receive-pack: reorder some code in unpack()
  fetch: add --update-shallow to accept refs that update .git/shallow
  upload-pack: make sure deepening preserves shallow roots
  fetch: support fetching from a shallow repository
  clone: support remote shallow repository
  ...
</content>
</entry>
</feed>
