Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-25 Thread Duy Nguyen
On Tue, May 23, 2017 at 5:52 AM, Manish Goregaokar wrote: > What work is remaining for prune-in-worktree? Link to the relevant > discussions? > > I might be able to take it over the finish line. (No guarantees) The finish line should be pretty close. I've addressed

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-22 Thread Manish Goregaokar
What work is remaining for prune-in-worktree? Link to the relevant discussions? I might be able to take it over the finish line. (No guarantees) -Manish Goregaokar On Mon, May 22, 2017 at 4:17 AM, Duy Nguyen wrote: > On Sat, May 20, 2017 at 5:30 PM, Junio C Hamano

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-22 Thread Duy Nguyen
On Sat, May 20, 2017 at 5:30 PM, Junio C Hamano wrote: > By the way, doesn't nd/prune-in-worktree topic that has been cooking > in 'pu' supersede this change? It not just protects the commit at > the tip of HEAD in each worktree, it also makes sure the ones in > HEAD's reflog

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-20 Thread Junio C Hamano
Manish Goregaokar writes: > One thing which I think hasn't been covered yet is the rebase > ORIG_HEAD. I'll see if that's still a problem on `pu` and make a patch > for it if so. IIRC, ORIG_HEAD, FETCH_HEAD, MERGE_HEAD and others are be transitory and never served as the

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-20 Thread Manish Goregaokar
Yes, you are right (on both counts). One thing which I think hasn't been covered yet is the rebase ORIG_HEAD. I'll see if that's still a problem on `pu` and make a patch for it if so. (I recall `git prune` during a rebase messing up repo state, though it's really my fault for trying that in the

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-20 Thread Junio C Hamano
manishea...@gmail.com writes: > +int for_each_worktree_ref(each_ref_fn fn, void *cb_data) > +{ > + int i, flag, retval = 0; > + struct object_id oid; > + struct worktree **worktrees = get_worktrees(GWT_SORT_LINKED); > + struct commit* commit; > + for (i = 0; worktrees[i]; i++)

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-18 Thread Brandon Williams
On 05/18, Samuel Lijin wrote: > On Thu, May 18, 2017 at 5:40 AM, Simon Ruderich wrote: > > On Wed, May 17, 2017 at 06:45:31PM -0700, Manish Goregaokar wrote: > >> Hm, my invocation of git-send-email keeps getting the threading wrong. > >> Is there a recommended set of

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-18 Thread Samuel Lijin
On Thu, May 18, 2017 at 5:40 AM, Simon Ruderich wrote: > On Wed, May 17, 2017 at 06:45:31PM -0700, Manish Goregaokar wrote: >> Hm, my invocation of git-send-email keeps getting the threading wrong. >> Is there a recommended set of arguments to the command? > > The threading

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-18 Thread Simon Ruderich
On Wed, May 17, 2017 at 06:45:31PM -0700, Manish Goregaokar wrote: > Hm, my invocation of git-send-email keeps getting the threading wrong. > Is there a recommended set of arguments to the command? The threading looks fine here (for both cases where you mentioned it being wrong). Why do you think

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-17 Thread Manish Goregaokar
Hm, my invocation of git-send-email keeps getting the threading wrong. Is there a recommended set of arguments to the command? Thanks, -Manish Goregaokar On Wed, May 17, 2017 at 6:42 PM, wrote: > From: Manish Goregaokar > > To ensure that `git

[PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-17 Thread manishearth
From: Manish Goregaokar To ensure that `git prune` does not remove refs checked out in other worktrees, we need to include these HEADs in the set of roots. This adds the iteration function necessary to do this. Signed-off-by: Manish Goregaokar ---