[issue660] grml-policy needs a serious bit of love

Frank Terbeck bts at bts.grml.org
Tue Apr 7 15:32:37 CEST 2009


Frank Terbeck <ft at grml.org> added the comment:

Michael Prokop <bts at bts.grml.org>:
> * Frank Terbeck <bts at bts.grml.org> [20090407 13:56]:
[...]
> >   b) I don't see how -z is any clearer than -n in shell tests.
> 
> It's not the -z/-n itself but the else:
> 
> if foo ; then
>    $short_part
> else
>    $long_part
> fi
> 
> instead of:
> 
> if foo ; then
>    $long_part
> else
>    $short_part
> fi

Well, is this worth putting into a policy, that's rather a requirement
for code to be accepted? I think stuff like this turns out correctly
most of the time.

Furthermore, I'd prefer to contradict the above if that makes the code
more logical and the test easier to read. (A simple example would be,
when one test is trivial and another is hard to get right, but only
the hard one creates the desired version).

What I did for now is to put a "when-in-rome-do-it-as-the-romans-do"
comment (1f92c80958cd90d9a0f419ea97828fff4d850ad8).

> >   c) We don't use mercurial anymore. Examples need to be about git.
> 
> ACK :)

[x] done in: 9820b9337b8814283f7ef8cfab85c0201daa1c3f

So, what's left is the "incomplete" part.
That'll probably stay that way for a while. We should probably discuss
what we want in there, possibly on the grml-devel mailing list.

My work-in-progress (which contains the commit hashes used herein) is
in ft/policy-wip, at:
http://git.grml.org/?p=grml-policy.git;a=shortlog;h=refs/heads/ft/policy-wip

Regards, Frank

----------
messages: 2160, 2162, 2163
nosy: ft, mika
priority: bug
status: chatting
title: grml-policy needs a serious bit of love

_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue660>
_____________________________________


More information about the Bugs-changes mailing list