`git difftool` refuses to run under Emacs inferior shell
When I type git difftool
under plain cygwin shell, I just receive benign exit:
~/sb/ws> git difftool
~/sb/ws>
But when I type exactly the same thing under Emacs inferior shell (running the same cygwin bash), I receive the following error:
~/sb/ws> git difftool
git difftool
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "ENU"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
~/sb/ws>
Any idea why this is happening and how to fix this?
(all other git commands, by the way, work perfectly under this Emacs inferior shell, so I can only assume this must be something specific to difftool
)
EDIT (providing variant & version information on the tools involved):
you're really have wrong LANG, look onto /usr/share/locale for list of available locales..
But really question is - why're using git directly in Emacs, when it has several good git modes, and magit - the best between them? Why not perform all tasks using Emacs?
PS I have an article about Emacs + Git...
Update 6 years later (2017)
all other git commands, by the way, work perfectly under this Emacs inferior shell, so I can only assume this must be something specific to difftool
What is specific to difftool
is that it is still (but not for long) written in perl: git-difftool.perl
But that will change soon with Git 2.12 (Q1 2017).
That means difftool
should run under Emacs just fine, not being bothered with Perl anymore.
See commit 03831ef and commit 019678d (19 Jan 2017) by Johannes Schindelin ( dscho
).
difftool
: implement the functionality in the builtin
The motivation for converting the difftool
is that Perl scripts are not at all native on Windows, and that git difftool
therefore is pretty slow on that platform, when there is no good reason for it to be slow.
In addition, Perl does not really have access to Git's internals.
That means that any script will always have to jump through unnecessary hoops, and it will often need to perform unnecessary work (eg when reading the entire config every time git config
is called to query a single config value).
The current version of the builtin difftool does not, however, make full use of the internals but instead chooses to spawn a couple of Git processes, still, to make for an easier conversion. There remains a lot of room for improvement, left later.
Note: to play it safe, the original difftool
is still called unless the config setting difftool.useBuiltin
is set to true
.
The reason: this new, experimental, builtin difftool
was shipped as part of Git for Windows v2.11.0, to allow for easier large-scale testing, but of course as an opt-in feature.
The speedup is actually more noticable on Linux than on Windows: a quick test shows that t7800-difftool.sh
runs/
The culprit is most likely the overhead incurred from still having to shell out to mergetool-lib.sh
and difftool--helper.sh
.
Still, it is an improvement.
链接地址: http://www.djcxy.com/p/94076.html上一篇: XMPP:允许客户通过代理进行通信?