<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/http-push.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-07-16T18:33:11Z</updated>
<entry>
<title>Merge branch 'ah/fix-http-push'</title>
<updated>2014-07-16T18:33:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-16T18:33:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9037eae7e67680016b92e2113e4ab4878660345'/>
<id>urn:sha1:d9037eae7e67680016b92e2113e4ab4878660345</id>
<content type='text'>
An ancient rewrite passed a wrong pointer to a curl library
function in a rarely used code path.

* ah/fix-http-push:
  http-push.c: make CURLOPT_IOCTLDATA a usable pointer
</content>
</entry>
<entry>
<title>http-push.c: make CURLOPT_IOCTLDATA a usable pointer</title>
<updated>2014-07-14T00:57:59Z</updated>
<author>
<name>Abbaad Haider</name>
<email>abbaad@gmail.com</email>
</author>
<published>2014-07-06T00:43:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=479eaa8ef8384d8026dc05c1288e96ffd9e296d6'/>
<id>urn:sha1:479eaa8ef8384d8026dc05c1288e96ffd9e296d6</id>
<content type='text'>
Fixes a small bug affecting push to remotes which use some sort of
multi-pass authentication. In particular the bug affected SabreDAV as
configured by Box.com [1].

It must be a weird server configuration for the bug to have survived
this long. Someone should write a test for it.

[1] http://marc.info/?l=git&amp;m=140460482604482

Signed-off-by: Abbaad Haider &lt;abbaad@gmail.com&gt;
Reviewed-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 '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>http-push: refactor parsing of remote object names</title>
<updated>2014-06-20T17:45:19Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-19T21:58:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=67a31f612830e79fe768ac886ed9ef7eadd8fb10'/>
<id>urn:sha1:67a31f612830e79fe768ac886ed9ef7eadd8fb10</id>
<content type='text'>
We get loose object names like "objects/??/..." from the
remote side, and need to convert them to their hex
representation.

The code to do so is rather hard to follow, as it uses some
calculated lengths whose origins are hard to understand and
verify (e.g., the path must be exactly 49 characters long.
why? Why doesn't the strcpy overflow obj_hex, which is the
same length as path?).

We can simplify this a bit by using skip_prefix, using standard
40- and 20-character buffers for hex and binary sha1s, and
adding some comments.

We also drop a totally bogus comment that claims strlcpy
cannot be used because "path" is not NUL-terminated. Right
between a call to strlen(path) and strcpy(path).

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 skip_prefix to avoid magic numbers</title>
<updated>2014-06-20T17:44:45Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-18T19:47:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae021d87911da4328157273df24779892cb51277'/>
<id>urn:sha1:ae021d87911da4328157273df24779892cb51277</id>
<content type='text'>
It's a common idiom to match a prefix and then skip past it
with a magic number, like:

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

This is easy to get wrong, since you have to count the
prefix string yourself, and there's no compiler check if the
string changes.  We can use skip_prefix to avoid the magic
numbers here.

Note that some of these conversions could be much shorter.
For example:

  if (starts_with(arg, "--foo=")) {
	  bar = arg + 6;
	  continue;
  }

could become:

  if (skip_prefix(arg, "--foo=", &amp;bar))
	  continue;

However, I have left it as:

  if (skip_prefix(arg, "--foo=", &amp;v)) {
	  bar = v;
	  continue;
  }

to visually match nearby cases which need to actually
process the string. Like:

  if (skip_prefix(arg, "--foo=", &amp;v)) {
	  bar = atoi(v);
	  continue;
  }

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 to replace xmalloc + sprintf</title>
<updated>2014-06-19T22:20:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-19T21:24:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=283101869bea8feb5d58f6ea1b568e9b197526d3'/>
<id>urn:sha1:283101869bea8feb5d58f6ea1b568e9b197526d3</id>
<content type='text'>
This is one line shorter, and makes sure the length in the
malloc and sprintf steps match.

These conversions are very straightforward; we can drop the
malloc entirely, and replace the sprintf with xstrfmt.

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 xstrdup instead of xmalloc + strcpy</title>
<updated>2014-06-19T22:20:53Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-19T21:19:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95244ae3dd49b3eed4dbfe09299b9d8847622218'/>
<id>urn:sha1:95244ae3dd49b3eed4dbfe09299b9d8847622218</id>
<content type='text'>
This is one line shorter, and makes sure the length in the
malloc and copy steps match.

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>http-push.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:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3d51ffde88323fd4a5c18ac19a47cf571f62ae4'/>
<id>urn:sha1:f3d51ffde88323fd4a5c18ac19a47cf571f62ae4</id>
<content type='text'>
xcalloc() takes two arguments: the number of elements and their size.
http-push passes the arguments in reverse order, passing the size
of a repo, 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>object.h: centralize object flag allocation</title>
<updated>2014-03-25T22:09:24Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-03-25T13:23:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=208acbfb82f722fb22320c381e7da8c8fb2e37e8'/>
<id>urn:sha1:208acbfb82f722fb22320c381e7da8c8fb2e37e8</id>
<content type='text'>
While the field "flags" is mainly used by the revision walker, it is
also used in many other places. Centralize the whole flag allocation to
one place for a better overview (and easier to move flags if we have
too).

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>replace {pre,suf}fixcmp() with {starts,ends}_with()</title>
<updated>2013-12-05T22:13:21Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-11-30T20:55:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=59556548230e617b837343c2c07e357e688e2ca4'/>
<id>urn:sha1:59556548230e617b837343c2c07e357e688e2ca4</id>
<content type='text'>
Leaving only the function definitions and declarations so that any
new topic in flight can still make use of the old functions, replace
existing uses of the prefixcmp() and suffixcmp() with new API
functions.

The change can be recreated by mechanically applying this:

    $ git grep -l -e prefixcmp -e suffixcmp -- \*.c |
      grep -v strbuf\\.c |
      xargs perl -pi -e '
        s|!prefixcmp\(|starts_with\(|g;
        s|prefixcmp\(|!starts_with\(|g;
        s|!suffixcmp\(|ends_with\(|g;
        s|suffixcmp\(|!ends_with\(|g;
      '

on the result of preparatory changes in this series.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
