Re: [PATCH v3 3/5] grep: fix bug when recursing with relative pathspec

2017-03-22 Thread Brandon Williams
On 03/21, Duy Nguyen wrote: > On Sat, Mar 18, 2017 at 12:22 AM, Brandon Williams wrote: > > With these two pieces of information a child process can correctly > > interpret the pathspecs provided by the user as well as being able to > > properly format its output relative to the directory the user

Re: [PATCH v3 3/5] grep: fix bug when recursing with relative pathspec

2017-03-21 Thread Junio C Hamano
Duy Nguyen writes: >> if (recurse_submodules) >> argv_array_push(&submodule_options, "--recurse-submodules"); > > Side note. It would be awesome if you could make parse_options() (or a > new function) do the reverse process: given a 'struct option' with > valid data, spit

Re: [PATCH v3 3/5] grep: fix bug when recursing with relative pathspec

2017-03-21 Thread Duy Nguyen
On Sat, Mar 18, 2017 at 12:22 AM, Brandon Williams wrote: > With these two pieces of information a child process can correctly > interpret the pathspecs provided by the user as well as being able to > properly format its output relative to the directory the user invoked > the original command from

[PATCH v3 3/5] grep: fix bug when recursing with relative pathspec

2017-03-17 Thread Brandon Williams
When using the --recurse-submodules flag with a relative pathspec which includes "..", an error is produced inside the child process spawned for a submodule. When creating the pathspec struct in the child, the ".." is interpreted to mean "go up a directory" which causes an error stating that the p