From: Lars Schneider <larsxschneider@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>, git@vger.kernel.org
Subject: Re: [PATCH v1] travis-ci: build documentation
Date: Mon, 25 Apr 2016 10:33:20 +0200 [thread overview]
Message-ID: <EDD0757C-2BD3-476F-B703-147D35BB1FAC@gmail.com> (raw)
In-Reply-To: <xmqqinz9pl3l.fsf@gitster.mtv.corp.google.com>
On 22 Apr 2016, at 20:14, Junio C Hamano <gitster@pobox.com> wrote:
> 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.
Oh, thanks! I didn't know that "case" can process two variables :-)
> 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".
All code in the .travis.yml is quite Travis CI specific and therefore
I think portability is not really an issue. However, I agree that
the .travis.yml should follow the Git coding guidelines for
consistency.
> There also are existing instances of "useless ;" that would want to
> be cleaned up regardless of portability issues.
Unfortunately it seems to be required. Travis CI generates a shell script
out of the yml file and I think they don't respect newlines or something...
>
>>> + 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 thought it is nice as it generates a visual distinctive separation
in the Travis CI output. However, Peff suggested a dedicated Documentation
build job which makes this separation obsolete.
>> 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.
What do you mean by "formatter does not give new/unknown warnings"?
Can you give me a hint what I could test here in addition?
Thanks,
Lars
next prev parent reply other threads:[~2016-04-25 8:33 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
2016-04-25 8:33 ` Lars Schneider [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=EDD0757C-2BD3-476F-B703-147D35BB1FAC@gmail.com \
--to=larsxschneider@gmail.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).