Mantis - git
Viewing Issue Advanced Details
3982 regular use minor have not tried 2009-10-28 14:29 2010-01-10 15:39
dam  
bwalton  
normal  
closed  
fixed  
none    
none  
0003982: On 'git diff' less is searched in path and /usr/bin/less is too old
Usually /usr/bin is in the path early and /usr/bin/less is found before /opt/csw/bin/less.
The /usr/bin/less doesn't know the -F option passed by git:

build8st% git diff
There is no -F option ("less --help" for help)
build8st% echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/opt/csw/bin:/usr/ccs/bin:/opt/csw/bin

After moving /opt/csw/bin to the head of PATH and use CSWless solves the problem:

build8st% PATH=/opt/csw/bin:$PATH
build8st% git diff
diff --git a/include/db_config.h b/include/db_config.h
index 3ba0973..3b9c82a 100644
--- a/include/db_config.h
...

It may be best to link from /opt/csw/libexec/git-core/less to /opt/csw/bin/less and depend on CSWless:

13984: stat64("/opt/csw/libexec/git-core/less", 0xFFBFF838) Err#2 ENOENT
13984: stat64("/usr/bin/less", 0xFFBFF838) = 0
13984: access("/usr/bin/less", 9) = 0
Issue History
2009-10-28 14:29 dam New Issue
2009-10-28 15:09 bwalton Note Added: 0006897
2009-10-28 15:09 bwalton Assigned To => bwalton
2009-10-28 15:09 bwalton Status new => acknowledged
2009-10-28 15:13 dam Note Added: 0006898
2009-10-28 15:13 bwalton Note Added: 0006899
2009-10-28 15:20 bwalton Note Added: 0006900
2009-10-28 15:37 dam Note Added: 0006901
2009-10-28 15:47 bwalton Note Added: 0006902
2009-10-28 15:54 dam Note Added: 0006903
2009-10-28 16:22 bwalton Note Added: 0006904
2009-11-01 02:39 bwalton Note Added: 0006932
2009-11-17 03:05 bwalton Note Added: 0006997
2009-12-24 20:25 bwalton Note Added: 0007127
2009-12-24 20:25 bwalton Status acknowledged => resolved
2009-12-24 20:25 bwalton Resolution open => fixed
2010-01-10 15:39 bwalton Status resolved => closed

Notes
(0006897)
bwalton   
2009-10-28 15:09   
Verified. You can (for now) work around this by setting GIT_PAGER=/opt/csw/bin/less or PAGER=/opt/csw/bin/less in your environment. Alternately, you can set core.pager in your git config (site, personal or project specific):

http://www.kernel.org/pub/software/scm/git/docs/git-config.html [^] (search for core.pager)

It looks like overriding the default will need to be hacked in or supplied with a site-wide config file as part of an updated package release. Do you feel that hacking in the autoconf support for this is worthwhile, given the above options?

(0006898)
dam   
2009-10-28 15:13   
I would just put the above mentioned link in the package in post-merge.
(0006899)
bwalton   
2009-10-28 15:13   
Also, you can override the options passed to less by setting your LESS environment variable to the desired value, the defaults git passes if LESS isn't set are: FSRX
(0006900)
bwalton   
2009-10-28 15:20   
You mean the link to git-config.html should be stuffed in a README.csw or something?
(0006901)
dam   
2009-10-28 15:37   
No, this does the trick nicely:
  ln -s /opt/csw/bin/less /opt/csw/libexec/git-core/less
(0006902)
bwalton   
2009-10-28 15:47   
While that would work, it doesn't seem clean to me...I don't like the
idea of stuffing non-git stuff into that libexec directory.
(0006903)
dam   
2009-10-28 15:54   
Ok then, but I would expect the the CSWless would be chosen, so adjusting the site wide config file would seem right.
(0006904)
bwalton   
2009-10-28 16:22   
I've sent a query to the git mailing list to see what the 'gurus' feel is the best path. I'll either add support for specifying a more specific 'less' at build time or ship a global gitconfig file, depending on the feedback I get.
(0006932)
bwalton   
2009-11-01 02:39   
There is now pending support for setting default pager and editor in git. I'll modify the build to use this when it reaches a mainstream release. Presently it's on the "pu" (proposed updates). I'm not sure whether it will land in 1.6.6, but I'd suspect so.
(0006997)
bwalton   
2009-11-17 03:05   
Patches are queued upstream. Will release an updated version when they hit a stable release.

-Ben
(0007127)
bwalton   
2009-12-24 20:25   
Updated packages in testing have /opt/csw/bin/less hardcoded into the binary. Please test. Will close with the release of the updated packages.