Open-source Languages & Tools for z/OS

 View Only

 git 2.26.

Lionel Dyck's profile image
Lionel Dyck posted 02-01-2023 08:50

Something changed in git in terms of file encoding.

These files were created using this code:

cmd = 'cd' localrep'/'zigirep ,
   '&& git show' hcommit':'element ,
   '>' file

where localrep/zigirep, hcommit, element and file are all variables.

This is what I have on my work system for this use case using git version 2.26.2-78

t IBM-1047 T=on -rw-rw-rw- 1 SPLBD SYS1 1875 Feb 1 05:03 CHGSTR

But with git version 2.26.2-84 I get this:

t ISO8859-1 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 1875 Feb 1 08:06 CHGSTR

To summarize this - with git 2.26.2-27 the git show generated file is tagged as IBM-1047 and then with git 2.26.2-84 it is now tagged as ISO8859-1.

Why the change and how can I control it?

Lionel Dyck's profile image
Lionel Dyck
Note that issuing an: unset _TAG_REDIR_OUT resolves this but why ???
Gary Freestone's profile image
PARTNER Gary Freestone

This may have something to do with an issue I raised back in June last year. See

At the time Rocket admitted it was a problem but I haven't been able to get an answer out of them about what the fix was going to be. 

Maybe we now know.
Lionel Dyck's profile image
Lionel Dyck
Gary - I ran into this with ZIGI and needed to find a solution for all ZIGI users. Fortunately I was talking with the IBM z/OS Open Tools team and they (Igor) suggested this as a fix.
Gary Freestone's profile image
PARTNER Gary Freestone
Ok.  Now it's getting weird.   

If I issue   "git show xxxxx:file"  and use REXX's  OUTTRAP to capture the output  and do a bunch of SAYs to display it then it arrives back in EBCDIC. Because I can read it.

If I redirect the output to a file thus "git show xxxxx:file >/tmp/output" the the output file, as Lionel has already indicated, is ASCI encoded. 

I don't understand
Lionel Dyck's profile image
Lionel Dyck
Gary - you nailed it.  So why the change in git show processing? For the non-Z users it probably isn't an issue but we expect Rocket to look after the Z users here.
Benjamin Maloy's profile image
ROCKETEER Benjamin Maloy
Hey Lionel, sorry you are having problems with the updated git. I just tried to recreate the behavior you specified and indeed if you write the output of 'git show' to a new file, it will automatically be tagged as ISO88159. However, if you specify the output to a file that already has a tag specified, then that tag will be used. Perhaps you could prepend 'touch file && chtag -tc 1047 file' to your command?

Also, is it possible that the CHGSTR file was tagged beforehand when you used the old version of git? This may have changed if you updated from git 2.26.2-27 to git 2.26.2-84 and then cloned the repo you are working on anew.
Lionel Dyck's profile image
Lionel Dyck
I've got things working - i've recreated on a new repo so it wasn't a historical artiface.  after the 'git show' I'm now adding a chtag.