git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Eric Freese <ericdfreese@gmail.com>, git@vger.kernel.org
Subject: Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option
Date: Sun, 08 Sep 2019 15:34:05 -0700	[thread overview]
Message-ID: <xmqq4l1mmn8i.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <xmqq8sqyn6ek.fsf@gitster-ct.c.googlers.com> (Junio C. Hamano's message of "Sun, 08 Sep 2019 08:40:03 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Jeff King <peff@peff.net> 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 the meantime, this seems like a useful thing, and it
>> wouldn't be a burden to carry it even if we eventually added
>> "--omit=%(symref)" or something.

We can introduce two new options, e.g. --(include|exclude)=<format>
where

 * Without either, there is no filtering based on the placeholder
   expansion;

 * With only --include, only the refs for which <format> expands to
   non-empty are included.

 * With only --exclude, the refs for which <format> expands to
   non-empty are excluded (and everything else included).

 * With both --include and --exclude, only the refs for which the
   <format> for --include expands to non-empty are eligible to be
   included, but among them, the ones for which the <format> for
   --exclude expands to non-empty are discarded.

Then "--exclude=%(symref)" would be Eric's --no-symref,
"--include=%(symref)" would be the opposite (i.e. "show only
symbolic refs"), etc.

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 to see symrefs" in a
system that supports only "--include" without "--exclude".


  reply	other threads:[~2019-09-08 22:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-07 21:36 [RFC PATCH 0/1] for-each-ref: Add '--no-symbolic' option Eric Freese
2019-09-07 21:36 ` [RFC PATCH 1/1] for-each-ref: add " Eric Freese
2019-09-07 23:28   ` Taylor Blau
2019-09-07 23:39     ` Taylor Blau
2019-09-08  9:44     ` Jeff King
2019-09-07 23:37   ` Taylor Blau
2019-09-08 10:05   ` Jeff King
2019-09-08 15:40     ` Junio C Hamano
2019-09-08 22:34       ` Junio C Hamano [this message]
2019-09-09  4:01         ` Eric Freese
2019-09-09 12:57           ` Jeff King
2019-09-09 18:08           ` Junio C Hamano
2019-09-07 23:16 ` [RFC PATCH 0/1] for-each-ref: Add " Taylor Blau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq4l1mmn8i.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=ericdfreese@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).