git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: demerphq <demerphq@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ævar Arnfjörð" <avarab@gmail.com>, "Jeff King" <peff@peff.net>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: General support for ! in git-config values
Date: Thu, 2 Feb 2012 01:16:38 +0100	[thread overview]
Message-ID: <CANgJU+X+UZmycwE6xkJ-zHfT7ai6nV9zbeR4WYnAXczL5JtqjA@mail.gmail.com> (raw)
In-Reply-To: <7v62fq2o03.fsf@alter.siamese.dyndns.org>

On 1 February 2012 23:21, Junio C Hamano <gitster@pobox.com> wrote:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>>> I.e., everything pertaining to "!" happens after we get the config
>>> string. So what is it that you want "git config --with-exec" to do?
>>
>> I agree that that's how it should work, I just suggested --with-exec
>> in case anyone complained about the backwards compatibility issue of
>> changing the meaning of "!" for existing configs.
>
> Now you made me utterly confused.
>
> What "backwards compatibility" issue do you have in mind?  If I name
> myself '!me' with "user.name = !me", do I suddenly break backwards
> compatibility of Git with previous versions somehow? If so how?

(I am piping up because Ævar and I discussed this idea earlier today
while we discussed git-deploy)

If Ævar's proposal was implemented without a --with-exec switch then

user.name = !me

would set your name to the result of executing the "me" command, which
likely would have the same result as not having set your name at all,
but presumably with a warning about a bad command.

> The --with-exec option you talk about seems to me the option about the
> backward compatibility of the _calling script_ of "git config".

By backward compatibility he meant that anything not providing the
--with-exec option to git-config would continue to behave as before,
and anything that did would get the new more powerful behavior, where
! at the front of a value signified that it meant a command to be
executed whose output would be used as the value.

I think it would be convenient to be able to enable this in the config
file itself. Consider a bunch of devs share a box. Their full name and
email address can be located via a LDAP lookup. So if we could enable
Ævar's proposal in the config then we can automagically have their
commits have the correct username and email if we were to put in the
/etc/gitconfig something like this:

config.enable_executable_options=true
user.name=!ldap_full_name
user.email=!ldap_email

So now, user.name and user.email don't have to be configured by the
users. They just get an account on the box and all their commits have
the right details, no fuss.

I am aware that there are other ways of solving /this/ particular
problem, so it specifically is not a big deal, but still I think the
idea makes a lot of sense, I can imagine it being used in a lot of
interesting ways that are not obvious right away.

cheers,
Yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

  reply	other threads:[~2012-02-02  0:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 17:33 General support for ! in git-config values Ævar Arnfjörð Bjarmason
2012-02-01 18:40 ` Jeff King
2012-02-01 21:25   ` Ævar Arnfjörð Bjarmason
2012-02-01 22:21     ` Junio C Hamano
2012-02-02  0:16       ` demerphq [this message]
2012-02-02  0:27         ` Junio C Hamano
2012-02-02  1:14           ` demerphq
2012-02-02  1:39             ` Junio C Hamano
2012-02-02  1:57               ` demerphq
2012-02-02  2:38                 ` Jeff King
2012-02-02  9:44                   ` demerphq
2012-02-02  9:54                     ` Jeff King
2012-02-02 10:21                       ` demerphq
2012-02-03  5:08                         ` Kyle Moffett
2012-02-03  6:11                           ` Junio C Hamano
2012-02-03  7:35                             ` Kyle Moffett
2012-02-03 12:13                             ` Jeff King
2012-02-03 12:09                           ` Jeff King
2012-02-02  1:41             ` Junio C Hamano
2012-02-02  2:06               ` demerphq

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=CANgJU+X+UZmycwE6xkJ-zHfT7ai6nV9zbeR4WYnAXczL5JtqjA@mail.gmail.com \
    --to=demerphq@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).