git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Christian Couder <chriscool@tuxfamily.org>,
	git@vger.kernel.org, Johan Herland <johan@herland.net>,
	Josh Triplett <josh@joshtriplett.org>,
	Thomas Rast <tr@thomasrast.ch>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Greg Kroah-Hartman <greg@kroah.com>, Jeff King <peff@peff.net>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Ramsay Jones <ramsay@ramsay1.demon.co.uk>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH v10 11/12] Documentation: add documentation for 'git interpret-trailers'
Date: Tue, 08 Apr 2014 09:52:49 -0700	[thread overview]
Message-ID: <xmqq7g6zlq5a.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5343A589.10503@alum.mit.edu> (Michael Haggerty's message of "Tue, 08 Apr 2014 09:30:17 +0200")

Michael Haggerty <mhagger@alum.mit.edu> writes:

> Sorry for reappearing in this thread after such a long absence.  I
> wanted to see what is coming up (I think this interpret-trailers command
> will be handy!) so I read this documentation patch carefully, and added
> some questions and suggestions below.

Thanks for reading the patch carefully.  It helps to have fresh set
of eyes that are not contaminated by the preconception formed by
previous discussions, especially when reviewing the documentation
whose primary target audiences are those who do not care about these
previous back-and-forth.

>> +trailer.<token>.where::
>> +	This can be either `after`, which is the default, or
>> +	`before`. If it is `before`, then a trailer with the specified
>> +	token, will appear before, instead of after, other trailers
>> +	with the same token, or otherwise at the beginning, instead of
>> +	at the end, of all the trailers.
>
> Brainstorming: some other options that might make sense here someday:
> ...
>> +trailer.<token>.ifexist::
>> +	This option makes it possible to choose what action will be
>> +	performed when there is already at least one trailer with the
>> +	same token in the message.
>> ++
>> +The valid values for this option are: `addIfDifferent` (this is the
>> +default), `addIfDifferentNeighbor`, `add`, `overwrite` or `doNothing`.
>
> Are these option values case sensitive?

It is interesting and somewhat sad that it all has to come back
together inter-twined.  From the very beginning, I was opposed to
having logical complexity that requires multi-words in both variable
names (e.g. "if-exist") and values (e.g. "add-if-different"), and
after $gmane/241929 where I let the devil's advocate "how about
making the variable simpler without logical operation and put all
the conditional on the value side?" suggestion shot down, I somehow
was hoping that the value part got a lot simpler not to require
multi-words, which would have meant that we would not have to worry
about "Is it addIfDifferent? add-if-different? or Add_If_Different?"
at all.  Sadly that is not what we have ended up with.

So, with that realization...

> If so, it might be a little bit
> confusing because the same camel-case is often used in documentation for
> configuration *keys*, which are not case sensitive [1], and users might
> have gotten used to thinking of strings that look like this to be
> non-case-sensitive.

... very true.  Having to have these enum values as so complex to
require multi-words is probably the root cause of the confusion, and
we might probably be better off if we did not have to, but it would
be helpful to allow various different spellings (i.e. make them case
insensitive to allow random camel spellings, and also accept things
like "add-if-different" as well) if we absolutely have to have these
complex values.

But you had a lot of good questions and suggestions for possible
future enhancements that we would need to take into account while
designing the overall scheme to later allow them to fit into.  Maybe
a value that is a single-token that consists of just a few words
(e.g. "addIfDifferent") may not be the best way to go after all.

I dunno.

> What if there are multiple existing trailers with the same token?  Are
> they all overwritten?
> ...
> What if the key appears multiple times in existing trailers?

All good questions, I would think.

  parent reply	other threads:[~2014-04-08 16:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 17:01 [PATCH v10 00/12] Add interpret-trailers builtin Christian Couder
2014-04-06 17:01 ` [PATCH v10 01/12] trailer: add data structures and basic functions Christian Couder
2014-04-06 17:01 ` [PATCH v10 02/12] trailer: process trailers from stdin and arguments Christian Couder
2014-04-06 17:01 ` [PATCH v10 03/12] trailer: read and process config information Christian Couder
2014-04-06 17:01 ` [PATCH v10 04/12] trailer: process command line trailer arguments Christian Couder
2014-04-06 17:01 ` [PATCH v10 05/12] trailer: parse trailers from stdin Christian Couder
2014-04-06 17:01 ` [PATCH v10 06/12] trailer: put all the processing together and print Christian Couder
2014-04-06 17:01 ` [PATCH v10 07/12] trailer: add interpret-trailers command Christian Couder
2014-04-06 17:01 ` [PATCH v10 08/12] trailer: add tests for "git interpret-trailers" Christian Couder
2014-04-06 17:02 ` [PATCH v10 09/12] trailer: execute command from 'trailer.<name>.command' Christian Couder
2014-04-06 17:02 ` [PATCH v10 10/12] trailer: add tests for commands in config file Christian Couder
2014-04-06 17:02 ` [PATCH v10 11/12] Documentation: add documentation for 'git interpret-trailers' Christian Couder
2014-04-08  7:30   ` Michael Haggerty
2014-04-08 11:35     ` Christian Couder
2014-04-08 15:25       ` Michael Haggerty
2014-04-25 21:07         ` Christian Couder
2014-04-28 10:16           ` Michael Haggerty
2014-05-25  8:37             ` Christian Couder
2014-05-27  8:21               ` Michael Haggerty
2014-05-27  9:17                 ` Johan Herland
2014-05-27 19:18               ` Junio C Hamano
2014-04-08 16:52     ` Junio C Hamano [this message]
2014-04-08 21:26   ` Junio C Hamano
2014-04-25 19:56     ` Christian Couder
2014-04-28 16:37       ` Junio C Hamano
2014-04-29 11:05         ` Jeremy Morton
2014-04-29 11:47           ` Christian Couder
2014-04-29 13:25             ` Jeremy Morton
2014-05-01 18:54               ` Christian Couder
2014-04-29 13:25             ` Jeremy Morton
2014-04-06 17:02 ` [PATCH v10 12/12] trailer: add blank line before the trailers if needed Christian Couder
2014-04-07 21:38   ` Junio C Hamano
2014-04-08 12:48     ` Christian Couder

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=xmqq7g6zlq5a.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --cc=dan.carpenter@oracle.com \
    --cc=git@vger.kernel.org \
    --cc=greg@kroah.com \
    --cc=johan@herland.net \
    --cc=josh@joshtriplett.org \
    --cc=jrnieder@gmail.com \
    --cc=mhagger@alum.mit.edu \
    --cc=peff@peff.net \
    --cc=ramsay@ramsay1.demon.co.uk \
    --cc=sunshine@sunshineco.com \
    --cc=tr@thomasrast.ch \
    /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).