<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/strbuf.c, branch v2.17.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.17.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.17.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-03-14T19:01:05Z</updated>
<entry>
<title>Merge branch 'nd/worktree-move'</title>
<updated>2018-03-14T19:01:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-03-14T19:01:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bd0f794342d5b3921f2d5d4bffce87ec7b7e4d96'/>
<id>urn:sha1:bd0f794342d5b3921f2d5d4bffce87ec7b7e4d96</id>
<content type='text'>
"git worktree" learned move and remove subcommands.

* nd/worktree-move:
  t2028: fix minor error and issues in newly-added "worktree move" tests
  worktree remove: allow it when $GIT_WORK_TREE is already gone
  worktree remove: new command
  worktree move: refuse to move worktrees with submodules
  worktree move: accept destination as directory
  worktree move: new command
  worktree.c: add update_worktree_location()
  worktree.c: add validate_worktree()
</content>
</entry>
<entry>
<title>strbuf_read_file(): preserve errno across close() call</title>
<updated>2018-02-23T22:20:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-02-23T07:00:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=79f0ba1547a34b3a9791491f9bbfe4048026f373'/>
<id>urn:sha1:79f0ba1547a34b3a9791491f9bbfe4048026f373</id>
<content type='text'>
If we encounter a read error, the user may want to report it
by looking at errno. However, our close() call may clobber
errno, leading to confusing results. Let's save and restore
it in the error case.

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>worktree move: accept destination as directory</title>
<updated>2018-02-12T21:13:35Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-12T09:49:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c64a8d200f4109df86c6d4716ea4da58df450e34'/>
<id>urn:sha1:c64a8d200f4109df86c6d4716ea4da58df450e34</id>
<content type='text'>
Similar to "mv a b/", which is actually "mv a b/a", we extract basename
of source worktree and create a directory of the same name at
destination if dst path is a directory.

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>Merge branch 'jd/fix-strbuf-add-urlencode-bytes'</title>
<updated>2018-01-05T21:28:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-01-05T21:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a741e2825b3a3045254f404696c0051714c0e7c3'/>
<id>urn:sha1:a741e2825b3a3045254f404696c0051714c0e7c3</id>
<content type='text'>
Bytes with high-bit set were encoded incorrectly and made
credential helper fail.

* jd/fix-strbuf-add-urlencode-bytes:
  strbuf: fix urlencode format string on signed char
</content>
</entry>
<entry>
<title>Merge branch 'cc/skip-to-optional-val'</title>
<updated>2017-12-28T22:08:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-12-28T22:08:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f427b94985f7f8cde46df20f644760adc0ca6735'/>
<id>urn:sha1:f427b94985f7f8cde46df20f644760adc0ca6735</id>
<content type='text'>
Introduce a helper to simplify code to parse a common pattern that
expects either "--key" or "--key=&lt;something&gt;".

* cc/skip-to-optional-val:
  t4045: reindent to make helpers readable
  diff: add tests for --relative without optional prefix value
  diff: use skip_to_optional_arg_default() in parsing --relative
  diff: use skip_to_optional_arg_default()
  diff: use skip_to_optional_arg()
  index-pack: use skip_to_optional_arg()
  git-compat-util: introduce skip_to_optional_arg()
</content>
</entry>
<entry>
<title>Merge branch 'rs/strbuf-read-once-reset-length'</title>
<updated>2017-12-27T19:16:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-12-27T19:16:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a13e45f1e7e6fc02d4e10e0589578a77e84f3ffb'/>
<id>urn:sha1:a13e45f1e7e6fc02d4e10e0589578a77e84f3ffb</id>
<content type='text'>
Leakfix.

* rs/strbuf-read-once-reset-length:
  strbuf: release memory on read error in strbuf_read_once()
</content>
</entry>
<entry>
<title>strbuf: fix urlencode format string on signed char</title>
<updated>2017-12-22T21:43:19Z</updated>
<author>
<name>Julien Dusser</name>
<email>julien.dusser@free.fr</email>
</author>
<published>2017-12-22T17:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c267f2ae37e5b5f834172f04b7dd4343e370689'/>
<id>urn:sha1:4c267f2ae37e5b5f834172f04b7dd4343e370689</id>
<content type='text'>
Git credential fails with special char in password with

    remote: Invalid username or password.
    fatal: Authentication failed for

    File ~/.git-credential contains badly urlencoded characters
    %ffffffXX%ffffffYY instead of %XX%YY.

Add a cast to an unsigned char to fix urlencode use of %02x on a
char.

Signed-off-by: Julien Dusser &lt;julien.dusser@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-compat-util: introduce skip_to_optional_arg()</title>
<updated>2017-12-12T00:10:12Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2017-12-09T20:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afaef55e230c6fcfb4e8a27c1b970f7e6400a7f6'/>
<id>urn:sha1:afaef55e230c6fcfb4e8a27c1b970f7e6400a7f6</id>
<content type='text'>
We often accept both a "--key" option and a "--key=&lt;val&gt;" option.

These options currently are parsed using something like:

if (!strcmp(arg, "--key")) {
	/* do something */
} else if (skip_prefix(arg, "--key=", &amp;arg)) {
	/* do something with arg */
}

which is a bit cumbersome compared to just:

if (skip_to_optional_arg(arg, "--key", &amp;arg)) {
	/* do something with arg */
}

This also introduces skip_to_optional_arg_default() for the few
cases where something different should be done when the first
argument is exactly "--key" than when it is exactly "--key=".

In general it is better for UI consistency and simplicity if
"--key" and "--key=" do the same thing though, so that using
skip_to_optional_arg() should be encouraged compared to
skip_to_optional_arg_default().

Note that these functions can be used to parse any "key=value"
string where "key" is also considered as valid, not just
command line options.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>strbuf: release memory on read error in strbuf_read_once()</title>
<updated>2017-12-07T21:19:23Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-12-07T20:51:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c3ff8f6c145638afe996b51e91375fd94cd064d0'/>
<id>urn:sha1:c3ff8f6c145638afe996b51e91375fd94cd064d0</id>
<content type='text'>
If other strbuf add functions cause the first allocation and
subsequently encounter an error then they release the memory, restoring
the pristine state of the strbuf.  That simplifies error handling for
callers.

Do the same in strbuf_read_once(), and do it also in case no bytes were
read -- which may or may not be an error as well, depending on the
caller.

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 'rs/strbuf-getwholeline-fix'</title>
<updated>2017-08-22T17:29:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-22T17:29:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c493966ff6af8d2217aaa40dd6f7916bd992b0a'/>
<id>urn:sha1:0c493966ff6af8d2217aaa40dd6f7916bd992b0a</id>
<content type='text'>
A helper function to read a single whole line into strbuf
mistakenly triggered OOM error at EOF under certain conditions,
which has been fixed.

* rs/strbuf-getwholeline-fix:
  strbuf: clear errno before calling getdelim(3)
</content>
</entry>
</feed>
