Apocalisp
Apocalisp

Reputation: 35054

Can I supply gitattributes from the command line?

I have the following in my .gitconfig:

[diff "haskell"]
  textconv=brittany

I want to invoke diff with this textconv occasionally, but not always, on .hs files.

If I put this in my .gitattributes, then brittany will always be invoked when diffing .hs files:

*.hs diff=haskell

But I only want to do this sometimes. Is there a way I can tell git from the command line to use the attribute diff=haskell, or tell it to use a particular .gitattributes file?

Upvotes: 2

Views: 200

Answers (1)

ElpieKay
ElpieKay

Reputation: 30868

Remove or comment out textconv=brittany from .gitconfig, so that git diff(and other commands that generate diff like git show and git log -p) on .hs files does not invoke brittany. When you want to invoke it, use

git -c diff.haskell.textconv=brittany diff

Upvotes: 1

Related Questions