Subject: Re: [PATCH v5 02/14] trailer: process trailers from file and arguments

From: Junio C Hamano <[email-masked]>
Date: Fri, 14 Feb 2014 13:46:58 -0800

Christian Couder <[email-masked]> writes:

> For example some people might want:
>
>     if_exists = overwrite
>     if_missing = add
>
> while others might want:
>
>     if_exists = overwrite
>     if_missing = do_nothing
>
> and I don't see how we can say that with just:
>
>     action = do_Y_if_X_and_Z

Yes, but then we go back to my original question: why exists and
missing are so special, and why there aren't two kinds of exists
(i.e. "there exists an entry with the same <key, value>" vs "there
exists an entry with the same <key>").  I would have understood your
"this is not too hard to understand for users" if you had three
(i.e. "missing", in addition to these two flavours of "exists"), but
with only two, I do not see how it is useful in a hypothetical
situation like above.

For example, how would you express something like this only with
"if-exists" vs "if-missing"?

	if_exists_exactly = ignore
        if_exists_with_different_value = append
        if_missng = prepend_to_the_beginning