git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Randall S. Becker" <rsbecker@nexbridge.com>
Cc: <git@vger.kernel.org>
Subject: Re: [Question] Complex textconv text
Date: Fri, 14 Dec 2018 12:12:01 +0900	[thread overview]
Message-ID: <xmqqo99odcou.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <004501d492f5$98f0fcc0$cad2f640$@nexbridge.com> (Randall S. Becker's message of "Thu, 13 Dec 2018 10:07:37 -0500")

"Randall S. Becker" <rsbecker@nexbridge.com> writes:

> Hi all,
>
> I have a strange situation and need help with resolving funky characters in
> .git/config. My situation is this:
>
> [diff "*.dat"]
> 	textconv = enscribe-conv
> --format=-a1\(A=-a1,-a16,-a32\|P=-a1,-a32,-a16\|=-a1,-d,a14\),-a224
>
> Basically this is a formatter for diff so that I can show structured binary
> data. The unquoted syntax of the format string is:
>  --format=-a1(A=-a1,-a16,-a32|P=-a1,-a32,-a16|=-a1,-d,a14),-a224
>
> Content is not really important. The issue is that git is reporting fatal:
> bad config line 2 in file .git/config when I escape the (, ), and |
> characters.

That failure is understandable, as

    The following escape sequences (beside `\"` and `\\`) are recognized:
    `\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB)
    and `\b` for backspace (BS).  Other char escape sequences (including octal
    escape sequences) are invalid.

is what Documentation/config.txt says.  \(, \) and \| is not a way
to escape these letters from the .git/config parser (they do not
need to be escaped from .git/config parser)..

> I get syntax errors otherwise from the shell running the
> textconv. I have tried
> --format="-a1(A=-a1,-a16,-a32|P=-a1,-a32,-a16|=-a1,-d,a14),-a224", to no
> avail.

Would 

	textconv = enscribe-conv --format=\"-a1(A=...,-a224\"

work?

We want to show the shell what you wrote so that pipes and parens
are inside a dq pair, but the .git/config language strips pair of
dq, so the .git/config language parser needs to be told that these
dq are not for it to eat.

  parent reply	other threads:[~2018-12-14  3:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 15:07 [Question] Complex textconv text Randall S. Becker
2018-12-13 16:14 ` Randall S. Becker
2018-12-14  3:12 ` Junio C Hamano [this message]
2018-12-14 10:04   ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqo99odcou.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rsbecker@nexbridge.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).