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

Support for config wildcards

From
Bill Lear <rael@zopyra.com>
Date
Mar 13, 2007, 16:47 UTC
Message-ID
<17910.54683.651029.884390@lisa.zopyra.com>

I would like to use our update hook to send email to recipients based on a branch name pattern. For example, the "abc" team would get email for all updates to branches that start with the word "abc".

I would like to write something like this in the config file:
[hooks.mail.recipients]
        xyz.pickle = me, you, betty-sue
        xyz* = joe, jaya, julie
        abc* = mark, nancy, svetlana
        taug* = sridhar, pete, joe
        * = me, you, big-boss

Then, in the update hook, do something like this (very pseudo-code-ish):

    for key, value in $(git config --get-regexp hooks.mail.recipients*); do
        key=${key#hooks.mail.recipients}
        if $(matches $key $branch); then
            recipients=$value
            break
        fi
    done

Which would allow me to change the mailing list recipients based on the branch without having to update the update hook each time.

But, apparently at least the '*' and '.' characters are not allowed as keys, and I can't seem to escape them.

Is there a way to do this sort of thing that I am missing?
Bill
Next: Junio C Hamano
Message 1 of 4 in “Support for config wildcards”
  1. Bill LearMar 13, 2007
  2. Junio C HamanoMar 13, 2007
  3. Bill LearMar 13, 2007
  4. Junio C HamanoMar 13, 2007

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.