Hi Guido, Am Mittwoch, den 20.02.2008, 09:55 +0100 schrieb Guido Günther: > Does it allow to set multiple > filters in the config file though? What happens if people have filters > like > filter="CVS" > in their gbp.conf already? It would also nice to have the manpages > updated. Could you see into this? The manpages have been updated in attached patch 0003, though I don't know if the explanation is sufficient.
I've had a look at the other issue and found out it's not so easy to support multiple filters in the config file. With the attached patch 0002 the values from the config file are used as base and all command line filters are added to it. This way, the users config file settings at least aren't lost. So if the config file has an entry "filter = CVS" and the user specifies "--filter=Makefile.in" in the command line, both filters are applied. However, if the user has multiple config file entries, only the last one from these files is used (exactly as it was before my patches). As I can read out of the Python documentation, (Safe)ConfigParser doesn't directly support lists as values. One possible solution would be to change the format of the "filter" value in the config files to a comma-separated list like: filter = file,other_file,",name_starting_with_comma" and to keep the behaviour that one config file can overwrite the filters of another one. That's probably the easiest approach, but a better one, I think, would be to allow two different config options: A "filters" option, which overwrites the complete list of filters and a "filter" option which appends to the current list of filters. Maybe like the following: global config file: filters = CVS,.svn # filters are now: ['CVS','.svn'] local config file A: filter = "config.{sub,guess}" # filters for site A are: ['CVS','.svn','config.{sub,guess}'] local config file B: filters = .* # filters for site B are: ['.*'] However, this version would be a bit harder to implement, as it requires a different config file parser (maybe this could be merged with #445344: use .git/config instead of .git/gbp.conf?). Do you favour one of these versions? If you know in which way filters should be handled in config files, I'll try to implement it, if you want. Regards, Johann Rudloff
0002-Use-filters-specified-in-config-files.patch
Description: application/mbox
0003-Describe-filter-option-in-manpages.patch
Description: application/mbox