Re: Support for config wildcards

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Support for config wildcards

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:59

Bill Lear [off-list ref] writes:
Is there a way to do this sort of thing that I am missing?
I think the way the config is designed is to place arbitrary
values as values not variable names.

Perhaps...

	[mymailhook "everything"]
        	recipients = me
                branch = "*"

	[mymailhook "all but xyz"]
        	recipients = alice bob charlie
                branch = "*"
                branch = "!xyz"

Re: Support for config wildcards

From: Bill Lear <hidden>
Date: 2016-06-15 22:42:59

On Tuesday, March 13, 2007 at 10:03:18 (-0700) Junio C Hamano writes:
Bill Lear [off-list ref] writes:
quoted
Is there a way to do this sort of thing that I am missing?
I think the way the config is designed is to place arbitrary
values as values not variable names.

Perhaps...

[mymailhook "everything"]
       	recipients = me
              branch = "*"

[mymailhook "all but xyz"]
       	recipients = alice bob charlie
              branch = "*"
              branch = "!xyz"
Hmm, so in my example, if I had "abc" and "xyz"-specific lists:

	[mymailhook "abc"]
        	recipients = jim bob janet
                branch = "abc*"

	[mymailhook "xyz"]
        	recipients = alice bob charlie
                branch = "xyz*"

	[mymailhook "everything"]
               recipients = me
               branch = "*"

Then, I might, in the update hook, do this, given a branch for which
to find the recipients ("to", below):

for key, pattern in $(git-config --get-regexp 'mymailhook.*.branch'); do
    label=${key#mailhook.}
    label=${label%.branch}
    if $(matches $pattern $branch); then
       to += $(git-config --get-regexp "mymailhook.${label}.recipients")
    fi
done

But that doesn't work for your example "all but xyz".  I guess in that
case, I would need to check both branch patterns and if one did not
match, then I would reject it and not add to the recipient list.

Was that basically what you had in mind?


Bill
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help