z/OS Tools & Language

Expand all | Collapse all

Git: any ascii to ebcdic conversion for repo contents?

  • 1.  Git: any ascii to ebcdic conversion for repo contents?

    Posted 10-21-2016 17:00

    Is there any facility in beta or planned to do codepage conversion on repositories? We have an option like this in the java SVN client, the requirement and impl is described here:

    https://issues.tmatesoft.com/issue/SVNKIT-22

    This allows a 7-bit safe ASCII repo to:

    • checkout on z/OS
    • implicitly convert text files to IBM-1047 (SVN has the benefit of mimetypes for files)
    • use/build projects that expect to be in 1047
    • check in changes and have it work the way you’d want


  • 2.  RE: Git: any ascii to ebcdic conversion for repo contents?

    Posted 10-24-2016 08:23

    Yes, the encoding of checked-out files can be controlled via the git attributes mechanism. The release notes describe how to use this, but briefly, there are two new attributes available on a per-file basis:

    • git-encoding sets the encoding used in the repository
    • working-tree-encoding sets the encoding to be used in the checked-out working directory

    Conversion is done only if both attributes are set for a file. Here is an example that causes all .h and .c files to be checked out as EBCDIC:

    *.[hc] git-encoding=iso8859-1 working-tree-encoding=ibm-1047

    This allows an open source repo cloned from (say) github to be used bi-directionally.

    – Jerry



  • 3.  RE: Git: any ascii to ebcdic conversion for repo contents?

    Posted 10-24-2016 09:34

    Thanks Jerry. I’m starting to think there’s a third doc I haven’t seen yet, the release notes PDF. I was only looking at the README and the share/doc/git/*



  • 4.  RE: Git: any ascii to ebcdic conversion for repo contents?

    Posted 10-24-2016 09:55

    Here they are.

    git_2.3.5_release_notes.pdf (51.4 KB)



  • 5.  RE: Git: any ascii to ebcdic conversion for repo contents?

    Posted 10-24-2016 11:20

    Awesome, exactly the content I needed.