* t0025 weird behaviour on NonStop ksh/bash
@ 2015-05-08 23:17 Randall S. Becker
2015-05-09 2:50 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Randall S. Becker @ 2015-05-08 23:17 UTC (permalink / raw)
To: git
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?
Cheers,
Randall
-- Brief whoami: NonStop&UNIX developer since approximately
UNIX(421664400)/NonStop(211288444200000000)
-- In my real life, I talk too much.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: t0025 weird behaviour on NonStop ksh/bash
2015-05-08 23:17 t0025 weird behaviour on NonStop ksh/bash Randall S. Becker
@ 2015-05-09 2:50 ` Junio C Hamano
2015-05-09 3:11 ` Randall S. Becker
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2015-05-09 2:50 UTC (permalink / raw)
To: Randall S. Becker; +Cc: git
"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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: t0025 weird behaviour on NonStop ksh/bash
2015-05-09 2:50 ` Junio C Hamano
@ 2015-05-09 3:11 ` Randall S. Becker
0 siblings, 0 replies; 4+ messages in thread
From: Randall S. Becker @ 2015-05-09 3:11 UTC (permalink / raw)
To: 'Junio C Hamano'; +Cc: git
On May 8, 2015 10:51 PM Junio C Hamano wrote:
> > 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?
Absolutely agree. This (being the test case) is not the problem and adding
tr -d is not a viable solution even if it appears to fix the issue at this
moment in time. Built-in and variable processing need to behave in a
normalized manner. I'm working to get that resolved; however, actually doing
a proper fix happens to be outside of my control :(.
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: t0025 weird behaviour on NonStop ksh/bash
@ 2015-05-09 2:46 Randall S. Becker
0 siblings, 0 replies; 4+ messages in thread
From: Randall S. Becker @ 2015-05-09 2:46 UTC (permalink / raw)
To: git
On May 8, 2015 7:17 PM , I wrote in my haste:
> 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?
Digging deeper, this appears to be is Yet Another Platform Problem. There
are more '\r' characters sneaking about beyond just echo. I am taking it up
with other developers to see whether we can track down where the offending
'\r' characters are coming from. They do not appear to be from git or its
tests at this stage
Cheers,
Randall
-- Brief whoami: NonStop&UNIX developer since approximately
UNIX(421664400)/NonStop(211288444200000000)
-- In my real life, I talk too much.
.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-09 3:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-08 23:17 t0025 weird behaviour on NonStop ksh/bash Randall S. Becker
2015-05-09 2:50 ` Junio C Hamano
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
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 NNTP newsgroup(s).