Sorry, I seem to have missed some important piece: Why do you want to
remove -R from the options? I'm asking because I'm running git from cmd.exe
(though without the git.cmd wrapper), and I have LESS=R set, i.e., I removed
everything *except* -R. I also have color.ui=auto in my global config to get
nice colors everywhere. So what's the problem?
-- Hannes
Because the -R option with colors seems to be buggy with some
buffer-sizes, resulting in some diff-lines disappearing. See issue
484:
http://code.google.com/p/msysgit/issues/detail?id=484
--
Erik "kusma" Faye-Lund
Actually, no-- what you're describing is "Run Git from the Windows
command prompt." If you want to run *the other included tools* from
cmd.exe, you clearly need more than git.cmd and gitk.cmd. =) But even
in this case, the installer does put the cmd directory *before* the
bin directory, so we're good. (The InnoSetup config file was
surprisingly easy to read...)
One patch, coming up.
--bert
From my tests, just setting LESS to "-FSX" doesn't work. That is:
git --no-pager diff --color=always | less -FSX
... works, I get nice colors. While:
LESS="-FSX" git diff
... does not work, I get that nasty "ESC[32m+ESC[mESC[32m"-garbled text.
So there seems to be something strange that I haven't fully understood
going on here. The patch I sent worked for me on Windows (as in, I get
colors and I'm not losing the reported lines). The issue with colors
on other platforms MIGHT not strictly be "-R", but I don't know yet.
Unfortunately, I don't have time to look at this right now. Once I
find some time I'll dig some more into it though... unless someone
else beats me to it, that is.
--
Erik "kusma" Faye-Lund
This should fix msysGit issue 484 (at least, for users that don't
override LESS or customize their PATH in non-standard ways).
Signed-off-by: bert Dvornik <dvorn...@gmail.com>
---
We may want to stick something about this into the docs someplace,
too, but I'm not sure where. Suggestions?
cmd/git.cmd | 1 +
etc/profile | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cmd/git.cmd b/cmd/git.cmd
index 773a2d9..3788f1a 100644
--- a/cmd/git.cmd
+++ b/cmd/git.cmd
@@ -7,6 +7,7 @@
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
@if "%HOME%"=="" @set HOME=%USERPROFILE%
+@if "%LESS%"=="" @set LESS=-FSX
@set PLINK_PROTOCOL=ssh
@if "%1"=="gui" @goto gui
diff --git a/etc/profile b/etc/profile
index 97f8eba..7451dad 100644
--- a/etc/profile
+++ b/etc/profile
@@ -146,7 +146,7 @@ PS1='\[\033]0;$MSYSTEM:\w\007
$ '
# set default options for 'less'
-export LESS=-FRSX
+export LESS=-FSX
# set default protocol for 'plink'
export PLINK_PROTOCOL=ssh
--
1.7.1.1927.g62e28c
...but, as Erik pointed out, it just completely breaks everything. I
thought I tested this before committing it, but it's clear I did
something wrong.
Please ignore this patch, and sorry for wasting time.
--bert
Hmm, but only from bash. cmd.exe gives me the nasty
"ESC[32m+ESC[mESC[32m"-garbled text without -R.
I definitely need to dig further. Just for reference, less --version
reports the same output from both shells:
less 358
Copyright (C) 2000 Mark Nudelman
less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
--
Erik "kusma" Faye-Lund
On Wed, 26 May 2010, Albert Dvornik wrote:
> On Tue, May 25, 2010 at 5:29 AM, Johannes Schindelin
> <Johannes....@gmx.de> wrote:
> [...]
> >> Would it cover all the cases, though? �Does the "Run Git and included
> >> Unix tools from the Windows command prompt" option put <git-root>\cmd
> >> ahead of <git-root>\bin in the PATH?
> >
> > It puts cmd in the PATH instead of bin.
>
> Actually, no-- what you're describing is "Run Git from the Windows
> command prompt."
Right, my mistake. Sorry.
Ciao,
Dscho
Yes, there's something very bizarre going on here. Your test works
for me, even though I don't have -R in $LESS right now. This also
works:
git --no-pager diff --color=always | LESS=-FSX less
export LESS=-FSX; git --no-pager diff --color=always | less
But all of the following spew escape sequences (!?):
git --no-pager diff --color=always | env LESS=-FSX less
git --no-pager diff --color=always | sh -c 'LESS=-FSX less'
git --no-pager diff --color=always | LESS=-FSX sh -c less
git --no-pager diff --color=always | LESS=-FSX sh -c 'exec less'
export LESS=-FSX
git --no-pager diff --color=always | env less
git --no-pager diff --color=always | sh -c less
git --no-pager diff --color=always | sh -c 'exec less'
git --no-pager diff --color=always > Q; sh -c 'less Q' # and variations
But "less Q" works.
I wonder if there is some weird nastiness going on where we "inherit"
some terminal initialization only if less is a direct child of the
login shell, or somesuch.
> I definitely need to dig further. Just for reference, less --version
> reports the same output from both shells:
> less 358
> Copyright (C) 2000 Mark Nudelman
Hmmmm, maybe we should try a newer version of less. Unfortunately,
I'm complelely swamped for the next few weeks.
--bert
Perhaps. The GNUWin32 project has less 394[1] (including the patches
to upstream less), which is "only" 5 years old (insted of 10 years old
as 358 is). However, some quick tests indicates that it's even more
broken. When piping anything at all into it, I don't get any output at
all.
Less 418 is the most recent upstream one, it seems.
[1]: http://gnuwin32.sourceforge.net/packages/less.htm
--
Erik "kusma" Faye-Lund