Open-source Languages & Tools for z/OS

 View Only
  • 1.  Git 2.26.2-84 - Presence of an extra x0D character at the end of the line on files transcoded in EBCDIC

    Posted 9 days ago
    Hi,

    By cloning by Git for z/OS, in SSH protocol, a repository stored in our Bitbucket manager, and created on Windows, I notice the presence of an x0D character at the end of each line of the files encoded in EBCDIC.
    Files encoded in ASCII, or more precisely files that are not subject to codepage conversion, do not have this x0D character at the end of the line.

    I had to add an explicit "eol=lf" option in the .gitattributes file on the "*" pattern before cloning on USS to work around this problem.

    This is not satisfactory, because we use our Git repositories on various platforms, mainly Windows, and also z/OS-USS, and we don't want to force the handling of line endings in the .gitattributes file.
    We want each platform to be free to use whatever line endings it wants.

    All of our Git installations, Windows or USS, use the core.autocrlf=true configuration. This has the consequence of storing text files in internal format with an CRLF end-of-line sequence.
    When fetching to the working directory, the end-of-line sequence must be adapted to the platform: CRLF for Windows, LF for Unix/Linux, nothing (visible) for USS.

    The fact that only transcoded files (ASCII to EBCDIC) are affected by this problem leads me to suspect that it is a Git for z/OS specific anomaly that occurs at the time of this transcoding.

    Git version: Git 2.26.2-84

    ------------------------------
    Fallai Denis
    M
    Self Registered
    L'ISLE-ADAM FR
    ------------------------------


  • 2.  RE: Git 2.26.2-84 - Presence of an extra x0D character at the end of the line on files transcoded in EBCDIC

    PARTNER
    Posted 7 days ago
    I've only been into git since about 2017 when Rocket brought it to z/OS.  It's only in the last year or so that I've ventured out using VScode to edit essentially z/OS PDS members. I use VScode on windows, my colleague uses it running on MAC.   In all this time I've never had a problem with EOL characters in any of the environments.

    Our PDS members start out FB80  with no EOL characters. They get transferred to USS with a NL X'15' character being added to the end of each line.  Rocket encodes the file in UTF-8 within Git, which gets pushed to the GitHub.   If I clone the file to windows and dump the file in hex I see the EOL characters has been changed to CRLF as expected in windows.  My colleague has LF as the end of line character.  

    Interesting he also can run VScode on Windows under VMWARE on this MAC. When he looks at these files under windows they have the LF characters as the EOL character. This is understandable given the file was created on MAC. But he is still able to edit and save on his windows with just the LF as the EOL character. VScode even when running on windows handles just LF as the end of line character.

    As I said, I am relatively new to Git, especially using it in multiple different operating system, by so far we have no had issues running the default configuration everywhere.

    Regards,
    Gary

    ------------------------------
    Gary Freestone
    Systems Programmer
    Kyndryl Inc
    Mt Helen VIC AU
    ------------------------------



  • 3.  RE: Git 2.26.2-84 - Presence of an extra x0D character at the end of the line on files transcoded in EBCDIC

    Posted 6 days ago
    Hi Gary,

    I also use VS Code, with Zowe CLI + z/OSMF, to work with PDS files, and I don't have any problem either.

    I didn't quite understand if you were using Git for z/OS to clone to USS....
    If so, could you communicate the .gitattributes file used in your Git repositories?

    ------------------------------
    Fallai Denis
    M
    Self Registered
    L'ISLE-ADAM FR
    ------------------------------