On Tuesday, 24 July 2012 04:19:49 UTC-7, Thomas Ferris Nicolaisen wrote:
>
> On Tuesday, July 24, 2012 12:29:22 AM UTC+2, Graham Jans wrote:
>>
>> Consider this scenario:
>>
>> $ touch "a 1.txt"
>>
>> $ touch "a 2.txt"
>>
>> $ git add "a 1.txt"
>>
>> $ git status --porcelain
>>
>> A  "a 1.txt"
>>
>> ?? a 2.txt
>>
>>
>> Note that the added file is properly quoted to account for the space, but 
>> the unadded file is not.
>>
>> This makes these scenarios incredibly troublesome to parse with scripts, 
>> etc. As well, this behaviour just seems inconsistent.
>>
>> I am using *1.7.11.msysgit.0*. 
>>
>> Can someone suggest a next step or an easy shell-based bandaid for this 
>> scenario?
>>
>
>
>  Can you perhaps show us the part of the script where this is causing 
> problems? Perhaps some script-wizard here on the list can make it work for 
> you.
>
> I imagine either of those lines could be parsed into 2 columns using some 
> clever regular expression (first column status, and the second column 
> filename), and then the second column can be eval'ed somehow into a string 
> where the quotes are dropped.
>

I'm using a fairly standard one-line 'add all' bit, like this:

git status --porcelain | egrep "^\?" | awk '{print $2}' | xargs git add


Also, I have solved my present issue through brute force; I'm more 
concerned at this point about the general inconsistent behavior here.

 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/S3r__O815ooJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to