Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-22 Thread Eric Sunshine
On Wed, Nov 22, 2017 at 12:09 PM, Kaartic Sivaraam wrote: > On Wednesday 22 November 2017 03:07 AM, Eric Sunshine wrote: >> [1]: Excerpt from: >> https://public-inbox.org/git/capig+cttrv2c7jlu1dr4+n8xo+7yq+deiwlda835wbgd6fh...@mail.gmail.com/ >> >> Other information

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-22 Thread Kaartic Sivaraam
Kaartic: Regarding the actual patch, rather than silencing validate_worktree() (which seems an unfortunate thing to do), isn't it possible simply to do a quick test to see if the worktree directory exists before calling validate_worktree()? If it doesn't exist, then just skip down to the part of

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-22 Thread Kaartic Sivaraam
On Wednesday 22 November 2017 09:25 AM, Junio C Hamano wrote: Eric Sunshine writes: So, Kaatic's patch is intended to address that oversight (though I haven't examined the implementation closely; I was just trying to understand the reason for the patch). OK, so the

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-22 Thread Kaartic Sivaraam
On Wednesday 22 November 2017 03:07 AM, Eric Sunshine wrote: On Tue, Nov 21, 2017 at 10:09 AM, Kaartic Sivaraam wrote: The new feature to 'remove' worktree was handy to remove specific worktrees. It didn't cover one particular case of removal. Specifically, if there

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-21 Thread Eric Sunshine
On Tue, Nov 21, 2017 at 10:55 PM, Junio C Hamano wrote: > OK, so the proposed log message was a bit confusing for those who > are *not* the person who wrote it (who knew why existing behaviour > was inadequate and did not describe how "worktree remove" would fail > under such a

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-21 Thread Junio C Hamano
Eric Sunshine writes: > On Tue, Nov 21, 2017 at 10:14 PM, Eric Sunshine > wrote: >> The erroring out in this case looks like simple oversight. Most >> likely, this particular case did not occur to Duy. The code does >> intentionally check the

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-21 Thread Eric Sunshine
On Tue, Nov 21, 2017 at 10:14 PM, Eric Sunshine wrote: > The erroring out in this case looks like simple oversight. Most > likely, this particular case did not occur to Duy. The code does > intentionally check the directory to see if it is dirty so that it can > warn the

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-21 Thread Eric Sunshine
On Tue, Nov 21, 2017 at 9:12 PM, Junio C Hamano wrote: > Eric Sunshine writes: >> Let me see if I understand. Sometimes you know that you've deleted the >> worktree directory, in which case 'git worktree prune' is the obvious >> choice. However, there

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-21 Thread Junio C Hamano
Eric Sunshine writes: > Let me see if I understand. Sometimes you know that you've deleted the > worktree directory, in which case 'git worktree prune' is the obvious > choice. However, there may be cases when you've forgotten that you > deleted the worktree directory

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-21 Thread Eric Sunshine
On Tue, Nov 21, 2017 at 10:09 AM, Kaartic Sivaraam wrote: > The new feature to 'remove' worktree was handy to remove specific > worktrees. It didn't cover one particular case of removal. Specifically, > if there is an "entry" (a directory in /.git/worktrees) > for a

[RFC PATCH] builtin/worktree: enhance worktree removal

2017-11-21 Thread Kaartic Sivaraam
The new feature to 'remove' worktree was handy to remove specific worktrees. It didn't cover one particular case of removal. Specifically, if there is an "entry" (a directory in /.git/worktrees) for a worktree but the worktree repository itself does not exist then it means that the "entry" is