From: Junio C Hamano <[email protected]>
>
> These numerous questions you have to ask are indications why
> choosing "this condition goes to the left hand side of the equal
> sign (e.g. exists)" and "this condition goes to the right hand side
> (e.g. do-this-if_neighbor)" is not working well. The user has to
> remember which conditions go to the variable name and which
> conditions go to the action part.
If we limit it to "if_exists" and "if_missing", the user can remember
that without things becoming too complex.
> That is, not splitting the logic into two parts like you did,
> i.e. "if_X = do_Y_if_Z", which invites "why is it not if_true =
> do_Y_if_X_and_Z, if_X_and_Z = do_Y, if_Z = do_Y_if_X"?
It perhaps invite it, but there are reasons why splitting the logic
too much is not a good idea and why limiting the split to "if_exists"
and "if_missing" is a good tradeoff.
> One possible way to avoid the confusion is to say "do_Y_if_X_and_Z"
> without making the rule split into conditions and actions---I am
> NOT saying that is _better_, there may be other solutions to avoid
> this two-part logic in a cleaner way.
This has been discussed first last November and I don't think that a
solution better than what I implemented has been suggested.
The problem is we not only want to say:
action = do_Y_if_X_and_Z
but we also want to say:
action = do_Y_if_X_and_Z AND do_U_if_V
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
Thanks,
Christian.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html