# [BUG?] Spaces not allowed in directory names in .git/info/attributes

6 messages from 2016-05-23 to 2016-05-25. Participants: Nathan Collins, Junio C Hamano, Duy Nguyen.
Thread: https://gitlist.dev/t/42424

## Nathan Collins, 2016-05-23 19:06

Subject: [BUG?] Spaces not allowed in directory names in .git/info/attributes
Message-ID: <CAO8RVveOwrS6+pTnHY36d1Nk_B_VJD022W9i8STnNb-KyMkqNg@mail.gmail.com>
URL: https://gitlist.dev/e/CAO8RVveOwrS6%2BpTnHY36d1Nk_B_VJD022W9i8STnNb-KyMkqNg%40mail.gmail.com

```
Example session:

    $ git init test.git
    Initialized empty Git repository in /tmp/test.git/.git/
    $ cd test.git
    $ mkdir "dir name"
    $ touch dir\ name/file.txt
    $ echo "dir\\ name/file.txt -text -whitespace" >> .git/info/attributes
    $ git add dir\ name/file.txt
    name/file.txt is not a valid attribute name: .git/info/attributes:1

I'm using

    $ git --version
    git version 2.5.0

Cheers,

-nathan

```

## Junio C Hamano, 2016-05-23 20:30

Subject: Re: [BUG?] Spaces not allowed in directory names in .git/info/attributes
Message-ID: <xmqqmvng8qle.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqmvng8qle.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <CAO8RVveOwrS6+pTnHY36d1Nk_B_VJD022W9i8STnNb-KyMkqNg@mail.gmail.com>

```
Nathan Collins <nathan.collins@gmail.com> writes:

> Example session:
>
>     $ git init test.git
>     Initialized empty Git repository in /tmp/test.git/.git/
>     $ cd test.git
>     $ mkdir "dir name"
>     $ touch dir\ name/file.txt
>     $ echo "dir\\ name/file.txt -text -whitespace" >> .git/info/attributes
>     $ git add dir\ name/file.txt
>     name/file.txt is not a valid attribute name: .git/info/attributes:1

That's because spaces are not allowed in paths there.

	echo "dir?name/file.txt -text" >.git/info/attributes

may be an easy workaround for now.

```

## Duy Nguyen, 2016-05-24 01:37

Subject: Re: [BUG?] Spaces not allowed in directory names in .git/info/attributes
Message-ID: <CACsJy8DXW-K-iNO65yuzMLPZS_8+R1gsQgNftwei1XUZNxhicg@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8DXW-K-iNO65yuzMLPZS_8%2BR1gsQgNftwei1XUZNxhicg%40mail.gmail.com
In-Reply-To: <xmqqmvng8qle.fsf@gitster.mtv.corp.google.com>

```
On Tue, May 24, 2016 at 3:30 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Nathan Collins <nathan.collins@gmail.com> writes:
>
>> Example session:
>>
>>     $ git init test.git
>>     Initialized empty Git repository in /tmp/test.git/.git/
>>     $ cd test.git
>>     $ mkdir "dir name"
>>     $ touch dir\ name/file.txt
>>     $ echo "dir\\ name/file.txt -text -whitespace" >> .git/info/attributes
>>     $ git add dir\ name/file.txt
>>     name/file.txt is not a valid attribute name: .git/info/attributes:1
>
> That's because spaces are not allowed in paths there.
>
>         echo "dir?name/file.txt -text" >.git/info/attributes
>
> may be an easy workaround for now.

Maybe bring back [1] (cquoting paths) and optionally optionally with
backslash escaping? The conclusion at the end of that thread seems to
be "ok, we may break rare setups, we just need to be upfront about
it". Another option is the pathspec way: match quotes literally as
well.

[1] http://thread.gmane.org/gmane.comp.version-control.git/160597/focus=160720
-- 
Duy

```

## Junio C Hamano, 2016-05-24 22:54

Subject: Re: [BUG?] Spaces not allowed in directory names in .git/info/attributes
Message-ID: <xmqqtwhn2hjl.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqtwhn2hjl.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <CACsJy8DXW-K-iNO65yuzMLPZS_8+R1gsQgNftwei1XUZNxhicg@mail.gmail.com>

```
Duy Nguyen <pclouds@gmail.com> writes:

> Maybe bring back [1] (cquoting paths) and optionally optionally with
> backslash escaping? The conclusion at the end of that thread seems to
> be "ok, we may break rare setups, we just need to be upfront about
> it".

Yup, even though I do not think this is something urgent.

> [1] http://thread.gmane.org/gmane.comp.version-control.git/160597/focus=160720

```

## Nathan Collins, 2016-05-24 23:30

Subject: Re: [BUG?] Spaces not allowed in directory names in .git/info/attributes
Message-ID: <CAO8RVve07Gvr2Bes2Dp-08_8MSQoVcBm9gjMaKTU=uAXcY_1wQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAO8RVve07Gvr2Bes2Dp-08_8MSQoVcBm9gjMaKTU%3DuAXcY_1wQ%40mail.gmail.com
In-Reply-To: <xmqqmvng8qle.fsf@gitster.mtv.corp.google.com>

```
On Mon, May 23, 2016 at 1:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Nathan Collins <nathan.collins@gmail.com> writes:
>
>> Example session:
>>
>>     $ git init test.git
>>     Initialized empty Git repository in /tmp/test.git/.git/
>>     $ cd test.git
>>     $ mkdir "dir name"
>>     $ touch dir\ name/file.txt
>>     $ echo "dir\\ name/file.txt -text -whitespace" >> .git/info/attributes
>>     $ git add dir\ name/file.txt
>>     name/file.txt is not a valid attribute name: .git/info/attributes:1
>
> That's because spaces are not allowed in paths there.
>
>         echo "dir?name/file.txt -text" >.git/info/attributes
>
> may be an easy workaround for now.

Thanks, I'll use the workaround,

-nathan

```

## Junio C Hamano, 2016-05-25 21:56

Subject: Re: [BUG?] Spaces not allowed in directory names in .git/info/attributes
Message-ID: <xmqqmvndztrf.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqmvndztrf.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <CACsJy8DXW-K-iNO65yuzMLPZS_8+R1gsQgNftwei1XUZNxhicg@mail.gmail.com>

```
Duy Nguyen <pclouds@gmail.com> writes:

> Maybe bring back [1] (cquoting paths) and optionally optionally with
> backslash escaping? The conclusion at the end of that thread seems to
> be "ok, we may break rare setups, we just need to be upfront about
> it". Another option is the pathspec way: match quotes literally as
> well.
>
> [1] http://thread.gmane.org/gmane.comp.version-control.git/160597/focus=160720

I coaxed the ancient patch that was done in the 1.7.2 timeperiod and
will push out the result near the tip of jc/attr topic that has been
cooking in 'pu'.

Thanks.

```
