<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/quote.h, branch v1.6.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2009-03-30T08:22:53Z</updated>
<entry>
<title>quote: add "sq_dequote_to_argv" to put unwrapped args in an argv array</title>
<updated>2009-03-30T08:22:53Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2009-03-29T09:44:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eaa759b9141f125d7e55a4b08b60497845d3c52e'/>
<id>urn:sha1:eaa759b9141f125d7e55a4b08b60497845d3c52e</id>
<content type='text'>
This new function unwraps the space separated shell quoted elements in
its first argument and places them in the argv array passed as its second
argument.

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>quote: implement "sq_dequote_many" to unwrap many args in one string</title>
<updated>2009-03-30T08:22:53Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2009-03-29T09:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ebbc088e13e1bf0dbf8eb08b00519602c176f864'/>
<id>urn:sha1:ebbc088e13e1bf0dbf8eb08b00519602c176f864</id>
<content type='text'>
The sq_dequote() function does not allow parsing a string with more than
one single-quoted parameter easily; use its code to implement a new API
sq_dequote_step() to allow the caller iterate through such a string to
parse them one-by-one.  The original sq_dequote() becomes a thin wrapper
around it.

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>Make private quote_path() in wt-status.c available as quote_path_relative()</title>
<updated>2008-03-08T05:22:25Z</updated>
<author>
<name>Dmitry Potapov</name>
<email>dpotapov@gmail.com</email>
</author>
<published>2008-03-07T02:30:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a734d0b10bd0f5554abb3acdf11426040cfc4df0'/>
<id>urn:sha1:a734d0b10bd0f5554abb3acdf11426040cfc4df0</id>
<content type='text'>
Move quote_path() from wt-status.c to quote.c and rename it as
quote_path_relative(), because it is a better name for a public function.

Also, instead of handcrafted quoting, quote_c_style_counted() is now used,
to make its quoting more consistent with the rest of the system, also
honoring core.quotepath specified in configuration.

Signed-off-by: Dmitry Potapov &lt;dpotapov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix rewrite_diff() name quoting.</title>
<updated>2007-12-27T01:13:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-12-27T01:13:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d56250911f4ec074048f4edb34551eaf384172cc'/>
<id>urn:sha1:d56250911f4ec074048f4edb34551eaf384172cc</id>
<content type='text'>
This moves the logic to quote two paths (prefix + path) in
C-style introduced in the previous commit from the
dump_quoted_path() in combine-diff.c to quote.c, and uses it to
fix rewrite_diff() that never C-quoted the pathnames correctly.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Trace and quote with argv: get rid of unneeded count argument.</title>
<updated>2007-12-04T06:11:53Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2007-12-03T04:51:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b319ce4c14f7fe0ee469a3f9def1098d84177849'/>
<id>urn:sha1:b319ce4c14f7fe0ee469a3f9def1098d84177849</id>
<content type='text'>
Now that str_buf takes care of all the allocations, there is
no more gain to pass an argument count.

So this patch removes the "count" argument from:
	- "sq_quote_argv"
	- "trace_argv_printf"
and all the callers.

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>sq_quote_argv and add_to_string rework with strbuf's.</title>
<updated>2007-09-21T10:31:18Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-09-19T22:42:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a33bcbe802080f3a926e93d66b65ff7c5e8c5ed'/>
<id>urn:sha1:7a33bcbe802080f3a926e93d66b65ff7c5e8c5ed</id>
<content type='text'>
* sq_quote_buf is made public, and works on a strbuf.
* sq_quote_argv also works on a strbuf.
* make sq_quote_argv take a "maxlen" argument to check the buffer won't grow
  too big.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Full rework of quote_c_style and write_name_quoted.</title>
<updated>2007-09-21T06:45:49Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-09-19T22:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=663af3422a648e87945e4d8c0cc3e13671f2bbde'/>
<id>urn:sha1:663af3422a648e87945e4d8c0cc3e13671f2bbde</id>
<content type='text'>
* quote_c_style works on a strbuf instead of a wild buffer.
* quote_c_style is now clever enough to not add double quotes if not needed.

* write_name_quoted inherits those advantages, but also take a different
  set of arguments. Now instead of asking for quotes or not, you pass a
  "terminator". If it's \0 then we assume you don't want to escape, else C
  escaping is performed. In any case, the terminator is also appended to the
  stream. It also no longer takes the prefix/prefix_len arguments, as it's
  seldomly used, and makes some optimizations harder.

* write_name_quotedpfx is created to work like write_name_quoted and take
  the prefix/prefix_len arguments.

Thanks to those API changes, diff.c has somehow lost weight, thanks to the
removal of functions that were wrappers around the old write_name_quoted
trying to give it a semantics like the new one, but performing a lot of
allocations for this goal. Now we always write directly to the stream, no
intermediate allocation is performed.

As a side effect of the refactor in builtin-apply.c, the length of the bar
graphs in diffstats are not affected anymore by the fact that the path was
clipped.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
</content>
</entry>
<entry>
<title>Rework unquote_c_style to work on a strbuf.</title>
<updated>2007-09-21T06:32:18Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-09-19T22:42:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7fb1011e610a28518959b1d2d48cea17ecc32048'/>
<id>urn:sha1:7fb1011e610a28518959b1d2d48cea17ecc32048</id>
<content type='text'>
If the gain is not obvious in the diffstat, the resulting code is more
readable, _and_ in checkout-index/update-index we now reuse the same buffer
to unquote strings instead of always freeing/mallocing.

This also is more coherent with the next patch that reworks quoting
functions.

The quoting function is also made more efficient scanning for backslashes
and treating portions of strings without a backslash at once.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
</content>
</entry>
<entry>
<title>Even more missing static</title>
<updated>2007-06-08T09:54:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-06-08T09:54:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=16befb8b7fbfcc9b2d38931f4081669558300adf'/>
<id>urn:sha1:16befb8b7fbfcc9b2d38931f4081669558300adf</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Teach for-each-ref about a little language called Tcl.</title>
<updated>2007-01-28T21:00:26Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-01-28T07:39:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5558e55c06a1e897f3064f0c8a343d5c9858f6b2'/>
<id>urn:sha1:5558e55c06a1e897f3064f0c8a343d5c9858f6b2</id>
<content type='text'>
Love it or hate it, some people actually still program in Tcl.  Some
of those programs are meant for interfacing with Git.  Programs such as
gitk and git-gui.  It may be useful to have Tcl-safe output available
from for-each-ref, just like shell, Perl and Python already enjoy.

Thanks to Sergey Vlasov for pointing out the horrible flaws in the
first and second version of this patch, and steering me in the right
direction for Tcl value quoting.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
</feed>
