Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-09 Thread Junio C Hamano
Eric Freese writes: > However, this still prints an empty line for each ref that does not match the > condition. This can be cleaned up by piping through `grep .`, but what would > you think of adding a new optional flag to git-for-each-ref to prevent it from > printing empty expanded format stri

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-09 Thread Jeff King
On Sun, Sep 08, 2019 at 10:01:33PM -0600, Eric Freese wrote: > On Sun, Sep 9, 2019 at 4:34 PM Junio C Hamano wrote: > > > I guess with "%(if)...%(then)...%(else)...%(end)" you might be able > > to do either one of --include/--exclude without supporting the > > other, e.g. "--include='%(if)%(symr

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-08 Thread Eric Freese
On Sun, Sep 9, 2019 at 4:34 PM Junio C Hamano wrote: > I guess with "%(if)...%(then)...%(else)...%(end)" you might be able > to do either one of --include/--exclude without supporting the > other, e.g. "--include='%(if)%(symref)%(then)%(else)not a > symref%(end)" would be usable as "I do not want

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-08 Thread Junio C Hamano
Junio C Hamano writes: > Jeff King writes: > >> So in my mind there's an endgame we'd like to eventually reach where >> the option added by your patch isn't needed anymore. But we're a long >> way from that. And it's not entirely clear where we'd draw the line >> anyway. > > All true and very go

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-08 Thread Junio C Hamano
Jeff King writes: > So in my mind there's an endgame we'd like to eventually reach where > the option added by your patch isn't needed anymore. But we're a long > way from that. And it's not entirely clear where we'd draw the line > anyway. All true and very good "thinking out loud". > So in th

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-08 Thread Jeff King
On Sat, Sep 07, 2019 at 03:36:46PM -0600, Eric Freese wrote: > Using the new flag will omit symbolic refs from the output. > > Without this flag, it is possible to get this behavior by using the > `%(symref)` formatting field name and piping output through grep to > include only those refs that d

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-08 Thread Jeff King
On Sat, Sep 07, 2019 at 07:28:21PM -0400, Taylor Blau wrote: > > diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c > > index 465153e853..b71ab2f135 100644 > > --- a/builtin/for-each-ref.c > > +++ b/builtin/for-each-ref.c > > @@ -18,7 +18,7 @@ int cmd_for_each_ref(int argc, const char **

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-07 Thread Taylor Blau
On Sat, Sep 07, 2019 at 07:28:21PM -0400, Taylor Blau wrote: > ... Oh, great. I was pretty sure that vger accidentally ate my last mail, but I guess not. Sorry for the re-send. Thanks, Taylor

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-07 Thread Taylor Blau
Hi Eric, On Sat, Sep 07, 2019 at 03:36:46PM -0600, Eric Freese wrote: > Using the new flag will omit symbolic refs from the output. > > Without this flag, it is possible to get this behavior by using the > `%(symref)` formatting field name and piping output through grep to > include only those ref

Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-07 Thread Taylor Blau
Hi Eric, On Sat, Sep 07, 2019 at 03:36:46PM -0600, Eric Freese wrote: > Using the new flag will omit symbolic refs from the output. > > Without this flag, it is possible to get this behavior by using the > `%(symref)` formatting field name and piping output through grep to > include only those ref

[RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

2019-09-07 Thread Eric Freese
Using the new flag will omit symbolic refs from the output. Without this flag, it is possible to get this behavior by using the `%(symref)` formatting field name and piping output through grep to include only those refs that do not output a value for `%(symref)`, but having this flag is more elega