Re: General support for ! in git-config values

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

 



On Wed, Feb 01, 2012 at 06:33:47PM +0100, Ævar Arnfjörð Bjarmason wrote:

> For a program I'm working on (git-deploy) I'd like to have this as a
> general facility, i.e. users can specify either:
> 
>     foo.bar = value
> 
> Or:
> 
>     foo.bar = !cat /some/path
> 
> I'm wondering why git-config doesn't do this already, if there's no
> reason in particular I can just patch it in, either as a new option:
> 
>     git config --with-exec --get foo.bar

I'm not clear on what you want --with-exec to do. By default, config
values are strings. I would expect the "!" to be a special marker that
the caller would recognize in the string, and then act appropriately.

So if I were implementing git aliases in the shell, the code would look
like:

  v=$(git config alias.$alias)
  case "$v" in
  "")
          die "no such alias: $alias" ;;
  "!*)
          cmd="${v#!}" ;;
  *)
          cmd="git $v" ;;
  esac
  eval "$cmd"

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?

-Peff
--
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]