<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/remote.c, branch v2.1.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.1.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.1.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-07-09T18:34:05Z</updated>
<entry>
<title>Merge branch 'jk/xstrfmt'</title>
<updated>2014-07-09T18:34:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-09T18:34:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b8e8af187cb86ed030432f1a067121fdd4b1c3b'/>
<id>urn:sha1:3b8e8af187cb86ed030432f1a067121fdd4b1c3b</id>
<content type='text'>
* jk/xstrfmt:
  setup_git_env(): introduce git_path_from_env() helper
  unique_path: fix unlikely heap overflow
  walker_fetch: fix minor memory leak
  merge: use argv_array when spawning merge strategy
  sequencer: use argv_array_pushf
  setup_git_env: use git_pathdup instead of xmalloc + sprintf
  use xstrfmt to replace xmalloc + strcpy/strcat
  use xstrfmt to replace xmalloc + sprintf
  use xstrdup instead of xmalloc + strcpy
  use xstrfmt in favor of manual size calculations
  strbuf: add xstrfmt helper
</content>
</entry>
<entry>
<title>Merge branch 'jk/skip-prefix'</title>
<updated>2014-07-09T18:33:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-09T18:33:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e91ae32a01ffe294b8510c1d8cd7138493a0712f'/>
<id>urn:sha1:e91ae32a01ffe294b8510c1d8cd7138493a0712f</id>
<content type='text'>
* jk/skip-prefix:
  http-push: refactor parsing of remote object names
  imap-send: use skip_prefix instead of using magic numbers
  use skip_prefix to avoid repeated calculations
  git: avoid magic number with skip_prefix
  fetch-pack: refactor parsing in get_ack
  fast-import: refactor parsing of spaces
  stat_opt: check extra strlen call
  daemon: use skip_prefix to avoid magic numbers
  fast-import: use skip_prefix for parsing input
  use skip_prefix to avoid repeating strings
  use skip_prefix to avoid magic numbers
  transport-helper: avoid reading past end-of-string
  fast-import: fix read of uninitialized argv memory
  apply: use skip_prefix instead of raw addition
  refactor skip_prefix to return a boolean
  avoid using skip_prefix as a boolean
  daemon: mark some strings as const
  parse_diff_color_slot: drop ofs parameter
</content>
</entry>
<entry>
<title>Merge branch 'rs/more-starts-with'</title>
<updated>2014-06-20T20:12:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-06-20T20:12:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fa8203741e37d9d37098bfe260d7040e70f11023'/>
<id>urn:sha1:fa8203741e37d9d37098bfe260d7040e70f11023</id>
<content type='text'>
* rs/more-starts-with:
  Use starts_with() for C strings instead of memcmp()
</content>
</entry>
<entry>
<title>use skip_prefix to avoid repeating strings</title>
<updated>2014-06-20T17:44:45Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-18T19:48:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95b567c7c3cf6b85d74b79424cdfbd40a7dee7c9'/>
<id>urn:sha1:95b567c7c3cf6b85d74b79424cdfbd40a7dee7c9</id>
<content type='text'>
It's a common idiom to match a prefix and then skip past it
with strlen, like:

  if (starts_with(foo, "bar"))
	  foo += strlen("bar");

This avoids magic numbers, but means we have to repeat the
string (and there is no compiler check that we didn't make a
typo in one of the strings).

We can use skip_prefix to handle this case without repeating
ourselves.

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>use xstrfmt in favor of manual size calculations</title>
<updated>2014-06-19T19:25:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-18T20:02:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fa3f60b783b42e0d07c667a8f582c3df12791cec'/>
<id>urn:sha1:fa3f60b783b42e0d07c667a8f582c3df12791cec</id>
<content type='text'>
In many parts of the code, we do an ugly and error-prone
malloc like:

  const char *fmt = "something %s";
  buf = xmalloc(strlen(foo) + 10 + 1);
  sprintf(buf, fmt, foo);

This makes the code brittle, and if we ever get the
allocation wrong, is a potential heap overflow. Let's
instead favor xstrfmt, which handles the allocation
automatically, and makes the code shorter and more readable.

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>Use starts_with() for C strings instead of memcmp()</title>
<updated>2014-06-09T21:38:12Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-06-06T17:24:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50e19a83585bd1aeae6aa01d31e5f783b7ef8b1b'/>
<id>urn:sha1:50e19a83585bd1aeae6aa01d31e5f783b7ef8b1b</id>
<content type='text'>
Convert three cases of checking for a constant prefix using memcmp() to
starts_with().  This way there is no need for magic string length
constants and we avoid running over the end of the string should it be
shorter than the prefix.

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>remote.c: rearrange xcalloc arguments</title>
<updated>2014-05-27T21:02:45Z</updated>
<author>
<name>Brian Gesiak</name>
<email>modocache@gmail.com</email>
</author>
<published>2014-05-26T15:33:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=da7a478bc055bd5fdbdf1895367c803d528cf579'/>
<id>urn:sha1:da7a478bc055bd5fdbdf1895367c803d528cf579</id>
<content type='text'>
xcalloc() takes two arguments: the number of elements and their size.
parse_refspec_internal passes the arguments in reverse order, passing the
size of a refspec, followed by the number to allocate.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak &lt;modocache@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jl/nor-or-nand-and'</title>
<updated>2014-04-08T19:00:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-08T19:00:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d59c12d7ad39f942fc60578ba1e934822f40445b'/>
<id>urn:sha1:d59c12d7ad39f942fc60578ba1e934822f40445b</id>
<content type='text'>
Eradicate mistaken use of "nor" (that is, essentially "nor" used
not in "neither A nor B" ;-)) from in-code comments, command output
strings, and documentations.

* jl/nor-or-nand-and:
  code and test: fix misuses of "nor"
  comments: fix misuses of "nor"
  contrib: fix misuses of "nor"
  Documentation: fix misuses of "nor"
</content>
</entry>
<entry>
<title>Merge branch 'cn/fetch-prune-overlapping-destination'</title>
<updated>2014-04-03T19:38:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-03T19:38:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=400ecca8c10520ced800b4fcdd5bdeb94bd2a556'/>
<id>urn:sha1:400ecca8c10520ced800b4fcdd5bdeb94bd2a556</id>
<content type='text'>
Protect refs in a hierarchy that can come from more than one remote
hierarcies from incorrect removal by "git fetch --prune".

* cn/fetch-prune-overlapping-destination:
  fetch: handle overlaping refspecs on --prune
  fetch: add a failing test for prunning with overlapping refspecs
</content>
</entry>
<entry>
<title>comments: fix misuses of "nor"</title>
<updated>2014-03-31T22:29:27Z</updated>
<author>
<name>Justin Lebar</name>
<email>jlebar@google.com</email>
</author>
<published>2014-03-31T22:11:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=01689909eb9f8366583c44b325d8d9ba259a2538'/>
<id>urn:sha1:01689909eb9f8366583c44b325d8d9ba259a2538</id>
<content type='text'>
Signed-off-by: Justin Lebar &lt;jlebar@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
