Re: [PATCH 3/3] rev-parse: simplify parsing of ref options

2017-03-15 Thread Jeff King
On Wed, Mar 15, 2017 at 02:09:33PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > This actually drops the last caller for for_each_branch_ref(). I'm not > > sure if we shoulder consider cleaning up the proliferation of > > for_each_ref() helpers. > > That is certainly a

Re: [PATCH 3/3] rev-parse: simplify parsing of ref options

2017-03-15 Thread Junio C Hamano
Jeff King writes: > This actually drops the last caller for for_each_branch_ref(). I'm not > sure if we shoulder consider cleaning up the proliferation of > for_each_ref() helpers. That is certainly a good thing to do (but outside this series). I am wondering if "git diff" could

[PATCH 3/3] rev-parse: simplify parsing of ref options

2017-03-15 Thread Jeff King
All of these options do the same thing "--foo" iterates over the "foo" refs, and "--foo=" does the same with a glob. We can factor this into its own function to avoid repeating ourselves. There are two subtleties to note: - the original called for_each_branch_ref(), etc, in the non-glob