git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Sebastian Schuberth <sschuberth@gmail.com>
Cc: larsxschneider@gmail.com, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH v2] config: add '--sources' option to print the source of a config value
Date: Wed, 10 Feb 2016 11:24:08 -0500	[thread overview]
Message-ID: <20160210162408.GD19867@sigill.intra.peff.net> (raw)
In-Reply-To: <CAHGBnuMDCYePJyEU4yHjGjEzyZn8mRBE73WC3qsRqbb6Amhyog@mail.gmail.com>

On Wed, Feb 10, 2016 at 04:57:00PM +0100, Sebastian Schuberth wrote:

> >> I also would have expected sopme like the latter, except that I'd also
> >> expect a colon after "stdin" and "cmd" (or "cmdline", as said above).
> >> I.e. the colon should be part of the prefix to mark it as such.
> >
> > Yeah, I waffled on that. Having a colon means you can definitely parse
> > to the first ":" without looking at what the prefix is. But if you don't
> > know what the prefix is, I don't know what good that does you. IOW, I'd
> 
> IMO that's asking the wrong question. The question should not be "what
> good does it do if we add the colons also there", but "what
> justification do we have to introduce an inconsistency by not adding
> them".

But I think it is only an inconsistency if your mental model of the
format is "the source field is a prefix, a colon, and then an argument;
sometimes we omit the colon if there is no argument". If your mental
model is "the source field contains a type, followed by type-specific
data", then it is not an inconsistency. It is simply context-sensitive.

Now you can argue that context-sensitive things are bad, and I might
agree with that. :)

> I agree the option wording mostly is personal preference. On the other
> hand, I find discussions like these often prematurely waved aside as
> bikeshedding, just because e.g. Perl can parse the one as good as the
> other. But it's not about Perl, it's about humans. IMO Git has
> historically made many mistakes by not caring enough about consistency
> in docs, command and command line option naming, so I don't see it as
> wasted time to discuss about things like this.

Oh, I agree that formats are worth discussing. It's just that I do not
think either of the mental models above is better than the other.

My point in mentioning perl is not that perl can do it, but rather the
opposite: that _any_ language can do it. And I would even go so far as
to say that humans parse context-sensitive things better than machines,
because we simultaneously apply the semantic and syntactic parsing (so
you see "stdin" and know because of its meaning that there is nothing
left to parse; you don't need a trailing colon to tell you that). Or
perhaps you mean "humans write the programs that machines use to parse,
and we must make things regular and easy for them". I can somewhat buy
that argument, though again, I think either is easy; it is mostly a
matter of documenting the format's mental model.

-Peff

  reply	other threads:[~2016-02-10 16:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 10:13 [PATCH v2] config: add '--sources' option to print the source of a config value larsxschneider
2016-02-10 12:47 ` Ramsay Jones
2016-02-10 15:28   ` Sebastian Schuberth
2016-02-10 16:03     ` Ramsay Jones
2016-02-10 12:54 ` Jeff King
2016-02-10 15:33   ` Sebastian Schuberth
2016-02-10 15:40     ` Jeff King
2016-02-10 15:57       ` Sebastian Schuberth
2016-02-10 16:24         ` Jeff King [this message]
2016-02-10 19:03 ` Eric Sunshine

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=20160210162408.GD19867@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    --cc=sschuberth@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.
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).