All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] refs: support negative transfer.hideRefs
Date: Tue, 28 Jul 2015 13:14:47 -0700	[thread overview]
Message-ID: <xmqqwpxkca4o.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150728195934.GB13795@peff.net> (Jeff King's message of "Tue, 28 Jul 2015 15:59:34 -0400")

Jeff King <peff@peff.net> writes:

> If you hide a hierarchy of refs using the transfer.hideRefs
> config, there is no way to later override that config to
> "unhide" it. This patch implements a "negative" hide which
> causes matches to immediately be marked as unhidden, even if
> another match would hide it. We take care to apply the
> matches in reverse-order from how they are fed to us by the
> config machinery, as that lets our usual "last one wins"
> config precedence work (and entries in .git/config, for
> example, will override /etc/gitconfig).
>
> There are two alternatives that were considered and
> rejected:
> ...
>   1. A generic config mechanism for removing an item from a
>      ...
>   2. Adding another variable to override some parts of
>      ...
>      Of course we could internally parse that to a single
>      list, respecting the ordering, which saves us having to
>      invent the new "!" syntax. But using a single name
>      communicates to the user that the ordering _is_
>      important. And "!" is well-known for negation, and
>      should not appear at the beginning of a ref (it is
>      actually valid in a ref-name, but all entries here
>      should be fully-qualified, starting with "refs/").

I notice that the only time you said that you chose '!' prefix as
the way to express this new "negative" is as a side note to the
rejected second variant ;-).  The first paragraph would have been a
good place to say that, because the first thing I wondered after
reading three lines (including the subject) into the log was "ok, it
makes sense and I know what alternatives were considered and
discarded for what reasons without reading the rest, now did he use
prefix '-', prefix '~', prefix '^', or prefix '!' for the new
syntax, or did he use something else?"

It would have been very nice if you chose an invalid ref character
as the negative prefix, and unfortunately '!', which would also have
been my first choice for this prefix, is not an invalid character,
which is a bit sad.

Both patches make sense.  Will queue.

Thanks.

  reply	other threads:[~2015-07-28 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 19:57 [PATCH 0/2] negative hideRefs for overriding Jeff King
2015-07-28 19:59 ` [PATCH 1/2] docs/config.txt: reorder hideRefs config Jeff King
2015-07-28 19:59 ` [PATCH 2/2] refs: support negative transfer.hideRefs Jeff King
2015-07-28 20:14   ` Junio C Hamano [this message]
2015-07-28 20:23     ` Jeff King
2015-07-30 20:17   ` Eric Sunshine
2015-07-30 23:28     ` Jeff King

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

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

  git send-email \
    --in-reply-to=xmqqwpxkca4o.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.