git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Lukas Fleischer <lfleischer@lfos.de>, git@vger.kernel.org
Subject: Re: [PATCH/RFC] receive-pack: allow for hiding refs outside the namespace
Date: Fri, 30 Oct 2015 17:46:19 -0400	[thread overview]
Message-ID: <20151030214618.GA11426@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqmvv0jb67.fsf@gitster.mtv.corp.google.com>

On Fri, Oct 30, 2015 at 02:31:28PM -0700, Junio C Hamano wrote:

> Lukas Fleischer <lfleischer@lfos.de> writes:
> 
> > 1. There does not seem to be a way to pass configuration parameters to
> >    git-shell commands. Right now, the only way to work around this seems
> >    to write a wrapper script around git-shell that catches
> >    git-receive-pack commands and executes something like
> >    
> >        git -c receive.hideRefs=[...] receive-pack [...]
> >    
> >    instead of forwarding those commands to git-shell.
> 
> This part we have never discussed in the thread, I think.  Why do
> you need to override, instead of having these in the repository's
> config files?
> 
> Is it because a repository may host multiple pseudo repositories in
> the form of "namespaces" but they must share the same config file,
> and you would want to customize per "namespace"?
> 
> For that we may want to enhance the [include] mechanism.  Something
> like
> 
> 	[include "namespace=foo"]
>         	path = /path/to/foo/specific/config.txt
> 
> 	[include "namespace=bar"]
>         	path = /path/to/bar/specific/config.txt
> 
> Cc'ing Peff as we have discussed this kind of conditional inclusion
> in the past...

Yeah, that sort of conditional matching is exactly what I had intended
for the "subsection" of include to be. We just haven't come up with a
good condition to act as our first use case. :)

I am happy with any syntax that does not paint us into a corner (and
your example above looks fine, assuming we could later add other keys on
the left-hand of the "=").

I am slightly confused, though, where the namespace is set in such a
git-shell example. I have no really used ref namespaces myself, but my
understanding is that they have to come from the environment. You can
similarly set config through the environment. I don't think we've ever
publicized that, but it is how "git -c" works. E.g.:

  $ git -c alias.foo='!env' -c another.option=true foo | grep GIT_
  GIT_CONFIG_PARAMETERS='alias.foo='\!'env' 'another.option=true'

I think it is very particular that you single-quote each item, though:

  $ GIT_CONFIG_PARAMETERS=foo.bar=true git config foo.bar
  error: bogus format in GIT_CONFIG_PARAMETERS
  fatal: unable to parse command-line config

  $ GIT_CONFIG_PARAMETERS="'foo.bar=true'" git config foo.bar
  true

So we may want to make it a little more friendly before truly
recommending it as an interface, but I don't think there is any
conceptual problem with doing so.

-Peff

  reply	other threads:[~2015-10-30 21:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26  8:09 [PATCH/RFC] receive-pack: allow for hiding refs outside the namespace Lukas Fleischer
2015-10-26 19:58 ` Junio C Hamano
     [not found]   ` <20151027053916.3030.8259@typhoon.lan>
     [not found]     ` <20151027055911.4877.94179@typhoon.lan>
2015-10-27 14:32       ` Lukas Fleischer
2015-10-27 18:18         ` Junio C Hamano
2015-10-28  7:00           ` Lukas Fleischer
2015-10-28 13:42             ` Jeff King
2015-10-28 15:48             ` Junio C Hamano
2015-10-30 21:31         ` Junio C Hamano
2015-10-30 21:46           ` Jeff King [this message]
2015-10-31  9:03             ` Lukas Fleischer
2015-10-28 15:42 ` [PATCH] Allow hideRefs to match " Lukas Fleischer
2015-10-28 16:21   ` Junio C Hamano
2015-10-31  8:49     ` Lukas Fleischer
2015-10-31 17:31       ` Junio C Hamano
2015-10-31 23:40         ` Lukas Fleischer
2015-11-01 11:27           ` Lukas Fleischer
2015-11-01 18:18             ` Junio C Hamano

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=20151030214618.GA11426@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lfleischer@lfos.de \
    /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 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 NNTP newsgroup(s).