Unicode in a Git Alias

I am working on a project involving both English and Hebrew in Git (2.4.5 on Cygwin). I have not run into problems using Hebrew in the Git repository.

Since I often switch between Hebrew and English, I add aliases to my bashrc for general commands, so that it works if I try to enter them when my setting is Hebrew. for instance

alias עןא=git 

(עןא is not a translation or transliteration of Git, it is not a word at all. This is exactly what you get when you try to enter "git", but your keyboard is set to Hebrew).

However, when I try to take the next step, I have problems. I add aliases to the Git configuration:

  [alias] דאשאוד=status 

and then try running:

 $ עןא דאשאוד fatal: bad config file line 18 in /home/Heshy/.gitconfig 

(yes, דאשאוד = status - line 18)

Is there a way to get a Git alias for accepting Hebrew letters (via .gitconfig or otherwise)?

+5
source share
1 answer

I found the answer to my question, but it is ugly. Better answers are still welcome.

 echo 'git status " $@ "' > /bin/git-דאשאוד chmod u+x /bin/git-דאשאוד 

It works ... but with an error message that I don't understand.

 $ git דאשאוד error: invalid key: pager.דאשאוד Untracked files: (use "git add <file>..." to include in what will be committed) testfile nothing added to commit but untracked files present (use "git add" to track) 

The error message does not occur if I call the git -someenglishname file instead.

I also tried some grep manipulations from the error message. The problem is that if I put this in / bin / git - דאשאוד, the message is still there. I assume this is because the error message is generated by a call to git itself, outside of a git call - --אשאוד.

I think the complete solution would be to create a shell script for git itself (or, perhaps, only for עןא), which removes these error messages. It is even uglier. As I said, the best answer will still be very welcome.

0
source

All Articles