Re: [PATCH v2 6/6] worktree: simplify prefixing paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 23, 2016 at 11:31 AM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> On Sun, May 22, 2016 at 7:32 PM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
>> On Sun, May 22, 2016 at 5:33 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
>>> @@ -467,6 +467,8 @@ int cmd_worktree(int ac, const char **av, const char *prefix)
>>>         if (ac < 2)
>>>                 usage_with_options(worktree_usage, options);
>>> +       if (!prefix)
>>> +               prefix = "";
>>
>> Considering that all the other existing git-worktree subcommands
>> already handle NULL prefix acceptably, it makes me a bit uncomfortable
>> that this "fix", which could be local to add(), leaks into all the
>> other subcommands, thus making the assumption that they (or other new
>> subcommands) will never care about the distinction between NULL and
>> "".
>>
>> Not a big objection; just a minor niggle, probably not worth a re-roll.
>
> Okay, I see that you're taking advantage of the prefix="" in patch
> 5/6, as well, so it's not benefitting only add().

Yep. 'add' so far is the only command taking paths. The next four,
lock, unlock, move and delete, all deal with paths and need to deal
with NULL prefix otherwise.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]