threads / discuss / 34752

How to set tab size for hunks in “git add -p”?

Subject: How to set tab size for hunks in “git add -p”?

## tl;dr

3 messages between Aug 23, 2013 and Aug 24, 2013.

replies: 2people: 2as markdown or json

Янчарук Александр· Aug 23, 2013, 17:28 UTC · lore
Hi!

I used the solution from here <http://stackoverflow.com/questions/15132325/how-to-set-tab-size-for-pager-used-in-git-diff> to change tab size in |git diff||| output. That works fine with git diff.

I have these settings in my *.gitconfig*:
    |[core]
    whitespace = tabsize=4,indent-with-non-tab
    pager = less -FSRX -x4
    |

But those settings seems does not affect on |git add -p|. How to set tab size for hunks in *git add -p* command?

Thanks in advance!
-- 
Best regards,
Alexander Yancharuk
alex@itvault.info <mailto:alex@itvault.info>
Antoine Pelisse· Aug 23, 2013, 18:19 UTC · re: Янчарук Александр · lore

Re: How to set tab size for hunks in “git add -p”?

On Fri, Aug 23, 2013 at 7:28 PM, Янчарук Александр <alex@itvault.info> wrote:
> But those settings seems does not affect on |git add -p|. How to set tab
> size for hunks in *git add -p* command?

That's because "git add -p" doesn't go through less/pager. You can certainly change the tabs size for your terminal with "tabs -4" though.

Янчарук Александр· Aug 24, 2013, 09:53 UTC · re: Antoine Pelisse · lore

Re: How to set tab size for hunks in “git add -p”?

Thanks a lot!

That solution worked for me: env TERM=linux setterm -regtabs 4

Best regards, Alexander Yancharuk alex@itvault.info <mailto:alex@itvault.info> On 23.08.2013 22:19, Antoine Pelisse wrote:

Show 5 quoted lines
> On Fri, Aug 23, 2013 at 7:28 PM, Янчарук Александр <alex@itvault.info> wrote:
>> But those settings seems does not affect on |git add -p|. How to set tab
>> size for hunks in *git add -p* command?
> That's because "git add -p" doesn't go through less/pager.
> You can certainly change the tabs size for your terminal with "tabs -4" though.

← back to recent threads