# gitattributes

5 messages from 2007-04-24 to 2007-04-24. Participants: Matthias Kestenholz, Alex Riesen, Junio C Hamano.
Thread: https://gitlist.dev/t/7814

## Matthias Kestenholz, 2007-04-24 11:36

Subject: gitattributes
Message-ID: <1f6632e50704240436l4a81d8c9s1bbf95a7892db68c@mail.gmail.com>
URL: https://gitlist.dev/e/1f6632e50704240436l4a81d8c9s1bbf95a7892db68c%40mail.gmail.com

```
The .gitattributes system together with input/output filters has already
proven exceptionally useful for me. I've got some co-workers which
do not seem to care about CRLF line endings or whitespace damage.

core.autocrlf = input

and

[filter "whitespace"]
  clean = stripspace
  smudge = cat

and

*.php  filter=whitespace
*.tpl  filter=whitespace

saves me minutes every day when I review changes made by others,
because otherwise the diffs are getting illegible (Sometimes, the whole
file is shown twice only because the line-ending changed)

It would be really great if these features were included in the next
release.


Thanks,
Matthias

```

## Alex Riesen, 2007-04-24 16:18

Subject: Re: gitattributes
Message-ID: <81b0412b0704240918t70bfb3bt5f0e6e85028be5e6@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0704240918t70bfb3bt5f0e6e85028be5e6%40mail.gmail.com
In-Reply-To: <1f6632e50704240436l4a81d8c9s1bbf95a7892db68c@mail.gmail.com>

```
On 4/24/07, Matthias Kestenholz <lists@spinlock.ch> wrote:
> The .gitattributes system together with input/output filters has already
> proven exceptionally useful for me. I've got some co-workers which
> do not seem to care about CRLF line endings or whitespace damage.
>
> core.autocrlf = input
>
> and
>
> [filter "whitespace"]
>   clean = stripspace
>   smudge = cat
>

Why didn't --ignore-space-at-eol, -b and -w work for you?

```

## Junio C Hamano, 2007-04-24 17:15

Subject: Re: gitattributes
Message-ID: <7vy7kh66dn.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vy7kh66dn.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <1f6632e50704240436l4a81d8c9s1bbf95a7892db68c@mail.gmail.com>

```
"Matthias Kestenholz" <lists@spinlock.ch> writes:

> The .gitattributes system together with input/output filters has already
> proven exceptionally useful for me. I've got some co-workers which
> do not seem to care about CRLF line endings or whitespace damage.
>
> core.autocrlf = input
>
> and
>
> [filter "whitespace"]
>  clean = stripspace
>  smudge = cat

You shouldn't need to say "smudge = cat"; if it does not work
without that line you found a bug, so please report.

```

## Junio C Hamano, 2007-04-24 21:40

Subject: Re: gitattributes
Message-ID: <7v4pn55u4d.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v4pn55u4d.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <81b0412b0704240918t70bfb3bt5f0e6e85028be5e6@mail.gmail.com>

```
"Alex Riesen" <raa.lkml@gmail.com> writes:

> On 4/24/07, Matthias Kestenholz <lists@spinlock.ch> wrote:
>> The .gitattributes system together with input/output filters has already
>> proven exceptionally useful for me. I've got some co-workers which
>> do not seem to care about CRLF line endings or whitespace damage.
>>
>> core.autocrlf = input
>>
>> and
>>
>> [filter "whitespace"]
>>   clean = stripspace
>>   smudge = cat
>>
>
> Why didn't --ignore-space-at-eol, -b and -w work for you?

It should.  What Matthias would want more is probably to have
others to have the "clean" side of the filter in their working
repository.

```

## Matthias Kestenholz, 2007-04-24 22:06

Subject: Re: gitattributes
Message-ID: <1f6632e50704241506q15315ccbi239b5eee1f184b3e@mail.gmail.com>
URL: https://gitlist.dev/e/1f6632e50704241506q15315ccbi239b5eee1f184b3e%40mail.gmail.com
In-Reply-To: <7v4pn55u4d.fsf@assigned-by-dhcp.cox.net>

```
2007/4/24, Junio C Hamano <junkio@cox.net>:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>
> > On 4/24/07, Matthias Kestenholz <lists@spinlock.ch> wrote:
> >> The .gitattributes system together with input/output filters has already
> >> proven exceptionally useful for me. I've got some co-workers which
> >> do not seem to care about CRLF line endings or whitespace damage.
> >>
> >> core.autocrlf = input
> >>
> >> and
> >>
> >> [filter "whitespace"]
> >>   clean = stripspace
> >>   smudge = cat
> >>
> >
> > Why didn't --ignore-space-at-eol, -b and -w work for you?
>
> It should.  What Matthias would want more is probably to have
> others to have the "clean" side of the filter in their working
> repository.

Yes, that's the reason. Furthermore, I like the approach of the filter
better than adding command line arguments (which I and others will
always forget on the first try)

I've just copy-pasted the smudge filter from an example I saw on
the list. I'll retest the filter setup tomorrow without "smudge = cat"
and look for problems.

```
