Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread Junio C Hamano
Eric Sunshine writes: > Thanks for working on this metoo > Stepping back a bit, is a for-each-foo()-style interface desirable? > This sort of interface imposes a good deal of complexity on callers, > demanding a callback function and callback data (cb_data), and is

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread David Turner
On Mon, 2015-08-31 at 01:11 -0400, Eric Sunshine wrote: > Stepping back a bit, is a for-each-foo()-style interface desirable? > This sort of interface imposes a good deal of complexity on callers, > demanding a callback function and callback data (cb_data), and is > generally (at least in C) more

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread Mike Rappazzo
On Mon, Aug 31, 2015 at 1:11 AM, Eric Sunshine wrote: > Thanks for working on this. I apologize for not reviewing earlier > rounds (other than v2 [1]); it's been difficult to find a block of > time to do so... I appreciate your time and comments. > > On Sun, Aug 30,

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread Eric Sunshine
On Mon, Aug 31, 2015 at 2:44 PM, David Turner wrote: > On Mon, 2015-08-31 at 01:11 -0400, Eric Sunshine wrote: >> Stepping back a bit, is a for-each-foo()-style interface desirable? >> This sort of interface imposes a good deal of complexity on callers, >> demanding a

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread Eric Sunshine
On Mon, Aug 31, 2015 at 2:57 PM, Mike Rappazzo wrote: > On Mon, Aug 31, 2015 at 1:11 AM, Eric Sunshine > wrote: >> On Sun, Aug 30, 2015 at 3:10 PM, Michael Rappazzo wrote: >> Why does this iteration function specially filter out

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread Eric Sunshine
On Mon, Aug 31, 2015 at 2:57 PM, Mike Rappazzo wrote: > I wasn't sure that a bare repo would be considered a worktree. I > don't think that it would be > a good idea to include it. In the same vein that I can't checkout a > branch in a bare repo, it > figure that it

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread David Turner
On Mon, 2015-08-31 at 15:03 -0400, Eric Sunshine wrote: > On Mon, Aug 31, 2015 at 2:44 PM, David Turner > wrote: > > On Mon, 2015-08-31 at 01:11 -0400, Eric Sunshine wrote: > >> Stepping back a bit, is a for-each-foo()-style interface desirable? > >> This sort of

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread Mike Rappazzo
On Mon, Aug 31, 2015 at 3:47 PM, Eric Sunshine wrote: > On Mon, Aug 31, 2015 at 2:57 PM, Mike Rappazzo wrote: >> I wasn't sure that a bare repo would be considered a worktree. I >> don't think that it would be >> a good idea to include it. In the

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread Eric Sunshine
On Mon, Aug 31, 2015 at 3:54 PM, Mike Rappazzo wrote: > On Mon, Aug 31, 2015 at 3:47 PM, Eric Sunshine > wrote: >> On Mon, Aug 31, 2015 at 2:57 PM, Mike Rappazzo wrote: >>> I wasn't sure that a bare repo would be considered a

[PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-30 Thread Michael Rappazzo
for_each_worktree iterates through each worktree and invokes a callback function. The main worktree (if not bare) is always encountered first, followed by worktrees created by `git worktree add`. If the callback function returns a non-zero value, iteration stops, and the callback's return value

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-30 Thread Eric Sunshine
Thanks for working on this. I apologize for not reviewing earlier rounds (other than v2 [1]); it's been difficult to find a block of time to do so... On Sun, Aug 30, 2015 at 3:10 PM, Michael Rappazzo rappa...@gmail.com wrote: for_each_worktree iterates through each worktree and invokes a