From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: larsxschneider@gmail.com, git@vger.kernel.org
Subject: Re: [PATCH v1] travis-ci: build documentation
Date: Fri, 22 Apr 2016 11:14:06 -0700 [thread overview]
Message-ID: <xmqqinz9pl3l.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <vpq37qeovu4.fsf@anie.imag.fr> (Matthieu Moy's message of "Fri, 22 Apr 2016 11:07:31 +0200")
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> larsxschneider@gmail.com writes:
>
>> + if [[ "$TRAVIS_OS_NAME" = linux ]] && [[ "$CC" = gcc ]];
>
> [[ is a bashism, and doesn't bring anything here compared to the POSIX
> [ ... ], or "test" which is prefered in Git's source code.
>
> The ; or the newline is not needed either.
Honestly, I didn't know that we were even trying to be pure POSIX,
avoid bashism or GNUism, or in general to follow our shell scripting
style in the scriptlet in the .travis.yml file.
While I feel fairly strongly about keeping the generic part generic,
I am actually OK with things that are known to be used in a specific
environment to be specific to that environment.
Having said all that, if we are not benefiting from using features
beyond POSIX, then by all means we should strive to be writing our
stuff in a portable way, as we do not have firm control over from
where and to where people cut and paste code snippets.
And I do think bashism [[ ... ]] is *NOT* buying anything in this
particular case, so I do agree with you that
if test "$TRAVIS_OS_NAME" = linux && test "$CC" = gcc
then
...
or even
case "$TRAVIS_OS_NAME,$CC" in
linux,gcc)
...
is what I would have written instead if I were writing this
conditional.
If we were to shoot for "be POSIX unless we can clearly benefit from
being bash/gnu/linux specific in bash/gnu/linux specific parts", the
existing scriptlets in .travis.yml file has a few things that may
need to be cleaned up already. There are "mkdir --parents" (POSIX
spells it "-p"), "pushd/popd" and invocation of "tar" is very GNU
specific in the part that appears in the case arm for "linux".
There also are existing instances of "useless ;" that would want to
be cleaned up regardless of portability issues.
>> + then
>> + echo ""
>> + echo "------------------------------------------------------------------------" &&
>
> I usualy avoid "echo <something-starting-with-dash>" as I'm not sure how
> portable it is across variants of "echo". Maybe this one is portable
> enough, I don't know. Perhaps printf, or cat << EOF ...?
Do you even need a long divider there?
> I think it makes sense to do some lightweight checks after "make doc",
> rather than just check the return code. For example, check that a few
> generated files exist and are non-empty, like
>
> test -s Documentation/git.html &&
> test -s Documentation/git.1
Yup, or the formatter does not give new/unknown warnings.
Thanks.
next prev parent reply other threads:[~2016-04-22 18:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 8:34 [PATCH v1] travis-ci: build documentation larsxschneider
2016-04-22 9:07 ` Matthieu Moy
2016-04-22 18:14 ` Junio C Hamano [this message]
2016-04-25 8:33 ` Lars Schneider
2016-04-25 16:56 ` Junio C Hamano
2016-04-25 19:03 ` Junio C Hamano
2016-04-25 19:32 ` Matthieu Moy
2016-04-25 19:46 ` Junio C Hamano
2016-04-25 9:26 ` Matthieu Moy
2016-04-25 8:17 ` Lars Schneider
2016-04-25 9:37 ` Matthieu Moy
2016-04-22 10:45 ` stefan.naewe
2016-04-25 8:20 ` Lars Schneider
2016-04-23 3:39 ` Jeff King
2016-04-25 8:35 ` Lars Schneider
2016-04-25 17:07 ` Jeff King
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=xmqqinz9pl3l.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=larsxschneider@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.