Re: General support for ! in git-config values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2 February 2012 01:27, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> demerphq <demerphq@xxxxxxxxx> writes:
>
>> 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.
>>
>> user.name=!ldap_full_name
>> user.email=!ldap_email
>
> I didn't get the impression that that was what he was proposing, but
> regardless of who's suggesting it, the above does not make any sense,
> from the syntax point of view.

Does that mean that from a utility point of view it does?

As for the suggestion and who is making it, this came up because Ævar
and I were discussing git-deploy and a scenario much like I described,
where we use tags to mark out rollouts and we have multiple users
using a common staging server and git repo to do the rollouts from, we
want the tags to have proper details, so we have to go through some
hoops to ensure that users have properly configured things before the
do their first rollout. Since Ævar was aware of the "!" notation for
aliases and thought it made some kind of sense to reuse the syntax
elsewhere he decided to see what people thought. I was not aware of
the notation until he pointed it out. I don't use git-alias.

> When you say "alias.co = !git checkout --foo-bar", you are not saying
> "instead of usual aliases like 'alias.co = checkout' that defines what
> string replaces the 'co' alias, please run !whatever command, capture
> its output, and that is the _value_ of alias.co variable, i.e. the command
> line that is going to be run".

I think I see your point. Using the same "!" notation for "execute
this command and exit" and "execute this command and use its result as
the config value" might be confusing.

Do you have a suggestion for a better syntax? Backtick quoting perhaps?

cheers,
yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]