Git自然不支持abas-s3。在ERP服务器上有一个名为s3_conv的程序,它可以将abas-s3转换为外部世界(例如UTF-8和UTF-16)以及相反方向。
有没有办法使用该程序,将存储库用UTF-8表示,而将工作树用s3表示?
感谢您的帮助!提前致谢!
You need to define in the config file (per repository, per user, or system-wide) a filter consisting of two commands: clean
that transforms from working area representation to repository representation, and smudge
that works in reverse. Assuming that s3_conv
works like iconv
, it could look like this (this is a fragment of appropriate config file):
[filter "s3conv"]
clean = s3_conv --from abas-s3 --to utf-8
smudge = s3_conv --from utf-8 --to abas-s3
Declare with gitattributes file (inside repository, or per-repository, or per-user, or system-wide) which files should be transformed using this operation. Assuming that you want to transform files with SQL, using *.sql
extension, appropriate fragment of a file could look like this (note that there cannot be whitespace around =
here):
*.sql filter=s3conv
git diff
正确显示更改(假设您没有能够显示abas-s3编码并且可以在core.pager
中使用的分页器),您可能想要配置textconv
过滤器而不是:
In config file:
[diff "s3conv"]
textconv = s3_conv --from abas-s3 --to utf-8
This assumes that terminal and pager is configured to display utf-8
In gitattributes file:
*.sql diff=s3conv