<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/strbuf.h, branch v2.12.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.12.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.12.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-01-30T22:17:00Z</updated>
<entry>
<title>use SWAP macro</title>
<updated>2017-01-30T22:17:00Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-01-28T21:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=35d803bc9a0d21c36b1381f6e42455beeb73b715'/>
<id>urn:sha1:35d803bc9a0d21c36b1381f6e42455beeb73b715</id>
<content type='text'>
Apply the semantic patch swap.cocci to convert hand-rolled swaps to use
the macro SWAP.  The resulting code is shorter and easier to read, the
object code is effectively unchanged.

The patch for object.c had to be hand-edited in order to preserve the
comment before the change; Coccinelle tried to eat it for some reason.

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>link_alt_odb_entry: handle normalize_path errors</title>
<updated>2016-10-10T20:52:36Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-03T20:34:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=670c359da357639f9f9a814ed646b4d854ec5d55'/>
<id>urn:sha1:670c359da357639f9f9a814ed646b4d854ec5d55</id>
<content type='text'>
When we add a new alternate to the list, we try to normalize
out any redundant "..", etc. However, we do not look at the
return value of normalize_path_copy(), and will happily
continue with a path that could not be normalized. Worse,
the normalizing process is done in-place, so we are left
with whatever half-finished working state the normalizing
function was in.

Fortunately, this cannot cause us to read past the end of
our buffer, as that working state will always leave the
NUL from the original path in place. And we do tend to
notice problems when we check is_directory() on the path.
But you can see the nonsense that we feed to is_directory
with an entry like:

  this/../../is/../../way/../../too/../../deep/../../to/../../resolve

in your objects/info/alternates, which yields:

  error: object directory
  /to/e/deep/too/way//ects/this/../../is/../../way/../../too/../../deep/../../to/../../resolve
  does not exist; check .git/objects/info/alternates.

We can easily fix this just by checking the return value.
But that makes it hard to generate a good error message,
since we're normalizing in-place and our input value has
been overwritten by cruft.

Instead, let's provide a strbuf helper that does an in-place
normalize, but restores the original contents on error. This
uses a second buffer under the hood, which is slightly less
efficient, but this is not a performance-critical code path.

The strbuf helper can also properly set the "len" parameter
of the strbuf before returning. Just doing:

  normalize_path_copy(buf.buf, buf.buf);

will shorten the string, but leave buf.len at the original
length. That may be confusing to later code which uses the
strbuf.

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 'rs/use-strbuf-addbuf'</title>
<updated>2016-07-25T21:13:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-25T21:13:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b4e8a847ba4e775fb7d422b2daf18356db50eec8'/>
<id>urn:sha1:b4e8a847ba4e775fb7d422b2daf18356db50eec8</id>
<content type='text'>
Code cleanup.

* rs/use-strbuf-addbuf:
  strbuf: avoid calling strbuf_grow() twice in strbuf_addbuf()
  use strbuf_addbuf() for appending a strbuf to another
</content>
</entry>
<entry>
<title>strbuf: avoid calling strbuf_grow() twice in strbuf_addbuf()</title>
<updated>2016-07-22T16:22:26Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-07-21T16:46:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=31471ba21ee29886ab856981e52f723c913d7f40'/>
<id>urn:sha1:31471ba21ee29886ab856981e52f723c913d7f40</id>
<content type='text'>
Implement strbuf_addbuf() as a normal function in order to avoid calling
strbuf_grow() twice, with the second callinside strbud_add() being a
no-op.  This is slightly faster and also reduces the text size a bit.

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>Merge branch 'pb/strbuf-read-file-doc'</title>
<updated>2016-06-27T16:56:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-06-27T16:56:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed319fca3380bd4d68d316f92c5aa777dc785f85'/>
<id>urn:sha1:ed319fca3380bd4d68d316f92c5aa777dc785f85</id>
<content type='text'>
* pb/strbuf-read-file-doc:
  strbuf: describe the return value of strbuf_read_file
</content>
</entry>
<entry>
<title>strbuf: describe the return value of strbuf_read_file</title>
<updated>2016-06-14T17:57:21Z</updated>
<author>
<name>Pranit Bauva</name>
<email>pranit.bauva@gmail.com</email>
</author>
<published>2016-06-14T06:14:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed008d7bb957ccfbe32c95aad74ee78e0e31de16'/>
<id>urn:sha1:ed008d7bb957ccfbe32c95aad74ee78e0e31de16</id>
<content type='text'>
Mentored-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Pranit Bauva &lt;pranit.bauva@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/submodule-parallel-update'</title>
<updated>2016-04-06T18:39:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-04-06T18:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bdebbeb3346e9867005947aff356b99a7358e5ab'/>
<id>urn:sha1:bdebbeb3346e9867005947aff356b99a7358e5ab</id>
<content type='text'>
A major part of "git submodule update" has been ported to C to take
advantage of the recently added framework to run download tasks in
parallel.

* sb/submodule-parallel-update:
  clone: allow an explicit argument for parallel submodule clones
  submodule update: expose parallelism to the user
  submodule helper: remove double 'fatal: ' prefix
  git submodule update: have a dedicated helper for cloning
  run_processes_parallel: rename parameters for the callbacks
  run_processes_parallel: treat output of children as byte array
  submodule update: direct error message to stderr
  fetching submodules: respect `submodule.fetchJobs` config option
  submodule-config: drop check against NULL
  submodule-config: keep update strategy around
</content>
</entry>
<entry>
<title>run_processes_parallel: treat output of children as byte array</title>
<updated>2016-03-01T19:57:19Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-03-01T02:07:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2dac9b5637abe580e8b8ea36e00dbbf28ec99af6'/>
<id>urn:sha1:2dac9b5637abe580e8b8ea36e00dbbf28ec99af6</id>
<content type='text'>
We do not want the output to be interrupted by a NUL byte, so we
cannot use raw fputs. Introduce strbuf_write to avoid having long
arguments in run-command.c.

Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/strbuf-getline'</title>
<updated>2016-01-29T00:10:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-01-29T00:10:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b62624b51a54325e6884c197352dc0dcef700325'/>
<id>urn:sha1:b62624b51a54325e6884c197352dc0dcef700325</id>
<content type='text'>
The preliminary clean-up for jc/peace-with-crlf topic.

* jc/strbuf-getline:
  strbuf: give strbuf_getline() to the "most text friendly" variant
  checkout-index: there are only two possible line terminations
  update-index: there are only two possible line terminations
  check-ignore: there are only two possible line terminations
  check-attr: there are only two possible line terminations
  mktree: there are only two possible line terminations
  strbuf: introduce strbuf_getline_{lf,nul}()
  strbuf: make strbuf_getline_crlf() global
  strbuf: miniscule style fix
</content>
</entry>
<entry>
<title>strbuf: give strbuf_getline() to the "most text friendly" variant</title>
<updated>2016-01-15T18:23:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-01-14T02:32:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a0c8dfd89475d6bb09ddee8c019cf0ae5b3bdc2'/>
<id>urn:sha1:1a0c8dfd89475d6bb09ddee8c019cf0ae5b3bdc2</id>
<content type='text'>
Now there is no direct caller to strbuf_getline(), we can demote it
to file-scope static that is private to strbuf.c and rename it to
strbuf_getdelim().  Rename strbuf_getline_crlf(), which is designed
to be the most "text friendly" variant, and allow it to take over
this simplest name, strbuf_getline(), so we can add more uses of it
without having to type _crlf over and over again in the coming
steps.

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