git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "LI, BO XUAN" <liboxuan@connect.hku.hk>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Johannes Sixt <j6t@kdbg.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC PATCH] userdiff: ship built-in driver config file
Date: Wed, 19 Jun 2019 23:32:19 +0800	[thread overview]
Message-ID: <CALM0=-=4b4j1brRN=Jnq4N+f+_vJXrL-JBAOxaLw0FgugNqX5w@mail.gmail.com> (raw)
In-Reply-To: <20190619035857.GB515@sigill.intra.peff.net>

On Wed, Jun 19, 2019 at 11:58 AM Jeff King <peff@peff.net> wrote:
>
> While having separate lines that get joined here does make the result
> easier to read, I think it creates some confusion. diff.*.xfuncname in a
> regular config file _doesn't_ behave this way (it's the usual
> last-one-wins, so we expect a single string). You've handled this
> specially in your code to read this file, but it's confusing because
> this test otherwise looks exactly like a config file. And thus somebody
> might be tempted to copy it to their config file and modify it, but it
> would not do what they expected.
>
> I don't recall how well our config parser copes with embedded newlines
> in values.  I.e., if it would be possible to write:
>
>   [diff "foo"]
>   xfuncname = "the pattern starts here...
>   and continues through newlines!"
>

If I recall correctly, the above version wouldn't work, but the
following version would:

[diff "foo"]
    xfuncname = "The pattern starts here..."
"and continues here! But the indentation looks ugly,"
"and we lose the ability to add comments inline (within pattern)"

Actually, at the very beginning, I was imaging some syntax like this:

[diff "foo"]
    xfuncname = "The pattern starts here..."
    ; using '+=' will continue the pattern above
    xfuncname += "and continues here!"
    ; a '=' symbol will start a new pattern
    xfuncname = "This is another pattern.."
    xfuncname += "and remember, last one always wins"

The existing config parser does not support "+=" though, which is a
nice feature to have in my opinion. Maybe there is a reason?

By the way, thanks for all the reviews! Especially when I found more
lines of reviews than lines of my code.

Best regards,
Boxuan

  reply	other threads:[~2019-06-19 15:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 16:54 [RFC PATCH] userdiff: ship built-in driver config file Boxuan Li
2019-06-18 20:32 ` Johannes Sixt
2019-06-18 20:50   ` Johannes Sixt
2019-06-19  3:49   ` Jeff King
2019-06-19  6:30     ` Johannes Sixt
2019-06-19 15:02       ` Junio C Hamano
2019-06-19 18:39       ` Jeff King
2019-06-20  7:41         ` Johannes Sixt
2019-06-19 14:50     ` Junio C Hamano
2019-06-19  3:58 ` Jeff King
2019-06-19 15:32   ` LI, BO XUAN [this message]
2019-06-19 18:42     ` 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='CALM0=-=4b4j1brRN=Jnq4N+f+_vJXrL-JBAOxaLw0FgugNqX5w@mail.gmail.com' \
    --to=liboxuan@connect.hku.hk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=peff@peff.net \
    /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).