public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Randall S. Becker" <rsbecker@nexbridge•com>
Cc: <git@vger•kernel.org>
Subject: Re: t0025 weird behaviour on NonStop ksh/bash
Date: Fri, 08 May 2015 19:50:50 -0700	[thread overview]
Message-ID: <xmqqbnhuihv9.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <003101d089e5$27347610$759d6230$@nexbridge.com> (Randall S. Becker's message of "Fri, 8 May 2015 19:17:28 -0400")

"Randall S. Becker" <rsbecker@nexbridge•com> writes:

> Ok, I'm sure that this is not a git problem, but there is an assumption
> about echo behaviour in t0025 that may not be correct. When executed from a
> shell function on the HP NonStop platform under ksh and bash, the LFonly
> file annoyingly contains cr-lf not just lf. This causes sub-test 4 to fail.
> Weirdly, this does not happen from an interactive shell. My proposed
> solution, in t0025-crlf-auto.sh, to this is to make it explicit that bad
> behaviour on the part of echo should be dealt with severely, as in:
>
>         for w in Hello world how are you; do echo $w; done | tr -d '\r'
>>LFonly
>
> instead of 
>
>         for w in Hello world how are you; do echo $w; done >LFonly
>
> which is a no-op on platforms that behave themselves in this situation. Is
> this the proper approach?

Why on earth does "echo $w" that prints just ASCII alphabet and
nothing else (other than the end-of-line, of course) gives CRLF
in the first place?

Is stripping with "tr -d" a sane approach?  I am not sure if it is
tackling the right problem.

Because we use 'echo', expecting it to behave sensibly in many other
places, wouldn't it be the case that all your 'tr -d' here does is
to add an unnecessary pipe on sane platforms for this single test
script, while leaving all the other uses of 'echo' in other shell
scripts, including scripted Porcelains like 'git pull', broken on
your platform?

  reply	other threads:[~2015-05-09  2:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 23:17 t0025 weird behaviour on NonStop ksh/bash Randall S. Becker
2015-05-09  2:50 ` Junio C Hamano [this message]
2015-05-09  3:11   ` Randall S. Becker
  -- strict thread matches above, loose matches on Subject: below --
2015-05-09  2:46 Randall S. Becker

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=xmqqbnhuihv9.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=rsbecker@nexbridge$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox