z/OS Tools & Language

Expand all | Collapse all

Git and codepages / hex-code

  • 1.  Git and codepages / hex-code

    Posted 11-14-2019 04:22

    Hi there,

    I’m using git on Unix System Services.
    We have our repository in UTF-8 because we’re have problems with cloning using our “standard-Codepage” IBM-1141.

    Filehandling in ISPF etc is no problem, we convert the files using iconv and git processing is fine.

    Now I want to use “git show” to have a look into previous versions of a specific file. But when I want to save the output of the command, it’s a bit weird.

    For example, in my Code there is EBCDIC “04” (non displayable character). Saving it in our repsitory, I convert it to UTF-8, so it’s getting a double-byte “C2 9C”. That’s fine.

    With “git show HEAD:FILENAME” I’m getting hex “62 04”.

    There are several more examples.

    We alse have Problems with our german special chars like “äöü”.
    So “ä” it’s in UTF-8 -> hex C3 A4
    with git show it’s HEX 66 9F.
    The last example seems like there is a code-translation from ASCII to EBCDIC, because ASCII C3 is EBCDIC 66 ans ASCII A4 is EBCDIC 9F.

    I’ve tried also using the repository in IBM-1141. But the result of git show is the same. So it seems to me, that git client has its own translation table, and I think, this isn’t fine.

    Does anyone have the same problems, or could try this, too?

    Here are my example:
    create a file in ISPF with HEX Code 00 till FF
    copying to USS (cat TSO-File | iconv -f ibm-1141 -t utf-8 > uss-filename) * because we have ibm-1141 in tso
    git add filename
    git commit -m COMMITMESSAGE
    git show HEAD:uss-filename > SHOW-FILE

    have a look with ISPF 3.17 into this file with HEX ON.
    If I convert the original-File back to ibm-1141 everything is fine. And I know, with “HEAD” theres no problem. But having a look into some earlier stages, git show is so much better/faster than checking out the whole repository to this specific commit and afterwards checking out the “master” again to be at the last commit. But sometimes I want to see, how the file looks at a specific commit!

    Thanks a lot.
    elo



  • 2.  RE: Git and codepages / hex-code

    Posted 11-17-2019 22:23

    elo,

    I’m interested to know what problems you are having with cloning using the IBM-1141codepage.

    Are talking about cloning from GITHUB to your system or cloning locally within your own system ?

    I’ve decided not to convert from IBM-1141 but I’m wondering where I am going to find problems.

    Gary



  • 3.  RE: Git and codepages / hex-code

    Posted 11-17-2019 22:58

    I should mention I have tried the X’00’->X’FF’ in a single member and the only trouble I add was with the X’15’ the NL (new line) character causing the line to be split whenever the character occurs.

    I have an edit macro that kicks in whenever I do a save and issues this message



  • 4.  RE: Git and codepages / hex-code

    Posted 11-18-2019 03:41

    Hi Gary,

    thanks. Did you try it without X’15’ and did “git show HEAD:FILENAME” from USS and saved the output, too? Are there any differences?

    The cloning process aborts during “download / clone” from github or bitbucket server with ibm-1141. Maybe our repository is to big, and the files contain many special chars like “äöü”. But this error was repeatable, so I’ve tried UTF-8 and this works fine.

    Elo