Re: Re* [PATCH v2 1/2] refs: refs/worktree/* become per-worktree
- From
David Turner <dturner@twopensource.com>
- Date
- Aug 11, 2015, 21:42 UTC
- Message-ID
- <1439329355.5283.34.camel@twopensource.com>
- In-Reply-To
- <xmqqvbclpm3h.fsf@gitster.dls.corp.google.com>
On Tue, 2015-08-11 at 14:10 -0700, Junio C Hamano wrote:
Show 9 quoted lines
> David Turner <dturner@twopensource.com> writes: > > > We need a place to stick refs for bisects in progress that is not > > shared between worktrees. So we use the refs/worktree/ hierarchy. > > This is by itself OK, but to help existing Porcelains, most notably > "gitk", I think refs/bisect/ hierarchy should be treated the same > way. Moving them out of refs/bisect/ to refs/worktree/bisect/ would > not be a good idea.
What does gitk do that's relevant here?
> Because refs/worktree/ hierarchy is not needed right now, I think we > can even live with just special casing refs/bisect/ the way this > patch does, without adding refs/worktree/ support at this point.
There are a few reasons for refs/worktree hierarchy:
1. To make it easy to see the behavior of a ref at a glance. 2. To avoid too many different special-cases.
It's true that special-casing refs/bisect would make for fewer code changes for now, but I am worried that next week we'll discover a new situation where we'll want per-worktree refs and then we'll have to add more special-cases.
Show 9 quoted lines
> > Note that git for-each-ref may have inconsistent behavior (I think; I > > haven't confirmed this), sometimes showing refs/worktree/* and sometimes > > not. In the long run, we should fix this, but right now, I don't know > > that it matters, since the only refs affected are these bisect refs. > > We should fix that before this hits 'master', preferrably before > this hits 'next', especially if we add support for the more generic > refs/worktree/. If it is only for refs/bisect/, we might be OK, but > I didn't think things through.
I will do this. Should for-each-ref include or exclude these refs? One simple way to do "include" is to always create the refs/worktree directory (when creating refs/).
I'll also fix the rest of the things you suggested.