4

On my Xubuntu 14.04 system I've installed Git using

sudo apt-get install git

It's working all right (I'm only starting to learn it), but execution of

git diff

returns

error: cannot run sensible-paper: No such file or directory

as its first line. After the first line it gives the differences between the files, in other words, works all right.

Furthermore, command

man git

(or any other help commands, like git help commit) returns:

man: can't execute sensible-paper: No such file or directory
man: command exited with status 255: (cd /home/max/Desktop/Git Learning && LESS=-ix8RmPm Manual page git-commit(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page git-commit(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=git-commit(1) sensible-paper)

And so I can't get any help on Git at all (from my shell). I've Googled for solution, but couldn't find anything similar to the above errors. Any help appreciated.

user345286
  • 63
  • 3
  • That should be `sensible-pager`, on Debian/Mint/Ubuntu systems. Are you sure it says paper? – Fred Foo Oct 23 '14 at 09:01
  • 3
    @larsmans the typo [isn't unheard of](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711510). – rubenvb Oct 23 '14 at 09:02
  • Have you tried updating the system? (i.e. `sudo apt-get update && sudo apt-get upgrade`) – rubenvb Oct 23 '14 at 09:02
  • 2
    Did you try exporting a custom pager? `export PAGER=less` or something like that. Alternatively, run every command with `--no-pager`. – rodrigo Oct 23 '14 at 09:05
  • Thanks for your responses. Turns out I never ran Git commands otherwise than through "Ranger shell" (while in Ranger file manager, press S). Now I've tried to run those commands through a shell (xfce4-terminal) without Ranger, and it all works without any errors. What should I do about this question now? Mark it as solved? :\ – user345286 Oct 24 '14 at 04:34

2 Answers2

2

sensible-paper is clearly a typo for sensible-pager, which should be the pager executed by default.

To find out which environment variable is mis-set, you can run

env | grep sensible-paper

To ask Git to use sensible-pager anyway, run

git config --global core.pager sensible-pager
Matthieu Moy
  • 15,151
  • 5
  • 38
  • 65
2

It is a ranger problem.DEFAULT_PAGER value is misspelled: https://bugs.launchpad.net/ubuntu/+source/ranger/+bug/1331444.

Change sensible-paper to sensible-pager in the foloowing files:

/usr/share/ranger/ranger/ext/rifle.py:23:DEFAULT_PAGER = 'sensible-paper'
/usr/share/ranger/ranger/__init__.py:27:DEFAULT_PAGER = 'sensible-paper'
/usr/share/ranger/rifle:23:DEFAULT_PAGER = 'sensible-paper'
Ilya Bystrov
  • 2,902
  • 2
  • 14
  • 21