Hi,
On Fri, 3 Jun 2016, Duy Nguyen wrote:
> On Thu, Jun 2, 2016 at 11:49 PM, Junio C Hamano wrote:
>
> > Does "basename()" used here know '/' and '\' can both be a directory
> > separator, or does worktree->path have a normalized representation of
> > the path, i.e. '/' is the only directory sep
Duy Nguyen writes:
> basename() does (or I think so because Windows has its own version).
> worktree->path always uses '/' but the command line option can come
> with either '/' or '\'. Probably safest to accept both.
OK. Going beyond basename() was merely "This might be an easy
nice-to-have en
On Thu, Jun 2, 2016 at 11:49 PM, Junio C Hamano wrote:
> +static struct worktree *find_worktree_by_basename(struct worktree **list,
> + const char *base_name)
> +{
> + struct worktree *found = NULL;
> + int nr_found = 0;
> +
> + for
Duy Nguyen writes:
> On Thu, Jun 2, 2016 at 1:44 AM, Junio C Hamano wrote:
>>> We would
>>> need to convert or match both '/' and '\' in "to/foo" case because of
>>> Windows, so it's not much easier than basename().
>>
>> I never said "easier to implement". But can this codepath get
>> backslas
On Thu, Jun 2, 2016 at 1:44 AM, Junio C Hamano wrote:
>> We would
>> need to convert or match both '/' and '\' in "to/foo" case because of
>> Windows, so it's not much easier than basename().
>
> I never said "easier to implement". But can this codepath get
> backslashed paths in the first place?
Duy Nguyen writes:
>> That is, wouldn't you rather see "worktree lock to/foo" work when
>> 'foo' is ambiguous but 'to/foo' is not?
>
> I don't know. I suppose if people have to make `basename $path` the
> same because of some weird build settings, e.g. abc/git and def/git,
> then this basename se
On Wed, Jun 1, 2016 at 12:51 AM, Junio C Hamano wrote:
> Nguyễn Thái Ngọc Duy writes:
>
>> This allows the user to do something like "worktree lock foo" instead of
>> "worktree lock ". With completion support it could be quite
>> convenient. While this base name search can be done in the same wo
Nguyễn Thái Ngọc Duy writes:
> This allows the user to do something like "worktree lock foo" instead of
> "worktree lock ". With completion support it could be quite
> convenient. While this base name search can be done in the same worktree
> iteration loop, the code is split into a separate fun
This allows the user to do something like "worktree lock foo" instead of
"worktree lock ". With completion support it could be quite
convenient. While this base name search can be done in the same worktree
iteration loop, the code is split into a separate function for clarity.
Suggested-by: Eric S
9 matches
Mail list logo