Re: Feature Request: Support logic or shell execution to control values in .gitconfig

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

 



Morgan McClure <mcclure.morgan@xxxxxxxxx> writes:

> I propose using something reminiscent of bash syntax, either:
> value = $(SOMETEXTTOEXECUTE)
>
> or
>
> value = `SOMETEXTTOEXECUTE`

That would mean executing SOMETEXTTOEXECUTE each time the config file is
read. This raises two issues:

* A security issue, as SOMETEXTTOEXECUTE could also be something
  dangerous. It would not be much worse than the current situation (if
  your config file is not trusted, then an attacker could put malicious
  code in core.editor for example), but still increase the security
  risk (as any command reading the config may trigger execution).

* A performance issue with the current git implementation, as the config
  file may be read many time for a single git execution.

> Is this a feature others could get behind?

I think it's unlikely that this ever be implemented. What I suggest
instead is to edit/track/share template configuration files like

~/.gitconfig.in
email = me@HOSTNAME@

and then script something like sed -e "s/@HOSTNAME@/$(hostname)/" <
~/.gitconfig.in > ~/.gitconfig.

You may also use the include.path functionality to share most of your
configuration, and include a small file which is different on each host.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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]