git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Habouzit <madcoder@debian.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 4/5] Full rework of quote_c_style and write_name_quoted.
Date: Wed, 19 Sep 2007 10:47:03 +0200	[thread overview]
Message-ID: <20070919084703.GG28205@artemis.corp> (raw)
In-Reply-To: <7v1wcvqcsg.fsf@gitster.siamese.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 2375 bytes --]

On Wed, Sep 19, 2007 at 08:28:47AM +0000, Junio C Hamano wrote:
> At this point, you have max that is larger by 3 than what old
> code had.  That would make the next two printf() you added as
> expected.  This affects scaling of add/delete code.  Is this
> intentional?  I _think_ the change is correct (there is no
> reason that name display being cliped should affect the length
> of the bar graph), but that should have been documented as a
> separate bugfix in the commit log.

  Indeed, in fact I didn't noticed that difference, I'll document that.

> 
> > diff --git a/quote.c b/quote.c
> > index 67c6527..a8a755a 100644
> > --- a/quote.c
> > +++ b/quote.c
> > @@ -114,83 +114,142 @@ char *sq_dequote(char *arg)
> >  	}
> >  }
> >  
> > +/* 1 means: quote as octal
> > + * 0 means: quote as octal if (quote_path_fully)
> > + * -1 means: never quote
> > + * c: quote as "\\c"
> > + */
> > +#define X8(x)   x, x, x, x, x, x, x, x
> > +#define X16(x)  X8(x), X8(x)
> > +static signed char const sq_lookup[256] = {
> > +	/*           0    1    2    3    4    5    6    7 */
> > +	/* 0x00 */   1,   1,   1,   1,   1,   1, 'a',   1,
> 
> Isn't BEL == 0x07, not 0x06?

  indeed.

> > +	/* 0x08 */ 'b', 't', 'n', 'v', 'f', 'r',   1,   1,
> > +	/* 0x10 */ X16(1),
> > +	/* 0x20 */  -1,  -1, '"',  -1,  -1,  -1,  -1,  -1,
> > +	/* 0x28 */ X16(-1), X16(-1), X16(-1),
> > +	/* 0x58 */  -1,  -1,  -1,  -1,'\\',  -1,  -1,  -1,
> > +	/* 0x60 */ X16(-1), X16(-1),
> 
> Shouldn't you quote DEL == 0177 here?

  indeed again.

> >  /*
> >   * C-style name quoting.
> >   *
> > - * Does one of three things:
> > - *
> >   * (1) if outbuf and outfp are both NULL, inspect the input name and
> >   *     counts the number of bytes that are needed to hold c_style
> >   *     quoted version of name, counting the double quotes around
> >   *     it but not terminating NUL, and returns it.  However, if name
> >   *     does not need c_style quoting, it returns 0.
> >   *
> 
> You need to update this comment; you do not have outbuf nor
> outfp anymore, you have something else.

  heh, well outfp is still here, but I'll fix the part about outbuf.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2007-09-19  8:47 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 22:39 let's refactor quoting Pierre Habouzit
2007-09-18 17:18 ` [PATCH 1/5] strbuf API additions and enhancements Pierre Habouzit
2007-09-19 12:46   ` Edgar Toernig
2007-09-19 13:36     ` Pierre Habouzit
2007-09-19 18:46       ` Junio C Hamano
2007-09-20  6:17     ` Johannes Sixt
2007-09-20  7:20       ` Kalle Olavi Niemitalo
2007-09-20 16:10         ` Jeff King
2007-09-18 20:15 ` [PATCH 2/5] sq_quote_argv and add_to_string rework with strbuf's Pierre Habouzit
2007-09-19  8:09   ` Junio C Hamano
2007-09-19  8:23     ` Pierre Habouzit
2007-09-18 21:22 ` [PATCH 3/5] Rework unquote_c_style to work on a strbuf Pierre Habouzit
2007-09-19  0:14   ` Pierre Habouzit
2007-09-19  8:09   ` Junio C Hamano
2007-09-19  8:22     ` Pierre Habouzit
2007-09-18 21:48 ` [PATCH 5/5] Avoid duplicating memory, and use xmemdupz instead of xstrdup Pierre Habouzit
2007-09-18 22:00 ` [PATCH 4/5] Full rework of quote_c_style and write_name_quoted Pierre Habouzit
2007-09-19  0:07   ` Pierre Habouzit
2007-09-19  0:55     ` Junio C Hamano
2007-09-19  1:14       ` Pierre Habouzit
2007-09-19  6:37   ` Andreas Ericsson
2007-09-19  8:00     ` Pierre Habouzit
2007-09-19  8:08       ` Andreas Ericsson
2007-09-19  8:21         ` Pierre Habouzit
2007-09-19  8:28           ` David Kastrup
2007-09-19  8:31             ` Junio C Hamano
2007-09-19  8:38               ` David Kastrup
2007-09-19  8:28   ` Junio C Hamano
2007-09-19  8:47     ` Pierre Habouzit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070919084703.GG28205@artemis.corp \
    --to=madcoder@debian.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).