On Sat, Dec 19, 2020 at 07:39:52PM +0100, Guilhem Moulin wrote: > I use git-config(1)'s ‘include.path’ and ‘includeIf.*.path’ settings to > set user.email to my @debian.org email address gobally for all my Debian > repositories while keeping my private email address as general default: > > $XDG_CONFIG_HOME/git/config: > [user] > email = guil...@example.net > [includeIf "gitdir:/path/to/debian/**/.git"] > path = debian.config > > $XDG_CONFIG_HOME/git/debian.config: > [user] > email = guil...@debian.org > [merge "dpkg-mergechangelogs"] > name = debian/changelog merge driver > driver = dpkg-mergechangelogs -m %O %A %B %A > > This works just fine as far as the git binary is concerned: `git config > user.email` returns ‘guil...@debian.org’ in repositories under > ‘/path/to/debian’, and ‘guil...@example.net’ everywhere else. (Unless > overwritten in the repo config, of course.) > > However lintian-brush doesn't seem to understand includeIf.*.path (nor > include.path): > > /path/to/debian/pkg $ lintian-brush --identity > Committer identity: Guilhem Moulin <guil...@example.net> > Changelog identity: Guilhem Moulin <guil...@debian.org> > > If I understand the source correctly, this is because the gitconfig > library it's using doesn't understand these settings. It might be a > wishlist bug for the library, however lintian-brush could maybe call > `git config user.email` instead and let the git binary take care of the > parsing and fallback logic?
Yep, that's correct. Right there is no dependency on C Git, so I'd prefer to fix this in Dulwich (the library being used to read ~/.gitconfig). That way, it also fixes this issue for other Git users. > Alternatively, I see it honors the GIT_COMMITTER_EMAIL environment > variable. I don't want to set this variable globally though; devscripts > use DEBEMAIL and I have DEBEMAIL=guil...@debian.org. Since > lintian-brush is Debian-specific, wouldn't it make sense to honor > DEBEMAIL resp. DEBFULLNAME before GIT_COMMITTER_EMAIL resp. > GIT_COMMITTER_NAME? As you mention, the current behaviour is suboptimal because there are two identities involved. The reason for the current implementation is to be consistent with the the way that dch (using DEBEMAIL) and debcommit (using GIT_COMMITTER_EMAIL/GIT_COMMITER_NAME) work, so it's least controversial. Would it make sense for e.g. debcommit to set GIT_COMMITTER_EMAIL to DEBEMAIL? Are there reasons why DEBEMAIL and GIT_COMMITTER_EMAIL should ever be different? I'm open to other solutions, if people have preferences. > If you don't like the above, how about new options username/email in > lintian-brush.conf? :-) That would certainly be an option, though if at all possible I'd like to avoid extra configuration. Jelmer