Quantcast

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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Nathan Collins
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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Junio C Hamano
Nathan Collins <[hidden email]> 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.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Duy Nguyen
On Tue, May 24, 2016 at 3:30 AM, Junio C Hamano <[hidden email]> wrote:

> Nathan Collins <[hidden email]> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Junio C Hamano
Duy Nguyen <[hidden email]> 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Nathan Collins
In reply to this post by Junio C Hamano
On Mon, May 23, 2016 at 1:30 PM, Junio C Hamano <[hidden email]> wrote:

> Nathan Collins <[hidden email]> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Junio C Hamano
In reply to this post by Duy Nguyen
Duy Nguyen <[hidden email]> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Loading...