On Thu, Jan 31, 2019 at 12:53:24PM -0800, Nickolai Belakovski wrote: > So where does that leave us for this series? We could move hashmap > back into used_atom, but if a user entered > --format="%(worktreepath)%(worktreepath:)" we'd end up freeing > worktrees twice. Not that that should stop us - that scenario is one > where user input isn't sensible and personally I don't think it's > necessary to protect against such things (unless the user was > reasonably confused, but I don't see that as the case here). > > I agree with Jeff that a ref-filter "context" would help. And in more > ways than one, it could help us decide ahead of time whether to check > if a ref is a branch or a tag before doing a hashmap lookup or just > skip the check (i.e. if there are no tags within the context, the > check would only add cost). But I do believe that that would be > outside the scope of this series. > > I think leaving it as globals is a tiny bit safer and also makes it > easier to pack it into a context if/when we decide to do that work, > but as always I'm open to other interpretations. Yeah, I agree with this: global for now, and then easily moved into a context struct later (along with all the other existing globals). -Peff