Jump to content

tabstop width?


pasdVn

Recommended Posts

Hey guys,

just a short question: Is it possible, to make git log, git diff etc. make tabstops show as 4 space (instead of 8, what is the default setting, as I think). I did not find any option until now :-(

I try to use git with another project, with an IDE/editor, that does not support the conversion from tabstop to real spaces, as the vc++ IDE does.

pasdVn

Link to comment
Share on other sites

Msysgit uses "less" pager from GNU coreutils (at least I believe so), which means man less:

-xn,... or --tabs=n,...
      Sets tab stops.  If only one n is specified, tab stops  are  set
      at  multiples  of n.  If multiple values separated by commas are
      specified, tab stops are set at those positions, and  then  con-
      tinue  with  the  same  spacing  as  the last two.  For example,
      -x9,17 will set tabs at positions  9,  17,  25,  33,  etc.   The
      default for n is 8.

Git is able to detect available pagers in many ways. It first looks for --pager='...' cmdline option (or --no-pager). If it's not given, it uses PAGER env variable. If it's empty, it maybe does something else and falls to "less" by default (or no-pager if not even "less" is available).

That means something like

export PAGER="less --tabs=4"

should help you. You can put it in your .bashrc (or .bash_profile) file, it might be in msysgit_installdir/etc/ or somewhere there.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use