git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Justin Tobler <jltobler@gmail.com>
Cc: git@vger.kernel.org,  christian.couder@gmail.com
Subject: Re: [PATCH v3 1/4] quote: add c quote flag to ignore core.quotePath
Date: Mon, 03 Feb 2025 14:33:44 -0800	[thread overview]
Message-ID: <xmqq4j1a1wvr.fsf@gitster.g> (raw)
In-Reply-To: <20250201201658.11562-2-jltobler@gmail.com> (Justin Tobler's message of "Sat, 1 Feb 2025 14:16:55 -0600")

Justin Tobler <jltobler@gmail.com> writes:

> The output of `cq_must_quote()` is affected by `core.quotePath`. This is
> undesirable for operations that want to ensure consistent output
> independent of config settings.
>
> Introduce the `CQUOTE_IGNORE_CONFIG` flag for the `quote_c_style*`
> functions which when set makes `cq_must_quote()` always follow the
> default behavior (core.quotePath=true) regardless of how its set in the
> config.

Hmph.  

I was hoping that we can flip the default for 'core.quotePath' to
'no' at Git 3.0 boundary, to help folks in non-ASCII locale.  If
this is about emitting pipe-able output out of rev-list, unlike a
patch that is to be e-mailed (and being 8-bit clean was a risky
assumption to make in 2005) that core.quotePath was originally
invented for, it is more so that we would not want to force the
receiving end to unquote, no?

So regardless of what the future default value of core.quotePath
would be, I am not convinced that it is a good idea to octal quote
any and all bytes outside the ASCII range in the rev-list output.

After all, "git rev-list --objects" would show such a path without
quoting, no [*]?

    Side note: the path in the output from "git rev-list --objects"
    is a hack to allow receiving end to compute a path hash, and
    does not have to be strictly reversible, so it emits verbatim
    bytes but truncates the output at LF to preserve the one-line
    one-object output format.

We do need to quote certain bytes (e.g., LF cannot be allowed
verbatim, when the output is line-oriented, and we use C-quote,
which means literal double-quote needs to be also quoted), so we
cannot mimic paths emitted by "git rev-list --objects", but I do not
think it buys us much to quote non-ASCII bytes these days.


  parent reply	other threads:[~2025-02-03 22:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08  3:40 [PATCH] rev-list: print missing object type with --missing=print-type Justin Tobler
2025-01-08 10:08 ` Christian Couder
2025-01-08 22:28   ` Justin Tobler
2025-01-08 15:17 ` Junio C Hamano
2025-01-08 22:18   ` Justin Tobler
2025-01-08 22:43     ` Junio C Hamano
2025-01-08 23:13       ` Justin Tobler
2025-01-10  5:34 ` [PATCH v2 0/2] rev-list: print additional missing object information Justin Tobler
2025-02-01 20:16   ` [PATCH v3 0/4] " Justin Tobler
2025-02-01 20:16     ` [PATCH v3 1/4] quote: add c quote flag to ignore core.quotePath Justin Tobler
2025-02-03  9:51       ` Christian Couder
2025-02-03 22:14         ` Junio C Hamano
2025-02-03 22:33       ` Junio C Hamano [this message]
2025-02-04 16:40         ` Junio C Hamano
2025-02-04 22:50           ` Justin Tobler
2025-02-01 20:16     ` [PATCH v3 2/4] quote: add quote_path() flag to ignore config Justin Tobler
2025-02-02 10:52       ` Phillip Wood
2025-02-04 22:39         ` Justin Tobler
2025-02-11 16:51           ` Phillip Wood
2025-02-03 10:07       ` Christian Couder
2025-02-03 22:52       ` Junio C Hamano
2025-02-01 20:16     ` [PATCH v3 3/4] rev-list: add print-info action to print missing object path Justin Tobler
2025-02-01 20:16     ` [PATCH v3 4/4] rev-list: extend print-info to print missing object type Justin Tobler
2025-02-03 10:45     ` [PATCH v3 0/4] rev-list: print additional missing object information Christian Couder
2025-02-04 22:51       ` Justin Tobler
2025-02-05  0:41     ` [PATCH v4 0/2] " Justin Tobler
2025-02-05  0:41       ` [PATCH v4 1/2] rev-list: add print-info action to print missing object path Justin Tobler
2025-02-05  0:41       ` [PATCH v4 2/2] rev-list: extend print-info to print missing object type Justin Tobler
2025-02-05 10:35       ` [PATCH v4 0/2] rev-list: print additional missing object information Christian Couder
2025-02-05 17:18         ` Justin Tobler
2025-02-05 13:18       ` Junio C Hamano
2025-02-05 17:17         ` Justin Tobler
2025-02-05 18:29           ` Junio C Hamano
2025-01-10  5:34 ` [PATCH v2 1/2] rev-list: add --missing-info to print missing object path Justin Tobler
2025-01-10  8:47   ` Christian Couder
2025-01-10 15:22     ` Junio C Hamano
2025-01-10  5:34 ` [PATCH v2 2/2] rev-list: extend --missing-info to print missing object type Justin Tobler

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=xmqq4j1a1wvr.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.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).