git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: General support for ! in git-config values

From
Ddemerphq <demerphq@gmail.com>
Date
Feb 2, 2012, 10:21 UTC
Message-ID
<CANgJU+XoZd6x6jdSHszigZaPgi+6H3Nbf4OG7p0y1_=7m+qntA@mail.gmail.com>
In-Reply-To
<20120202095432.GA19356@sigill.intra.peff.net>
On 2 February 2012 10:54, Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> On Thu, Feb 02, 2012 at 10:44:05AM +0100, demerphq wrote:
>
>> The general design of git seems to me to be based around providing
>> building blocks that people can use to build new and interesting tools
>> on top of, and so it seems counter to that philosophy to reject an
>> feature based on speculative security issues that really can't be
>> decided in advance but must instead be decided on a case by case
>> basis.
>
> I can't speak for Junio, but I am certainly not rejecting it. Only
> saying that it needs to be thought through, and the utility weighed
> against the costs.

Of course. I totally understand. I have written mails saying stuff like this myself. :-)

> So far I haven't seen an actual patch to comment on
> (or even a proposed syntax beyond starting a string with "!", which I
> think is a non-starter due to conflicting with existing uses),
I understand. I think we will probably use backtick quoting in git-deploy. So
deploy.prefix=`cat /etc/SERVER_ROLE`

will execute cat /etc/SERVER_ROLE and use the results as the value of the config option.

> nor have
> I seen a concrete use case (you mentioned pulling the name/email from
> ldap, but you also mentioned that there are lots of other ways of
> solving that particular problem, so it's not especially compelling).

One place that it would be useful for us in git-deploy would be to detect the tag prefix for the rollout we are doing. Every staging server already has a file that contains this value. We would like to make it easy for people to configure the tool to either use the value provided, or to use something like `cat /etc/SERVER_ROLE` instead. Anyway, from that POV I could totally understand "so do that in git-deploy". Since the tool is written in perl we have to wrap git-config anyway, so it easy to add a special case for ourselves.

But I still think the general idea is pretty useful, the ldap example is IMO a cleaner solution than the alternatives, and a variant that I think is much harder to do currently come to mind right away: setting the user.email automatically depending on where in your tree a git repo was located, so that when I work on repo underneath /CPAN/ it uses my CPAN address, and when I work in my /work/ tree it uses my $work address, etc, without me having to configure it repo by repo. (This has bitten more than once in the past)

> I'd be happy to hear a more concrete proposal.

I will be mostly afk the next week so I will leave that to Avar if he wants to pursue it.

cheers, Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
Previous: Jeff KingNext: Kyle Moffett
Message 13 of 20 in “General support for ! in git-config values”
  1. Ævar Arnfjörð BjarmasonFeb 1, 2012
  2. Jeff KingFeb 1, 2012
  3. Ævar Arnfjörð BjarmasonFeb 1, 2012
  4. Junio C HamanoFeb 1, 2012
  5. demerphqFeb 2, 2012
  6. Junio C HamanoFeb 2, 2012
  7. demerphqFeb 2, 2012
  8. Junio C HamanoFeb 2, 2012
  9. demerphqFeb 2, 2012
  10. Jeff KingFeb 2, 2012
  11. demerphqFeb 2, 2012
  12. Jeff KingFeb 2, 2012
  13. demerphqFeb 2, 2012
  14. Kyle MoffettFeb 3, 2012
  15. Junio C HamanoFeb 3, 2012
  16. Kyle MoffettFeb 3, 2012
  17. Jeff KingFeb 3, 2012
  18. Jeff KingFeb 3, 2012
  19. Junio C HamanoFeb 2, 2012
  20. demerphqFeb 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.