threads / patch / 9523

patchRe: [PATCH] [1/2many] - FInd the maintainer(s) for a patch - scripts/get_maintainer.pl

Subject: Re: [PATCH] [1/2many] - FInd the maintainer(s) for a patch - scripts/get_maintainer.pl

## tl;dr

38 messages between Aug 14, 2007 and Aug 18, 2007. Diffs are folded; open one to read it.

replies: 37people: 12as markdown or json

Joe Perches· Aug 14, 2007, 17:00 UTC · lore
On Tue, 2007-08-14 at 17:53 +0200, Rene Herman wrote:
Show 7 quoted lines
> It isn't about MODULE_FOO() tags, it is about tagging /source/ files 
> to help with putting CCs on patch submissals.
> If we want to link source file foo.c and the 
> MAINTAINERS information, we have 3 options:
> 1. MAINTAINERS --> foo.c
> 2. foo.c --> MAINTAINERS
> 3. foo.c <--> some 3rd file <--> MAINTAINERS
I added git@vger.kernel.org and Junio Hamano

Another possibility is improving git to allow some sort of "declaration of interest" in bits of projects.

That would allow options like:
o  git-format-patch to include CCs
o  git-commit and git-branch to notify or
     take some other action
etc...
It's generic, applies to multiple projects, etc.

I don't care which mechanism is used, I just want to be able to CC appropriate people and lists on changes to their areas of interest without wasting time searching all over the place per file changed.

The LK MAINTAINERS file is weakly specified, but I'm not a git-geek, nor do I want to be one, so MAINTAINERS was the file I could easiest change with minimal impact to LK sources.

The get_maintainer script is trivial, I'm not wedded to it at all.

Rene Herman· Aug 14, 2007, 18:03 UTC · re: Joe Perches · lore
On 08/14/2007 07:00 PM, Joe Perches wrote:
> On Tue, 2007-08-14 at 17:53 +0200, Rene Herman wrote:
Show 9 quoted lines
>> It isn't about MODULE_FOO() tags, it is about tagging /source/ files 
>> to help with putting CCs on patch submissals.
>> If we want to link source file foo.c and the 
>> MAINTAINERS information, we have 3 options:
>> 1. MAINTAINERS --> foo.c
>> 2. foo.c --> MAINTAINERS
>> 3. foo.c <--> some 3rd file <--> MAINTAINERS
> 
> I added git@vger.kernel.org and Junio Hamano

Well, yes, I agree -- going through GIT seems to be the only really workable solution.

That is, instead of (case 2, you snipped it) having a backlink to the MAINTAINERS file in a header inside the source GIT would maintain this backlink -- and at that point, you can basically forego the MAINTAINERS file completely other than as something GIT can generate and just regard all of it meta-information (you may want to generate MAINTAINERS for releases but making GIT the source is the idea).

"git info --maintainer drivers/ide/ide-cd.c" or some such would say "Alan Cox <alan@...>".

There are more possibilities for this kind of meta information. git info --author, git info --license, git info --whatever. Given that it's intended for developers, needing GIT should not get in the way but there's always the generated MAINTAINERS file in releases as well.

It would ofcourse automatically stay up to date through deleting and moving of files. You'd probably want to devise a way to enable a submitter to also automatically provide meta-information upon addition of files. This can be done in the same way as a "Signed-off-by". Just tags in a submit email.

This should probably turn out to be the way things work yes. The paths in the MAINTAINERS file grow stale, source headers might also and sticking headers on every source file isn't nice anyway -- it's meta-information and the SCM can maintain it.

Rene.
Joe Perches· Aug 14, 2007, 18:28 UTC · re: Rene Herman · lore
On Tue, 2007-08-14 at 20:03 +0200, Rene Herman wrote:
> "git info --maintainer drivers/ide/ide-cd.c" or some such would say "Alan 
> Cox <alan@...>".
Perhaps maintainer(s), approver(s), listener(s)?

I think something like this should be a git-goal. What do the git-wranglers think?

Until a time in the future when a system like that exists, I suggest keeping MAINTAINERS up-to-date with

F:	pattern
It'll be useful as git-set-maintainer seeds at least.
> sticking  headers on every source file isn't nice anyway --
> it's meta-information and the SCM can maintain it.
It's like looking at $CVS$ keywords.  Unsightly.
cheers,  Joe
Rene Herman· Aug 14, 2007, 18:33 UTC · re: Joe Perches · lore
On 08/14/2007 08:28 PM, Joe Perches wrote:
Show 8 quoted lines
> On Tue, 2007-08-14 at 20:03 +0200, Rene Herman wrote:
>> "git info --maintainer drivers/ide/ide-cd.c" or some such would say "Alan 
>> Cox <alan@...>".
> 
> Perhaps maintainer(s), approver(s), listener(s)?
> 
> I think something like this should be a git-goal.
> What do the git-wranglers think?
I agree. If this thing has source management, let's use it.
Show 6 quoted lines
> Until a time in the future when a system like that exists,
> I suggest keeping MAINTAINERS up-to-date with
> 
> F:	pattern
> 
> It'll be useful as git-set-maintainer seeds at least.

Yes. Seeing as how it's already been useful in updating the information it would be a shame to throw what you already did away. Don't underestimate how fast git-wranglers can implement stuff if they agree though... :-)

>> sticking  headers on every source file isn't nice anyway --
>> it's meta-information and the SCM can maintain it.
> 
> It's like looking at $CVS$ keywords.  Unsightly.
Again agree.
Rene.
Linus Torvalds· Aug 14, 2007, 18:40 UTC · re: Joe Perches · lore
On Tue, 14 Aug 2007, Joe Perches wrote:
Show 8 quoted lines
> On Tue, 2007-08-14 at 20:03 +0200, Rene Herman wrote:
> > "git info --maintainer drivers/ide/ide-cd.c" or some such would say "Alan 
> > Cox <alan@...>".
> 
> Perhaps maintainer(s), approver(s), listener(s)?
> 
> I think something like this should be a git-goal.
> What do the git-wranglers think?
The thing is, if you have git, you can basically already do this.
Do a script like this:
	#!/bin/sh
	git log --since=6.months.ago -- "$@" |
		grep -i '^    [-a-z]*by:.*@' |
		sort | uniq -c |
		sort -r -n | head

and it gives you a rather good picture of who is involved with a particular subdirectory or file.

A much *better* picture than some manually maintained thing, in fact, because it tells you who really does the work, and which way patches go...

(Maybe you want to add a
	grep -v '\(Linus Torvalds\)\|\(Andrew Morton\)'

to avoid seeing the normal chain too much, but hey, we probably want to know too. Anyway - the script can certainly be tweaked, the point is really just that the git tree _already_ contains the relevant information).

		Linus
Joe Perches· Aug 14, 2007, 18:54 UTC · re: Linus Torvalds · lore
On Tue, 2007-08-14 at 11:40 -0700, Linus Torvalds wrote:
> Anyway - the script can certainly be tweaked, the point is 
> really just that the git tree _already_ contains the relevant 
> information).

I believe it's not specific enough. Things like email lists would never show up.

Al Viro· Aug 14, 2007, 19:33 UTC · re: Linus Torvalds · lore
On Tue, Aug 14, 2007 at 11:40:09AM -0700, Linus Torvalds wrote:
Show 11 quoted lines
> A much *better* picture than some manually maintained thing, in fact, 
> because it tells you who really does the work, and which way patches go...
> 
> (Maybe you want to add a
> 
> 	grep -v '\(Linus Torvalds\)\|\(Andrew Morton\)'
> 
> to avoid seeing the normal chain too much, but hey, we probably want to 
> know too. Anyway - the script can certainly be tweaked, the point is 
> really just that the git tree _already_ contains the relevant 
> information).

FWIW, I suspect that we are looking at that from the wrong POV. If that's about "who ought to be Cc'd on the issues dealing with <list of pathnames>", why does it have to be tied to "who is maintainer for <pathname>"?

I'm not suggesting something like fs.ext2@kernel.org with something like majordomo allowing to add yourself to those, but something less extreme in that direction might be worth thinking about... Hell, even simple $ finger fs/minix/dir.c@cc.kernel.org with majordomo-like interface for adding yourself to such lists might solve most of those problems...

Joe Perches· Aug 14, 2007, 19:57 UTC · re: Al Viro · lore
On Tue, 2007-08-14 at 20:33 +0100, Al Viro wrote:
> FWIW, I suspect that we are looking at that from the wrong POV.  If
> that's about "who ought to be Cc'd on the issues dealing with <list
> of pathnames>", why does it have to be tied to "who is maintainer for
> <pathname>"?

Right, it doesn't have to. I think a notification list would be just fine.

Show 7 quoted lines
> I'm not suggesting something like fs.ext2@kernel.org with something
> like majordomo allowing to add yourself to those, but something less
> extreme in that direction might be worth thinking about...
> Hell, even simple
> $ finger fs/minix/dir.c@cc.kernel.org
> with majordomo-like interface for adding yourself to such lists
> might solve most of those problems...
Might solve all of my wants for this problem.
cheers, Joe
Rene Herman· Aug 15, 2007, 01:19 UTC · re: Al Viro · lore
On 08/14/2007 09:33 PM, Al Viro wrote:
Show 12 quoted lines
> FWIW, I suspect that we are looking at that from the wrong POV.  If
> that's about "who ought to be Cc'd on the issues dealing with <list
> of pathnames>", why does it have to be tied to "who is maintainer for
> <pathname>"?
> 
> I'm not suggesting something like fs.ext2@kernel.org with something
> like majordomo allowing to add yourself to those, but something less
> extreme in that direction might be worth thinking about...  Hell,
> even simple
> $ finger fs/minix/dir.c@cc.kernel.org
> with majordomo-like interface for adding yourself to such lists
> might solve most of those problems...

It mostly is just about that it seems. However, this would not also allow the other information currently in the MAINTAINERS file to be queried in similar ways.

Git could grow a generic file meta data implementation through the use of tags, sort of like tags on multimedia files although while with multimedia files the tags are in fact stored as a file header, here you'd keep them just in git. Any project using git would be free to define its own set of info tags and you'd supply them to git simply as a list of

<tag>=<value>
pairs:

$ git info --add drivers/ide/ide-cd.c <<EOF CC="Alan Cox <alan@lxorguk.ukuu.org.uk>", linux-ide@vger.kernel.org EOF

Or as a more expansive example, with the tags set on a directory (and the output shown this time):

$ git info drivers/infiniband/ CC="Roland Dreier <rolandd@cisco.com>" CC="Sean Hefty <mshefty@ichips.intel.com>" CC="Hal Rosenstock <halr@voltaire.com>" CC=openib-general@openib.org W=http://www.openib.org/ T=git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git

$ git info --type="W" drivers/infiniband/ http://www.openib.org/

The project can link the actual tags such as CC, W and T to --options for the "info" command in the git configuration file for the tree (and/or just define a few upfront I guess) making it look nicer:

$ git info --cc drivers/infiniband/ "Roland Dreier <rolandd@cisco.com>" "Sean Hefty <mshefty@ichips.intel.com>" "Hal Rosenstock <halr@voltaire.com>" openib-general@openib.org

$ git info --website drivers/infiniband/ http://www.openib.org/

$ git info --tree drivers/infiniband/ git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git

Extra: when you have such an implementation, you can use it for other 
purposes as well such as the summary Documentation/ files want for the 
00-INDEX files:

$ git info --summary Documentation/BUG-HUNTING brute force method of doing binary search of patches to find bug.

And importantly -- when queuried for a file that itself doesn't have the requested info tag:

$ git info --cc drivers/infiniband/core/addr.c

git looks for the tag on the drivers/infiniband/core/ directory next, and then on drivers/infiniband/, where it finds it. linux-kernel@vger.kernel.org would be the final fallback, being set on the project root.

I'd really like something like this. As long as projects are both free to use and not use them and free to define their own set of tags I believe this would work very nicely.

Once you have these tags, you can basically use them for anything.
Rene.
Satyam Sharma· Aug 15, 2007, 13:33 UTC · re: Rene Herman · lore
Hi Rene,
On Wed, 15 Aug 2007, Rene Herman wrote:
Show 26 quoted lines
> It mostly is just about that it seems. However, this would not also allow the
> other information currently in the MAINTAINERS file to be queried in similar
> ways.
> 
> Git could grow a generic file meta data implementation through the use of
> tags, sort of like tags on multimedia files although while with multimedia
> files the tags are in fact stored as a file header, here you'd keep them just
> in git. Any project using git would be free to define its own set of info tags
> and you'd supply them to git simply as a list of
> 
> <tag>=<value>
> 
> pairs:
> 
> $ git info --add drivers/ide/ide-cd.c <<EOF
> CC="Alan Cox <alan@lxorguk.ukuu.org.uk>", linux-ide@vger.kernel.org
> EOF
> 
> Or as a more expansive example, with the tags set on a directory (and the
> output shown this time):
> 
> $ git info drivers/infiniband/
> CC="Roland Dreier <rolandd@cisco.com>"
> CC="Sean Hefty <mshefty@ichips.intel.com>"
> CC="Hal Rosenstock <halr@voltaire.com>"
> CC=openib-general@openib.org

Considering some people may want to differentiate between "those who want to be Cc'ed for patches on subsystem X" and "those who are maintainer(s) of subsystem X", I think another "P=" kind of tag might also be useful here.

Show 42 quoted lines
> W=http://www.openib.org/
> T=git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
> 
> $ git info --type="W" drivers/infiniband/
> http://www.openib.org/
> 
> The project can link the actual tags such as CC, W and T to --options for the
> "info" command in the git configuration file for the tree (and/or just define
> a few upfront I guess) making it look nicer:
> 
> $ git info --cc drivers/infiniband/
> "Roland Dreier <rolandd@cisco.com>"
> "Sean Hefty <mshefty@ichips.intel.com>"
> "Hal Rosenstock <halr@voltaire.com>"
> openib-general@openib.org
> 
> $ git info --website drivers/infiniband/
> http://www.openib.org/
> 
> $ git info --tree drivers/infiniband/
> git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
> 
> Extra: when you have such an implementation, you can use it for other purposes
> as well such as the summary Documentation/ files want for the 00-INDEX files:
> 
> $ git info --summary Documentation/BUG-HUNTING
> brute force method of doing binary search of patches to find bug.
> 
> And importantly -- when queuried for a file that itself doesn't have the
> requested info tag:
> 
> $ git info --cc drivers/infiniband/core/addr.c
> 
> git looks for the tag on the drivers/infiniband/core/ directory next, and then
> on drivers/infiniband/, where it finds it. linux-kernel@vger.kernel.org would
> be the final fallback, being set on the project root.
> 
> I'd really like something like this. As long as projects are both free to use
> and not use them and free to define their own set of tags I believe this would
> work very nicely.
> 
> Once you have these tags, you can basically use them for anything.
I'd really _love_ a tool that does all that what you've proposed above!

But why does it have to be "git-info" or anything in the git(7) suite for that matter? This sounds like a job for a different specialised tool, along with ".metatags" kind of files dispersed in the source tree.

Satyam
Rene Herman· Aug 15, 2007, 13:39 UTC · re: Satyam Sharma · lore
On 08/15/2007 03:33 PM, Satyam Sharma wrote:
[ git info --maintainer ]
Show 5 quoted lines
> I'd really _love_ a tool that does all that what you've proposed above!
> 
> But why does it have to be "git-info" or anything in the git(7) suite for
> that matter? This sounds like a job for a different specialised tool, 
> along with ".metatags" kind of files dispersed in the source tree.

To automatically move (and delete) the meta-data alongside the files themselves is a reason.

More generally -- shouldn't it? This is about source management (well, maybe more about project management, but...) and the source code management tool looks to be the right place for that. The different parts of git are somewhat/fairly stand-alone as is, no?

Rene.
Kyle Moffett· Aug 15, 2007, 13:52 UTC · re: Rene Herman · lore
On Aug 15, 2007, at 09:39:44, Rene Herman wrote:
Show 17 quoted lines
> On 08/15/2007 03:33 PM, Satyam Sharma wrote:
>
> [ git info --maintainer ]
>
>> I'd really _love_ a tool that does all that what you've proposed  
>> above!  But why does it have to be "git-info" or anything in the  
>> git(7) suite for that matter? This sounds like a job for a  
>> different specialised tool,  long with ".metatags" kind of files  
>> dispersed in the source tree.
>
> To automatically move (and delete) the meta-data alongside the  
> files themselves is a reason.
>
> More generally -- shouldn't it? This is about source management  
> (well, maybe more about project management, but...) and the source  
> code management tool looks to be the right place for that. The  
> different parts of git are somewhat/fairly stand-alone as is, no?

If you were going to do that I'd just suggest making git aware of the "user.*" extended attributes and having it save those into the git repo along with the permission data.

Cheers, Kyle Moffett

Rene Herman· Aug 16, 2007, 10:58 UTC · re: Kyle Moffett · lore
On 08/15/2007 03:52 PM, Kyle Moffett wrote:
Show 22 quoted lines
> On Aug 15, 2007, at 09:39:44, Rene Herman wrote:
>> On 08/15/2007 03:33 PM, Satyam Sharma wrote:
>>
>> [ git info --maintainer ]
>>
>>> I'd really _love_ a tool that does all that what you've proposed 
>>> above!  But why does it have to be "git-info" or anything in the 
>>> git(7) suite for that matter? This sounds like a job for a different 
>>> specialised tool,  long with ".metatags" kind of files dispersed in 
>>> the source tree.
>>
>> To automatically move (and delete) the meta-data alongside the files 
>> themselves is a reason.
>>
>> More generally -- shouldn't it? This is about source management (well, 
>> maybe more about project management, but...) and the source code 
>> management tool looks to be the right place for that. The different 
>> parts of git are somewhat/fairly stand-alone as is, no?
> 
> If you were going to do that I'd just suggest making git aware of the 
> "user.*" extended attributes and having it save those into the git repo 
> along with the permission data.

Am looking at it but am not so sure that's a very good idea. I guess it'd be largely okay-ish to require the repo to be on a filesystem that supports EAs for this feature to work, but keeping the attributes intact over file system operations seems not all that easy (yet). Having not used EAs before I may be missing something but my version of "cp" for example (GNU coreutils 6.9) appears to not copy them. Nor do they seem to survive a trip through GNU tar 1.16.1. EAs appear to not be very useful unless every single tool supports them -- a repo should be resistant against simple operations like that.

Googling around, I see subversion already has this and calls the meta-data "properties" (svn propset/get and friends). It uses a few properties itself, such as the svn:executable property (which I saw is also the only permission bit git keeps) and svn:ignore, which serves the same role as the .gitignore files for git. Both those would fit into this scheme nicely for git as well, if git were to do something similar and reserve for example the "git.*" namespace for internal use.

Junio (and others), do you have an opinion on this? If these properties are versioned themselves such as in svn I believe it's a decidedly non-trivial addition (and I'm a complete git newbie) but to me, they look incredibly useful, both for the original "maintainers" properties (and anyone else one would want to come up with such as summary properties and author/license stuff) and even for git internal reasons such as sketched above.

The git-blame thing as sketched before by Linus would never be able to point out mailing lists, or general lists of "interested parties" for example, but these properties can do anything...

Rene.
Rene Herman· Aug 16, 2007, 11:08 UTC · re: Rene Herman · lore
On 08/16/2007 12:58 PM, Rene Herman wrote:
> On 08/15/2007 03:52 PM, Kyle Moffett wrote:
Show 33 quoted lines
>> If you were going to do that I'd just suggest making git aware of the 
>> "user.*" extended attributes and having it save those into the git 
>> repo along with the permission data.
> 
> Am looking at it but am not so sure that's a very good idea. I guess 
> it'd be largely okay-ish to require the repo to be on a filesystem that 
> supports EAs for this feature to work, but keeping the attributes intact 
> over file system operations seems not all that easy (yet). Having not 
> used EAs before I may be missing something but my version of "cp" for 
> example (GNU coreutils 6.9) appears to not copy them. Nor do they seem 
> to survive a trip through GNU tar 1.16.1. EAs appear to not be very 
> useful unless every single tool supports them -- a repo should be 
> resistant against simple operations like that.
> 
> Googling around, I see subversion already has this and calls the 
> meta-data "properties" (svn propset/get and friends). It uses a few 
> properties itself, such as the svn:executable property (which I saw is 
> also the only permission bit git keeps) and svn:ignore, which serves the 
> same role as the .gitignore files for git. Both those would fit into 
> this scheme nicely for git as well, if git were to do something similar 
> and reserve for example the "git.*" namespace for internal use.
> 
> Junio (and others), do you have an opinion on this? If these properties 
> are versioned themselves such as in svn I believe it's a decidedly 
> non-trivial addition (and I'm a complete git newbie) but to me, they 
> look incredibly useful, both for the original "maintainers" properties 
> (and anyone else one would want to come up with such as summary 
> properties and author/license stuff) and even for git internal reasons 
> such as sketched above.
> 
> The git-blame thing as sketched before by Linus would never be able to 
> point out mailing lists, or general lists of "interested parties" for 
> example, but these properties can do anything...

The svn implemention is that a single property is free-form text. As such, I guess a property would be just another file, although one that only lives in the index and is linked from the file/directory it is a property of.

Perhaps that immediately suggests an implementation to someone already familiar with git internals?

Rene.
Salikh Zakirov· Aug 16, 2007, 11:26 UTC · re: Rene Herman · lore
Rene Herman wrote:
> Perhaps that immediately suggests an implementation to someone already
> familiar with git internals?

perhaps http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html and http://www.kernel.org/pub/software/scm/git/docs/git-check-attr.html can help you?

Rene Herman· Aug 16, 2007, 11:57 UTC · re: Salikh Zakirov · lore
On 08/16/2007 01:26 PM, Salikh Zakirov wrote:
Please don't drop CCs.
Show 7 quoted lines
> Rene Herman wrote:
>> Perhaps that immediately suggests an implementation to someone already
>> familiar with git internals?
> 
> perhaps http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
> and http://www.kernel.org/pub/software/scm/git/docs/git-check-attr.html
> can help you?

No, thanks, saw them, but .gitattributes is in fact in the same category as .gitignore, which would _be_ a property.

If you do this stuff in files scattered around the tree, updating and moving stuff becomes a pain -- the tool would need to go edit files.

Rene.
Al Viro· Aug 16, 2007, 15:40 UTC · re: Rene Herman · lore
On Thu, Aug 16, 2007 at 12:58:19PM +0200, Rene Herman wrote:
 
Show 7 quoted lines
> Googling around, I see subversion already has this and calls the meta-data 
> "properties" (svn propset/get and friends). It uses a few properties 
> itself, such as the svn:executable property (which I saw is also the only 
> permission bit git keeps) and svn:ignore, which serves the same role as the 
> .gitignore files for git. Both those would fit into this scheme nicely for 
> git as well, if git were to do something similar and reserve for example 
> the "git.*" namespace for internal use.

"svn does it" is usually an indication of a bad idea, but anyway - it's fundamentally wrong in this case, simply because "$FOO is interested in $BAR" is a property of $FOO, not of $BAR.

> The git-blame thing as sketched before by Linus would never be able to 
> point out mailing lists, or general lists of "interested parties" for 
> example, but these properties can do anything...

No, they can not. "I'm interested in drivers/foo/bar.c fixes" is not an earth-shattering event and it sure as hell does not create a new revision of the tree.

Rene Herman· Aug 16, 2007, 15:53 UTC · re: Al Viro · lore
On 08/16/2007 05:40 PM, Al Viro wrote:
> On Thu, Aug 16, 2007 at 12:58:19PM +0200, Rene Herman wrote:
Show 7 quoted lines
>> The git-blame thing as sketched before by Linus would never be able to 
>> point out mailing lists, or general lists of "interested parties" for 
>> example, but these properties can do anything...
> 
> No, they can not.  "I'm interested in drivers/foo/bar.c fixes" is not
> an earth-shattering event and it sure as hell does not create a new revision
> of the tree.
That's true. Okay, it can't do those general lists of interested parties.
Rene.
Junio C Hamano· Aug 16, 2007, 19:00 UTC · re: Rene Herman · lore
Rene Herman <rene.herman@gmail.com> writes:
Show 19 quoted lines
> Am looking at it but am not so sure that's a very good idea. I guess
> it'd be largely okay-ish to require the repo to be on a filesystem
> that supports EAs for this feature to work, but keeping the attributes
> intact over file system operations seems not all that easy
> (yet). Having not used EAs before I may be missing something but my
> version of "cp" for example (GNU coreutils 6.9) appears to not copy
> them. Nor do they seem to survive a trip through GNU tar 1.16.1. EAs
> appear to not be very useful unless every single tool supports them --
> a repo should be resistant against simple operations like that.
>
> Googling around, I see subversion already has this and calls the
> meta-data "properties" (svn propset/get and friends). It uses a few
> properties itself, such as the svn:executable property (which I saw is
> also the only permission bit git keeps) and svn:ignore, which serves
> the same role as the .gitignore files for git. Both those would fit
> into this scheme nicely for git as well, if git were to do something
> similar and reserve for example the "git.*" namespace for internal use.
>
> Junio (and others), do you have an opinion on this?

Please step back a bit and imagine a world in which there was no git. IOW, you kernel folks switched to tarballs and patches 20 months ago. It is a far superiour solution compared to CVS and SVN, so it ought to work, right ;-)?

Now, would you implement the "whom would I send my patches to" with EAs?

I would hope not.

Git or no git, I think a file that can be viewed with less, edited with regular editor and processed with sed/perl/grep tools is the way to go. I do not think adding 600+ patches to the single MAINTAINERS list is workable in the longer term, as it would become the single file many subsystem people need to update and is asking for merge conflicts, but I think a file with known name (say, "CcMe.txt") sprinkled in relevant subdirectories, perhaps with the same format originally suggested for MAINTAINERS, would make a lot more sense.

That would give people who work with tarballs and patches, or a subsystem managed with something other than git (one of the most important one is quilt), the equal access to the necessary data.

Even with git, it is my understanding that kernel community works largely on patches exchanged over e-mails, between people who do use git and people who do not. You would want to have something you can easily transfer over e-mail in the patch form.

We _could_ invent a new "patches to properties" git diff output format that "git apply" can understand to propagate that information, but that approach is making it less interoperable with others, and you need to demonstrate the benefit far outweighs that. I do not see it for this particular application.

There may be places for "properties" that would be useful to git, but I do not think the "find whom to send patches to" is one of them.

Rene Herman· Aug 17, 2007, 04:24 UTC · re: Junio C Hamano · lore
On 08/16/2007 09:00 PM, Junio C Hamano wrote:
Show 13 quoted lines
> Git or no git, I think a file that can be viewed with less,
> edited with regular editor and processed with sed/perl/grep
> tools is the way to go.  I do not think adding 600+ patches to
> the single MAINTAINERS list is workable in the longer term, as
> it would become the single file many subsystem people need to
> update and is asking for merge conflicts, but I think a file
> with known name (say, "CcMe.txt") sprinkled in relevant
> subdirectories, perhaps with the same format originally
> suggested for MAINTAINERS, would make a lot more sense.
> 
> That would give people who work with tarballs and patches, or a
> subsystem managed with something other than git (one of the most
> important one is quilt), the equal access to the necessary data.

That is ofcourse an argument but I believe a bit of a non-argument at the same time in practice.

There's really not much point in pretending that non-git users are still first class citizens anyway; Linus' own suggestion of using git-blame would tie things to git as well, as do for example frequent requests to bisect a problem. I moreover feel there's absolutely nothing wrong with that, given that there's nothing wrong with git.

It's the kernel's source code management tool, is included out of the box in most distributions nowadays and is GPLd meaning that the tool (itself) won't keep anyone from exporting data from it and importing it into something else if someone cares to. Also, I never managed to stay un-annoyed at source code management tools long enough to understand why I wanted to use them but have been using git for months now so as far as I am concerned, it appears to even be a good tool.

But, well, anyways, I did look at a git repo a bit but will unfortunately not be able to follow up the proposal with actual (good) code in a sensible timeframe, let alone "quickly", which means I was hoping others would agree. I believe these properties make for an elegant setup with many possible uses including the maintainers information, but if you disagree I guess I'm going to shelve it...

Show 9 quoted lines
> Even with git, it is my understanding that kernel community
> works largely on patches exchanged over e-mails, between people
> who do use git and people who do not.  You would want to have
> something you can easily transfer over e-mail in the patch
> form.
> 
> We _could_ invent a new "patches to properties" git diff output
> format that "git apply" can understand to propagate that
> information
Yes, not unlike the current git move "meta-diffs" ...
Show 6 quoted lines
> but that approach is making it less interoperable with others, and you 
> need to demonstrate the benefit far outweighs that.  I do not see it for 
> this particular application.
> 
> There may be places for "properties" that would be useful to git, but I 
> do not think the "find whom to send patches to" is one of them.

The important reason for wiring this into git directly would be keeping the meta-data in sync with the data it refers to in an automated fashion. With manual intervention, there's much more opportunity for things to grow stale.

In practice, it may not be a huge problem. It certainly is with the current MAINTAINERS file but if one does finer-grained data around the tree, that will probably help.

It's also not a now or never thing fortunately. If git does ever grow these properties, the issue can be revisited, perhaps at that time both with the experience of what the finer-grained in-tree solution did not solve and even fewer people around that care about not making git even more of an intrinsic part of development.

Rene.
Krzysztof Halasa· Aug 15, 2007, 19:37 UTC · re: Al Viro · lore
Al Viro <viro@ftp.linux.org.uk> writes:
> I'm not suggesting something like fs.ext2@kernel.org with something
> like majordomo allowing to add yourself to those,
Why not
Show 6 quoted lines
> but something less
> extreme in that direction might be worth thinking about...  Hell,
> even simple
> $ finger fs/minix/dir.c@cc.kernel.org
> with majordomo-like interface for adding yourself to such lists
> might solve most of those problems...
I think so.

And you would be able to add yourself even if you're merely interested in something, not a maintainer.

However I think the mailing lists could do better. Duplicate suppression, among other things.

And they could eventually supersede the subsystem mailing lists we use today. Just use net@kernel.org or drivers.net@kernel.org.

-- 
Krzysztof Halasa
Al Viro· Aug 15, 2007, 23:19 UTC · re: Krzysztof Halasa · lore
On Wed, Aug 15, 2007 at 09:37:45PM +0200, Krzysztof Halasa wrote:
> > I'm not suggesting something like fs.ext2@kernel.org with something
> > like majordomo allowing to add yourself to those,
> 
> Why not

You'd need to implement serious anti-spam measures for that. Besides, cross-postings between random sets of lists would become a nightmare pretty soon.

Richard Knutsson· Aug 15, 2007, 01:35 UTC · re: Linus Torvalds · lore
Linus Torvalds wrote:
Show 22 quoted lines
> On Tue, 14 Aug 2007, Joe Perches wrote:
>
>   
>> On Tue, 2007-08-14 at 20:03 +0200, Rene Herman wrote:
>>     
>>> "git info --maintainer drivers/ide/ide-cd.c" or some such would say "Alan 
>>> Cox <alan@...>".
>>>       
>> Perhaps maintainer(s), approver(s), listener(s)?
>>
>> I think something like this should be a git-goal.
>> What do the git-wranglers think?
>>     
>
> The thing is, if you have git, you can basically already do this.
>
> Do a script like this:
>
> 	#!/bin/sh
> 	git log --since=6.months.ago -- "$@" |
> 		grep -i '^    [-a-z]*by:.*@' |
>   
sed -r "s/^.*by: \"?([^\"]+)\"?/\1/" |
Show 7 quoted lines
> 		sort | uniq -c |
> 		sort -r -n | head
>
> and it gives you a rather good picture of who is involved with a 
> particular subdirectory or file.
>
>   

Like the script! Especially since it reveled --since=6.month.ago and uniq to me. Just wondering, why order them in the acked, signed and tested? Other then removing those, the added 'sed' also fix the <name> vs "<name>"-"problem". + adding '-i' to uniq should help the result too, right?

Now a simple "diffstat -p1 -l <patch> | xargs <preferred script-name>" makes the day. Too bad, as Joe pointed out, it does not include relevant ML.

cheers Richard Knutsson

Stefan Richter· Aug 15, 2007, 09:29 UTC · re: Linus Torvalds · lore
Linus Torvalds wrote:
Show 8 quoted lines
> 	#!/bin/sh
> 	git log --since=6.months.ago -- "$@" |
> 		grep -i '^    [-a-z]*by:.*@' |
> 		sort | uniq -c |
> 		sort -r -n | head
> 
> and it gives you a rather good picture of who is involved with a 
> particular subdirectory or file.

No, it doesn't. The subscribers of <subsystem-devel@somewhere.org> are not listed in patch logs.

-- 
Stefan Richter
-=====-=-=== =--- -====
http://arcgraph.de/sr/
Ray Lee· Aug 15, 2007, 15:31 UTC · re: Stefan Richter · lore
On 8/15/07, Stefan Richter <stefanr@s5r6.in-berlin.de> wrote:
Show 12 quoted lines
> Linus Torvalds wrote:
> >       #!/bin/sh
> >       git log --since=6.months.ago -- "$@" |
> >               grep -i '^    [-a-z]*by:.*@' |
> >               sort | uniq -c |
> >               sort -r -n | head
> >
> > and it gives you a rather good picture of who is involved with a
> > particular subdirectory or file.
>
> No, it doesn't.  The subscribers of <subsystem-devel@somewhere.org> are
> not listed in patch logs.

Then maybe they should be added into the patch logs. A CC: line isn't that big of a deal, and also shows who got notified.

Joe Perches· Aug 16, 2007, 20:36 UTC · re: Linus Torvalds · lore
On Tue, 2007-08-14 at 11:40 -0700, Linus Torvalds wrote:
Show 13 quoted lines
> Do a script like this:
> 
> 	#!/bin/sh
> 	git log --since=6.months.ago -- "$@" |
> 		grep -i '^    [-a-z]*by:.*@' |
> 		sort | uniq -c |
> 		sort -r -n | head
> (Maybe you want to add a
> 	grep -v '\(Linus Torvalds\)\|\(Andrew Morton\)'
> to avoid seeing the normal chain too much, but hey, we probably want to 
> know too. Anyway - the script can certainly be tweaked, the point is 
> really just that the git tree _already_ contains the relevant 
> information).

So, here's the same get_maintainer.pl with the git addition. Seems to work well in combination with MAINTAINERS.

Show changes to scripts/get_maintainer.pl +351 −0
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
new file mode 100755
index 0000000..eb3f023
--- /dev/null
+++ b/scripts/get_maintainer.pl
@@ -0,0 +1,351 @@
+#!/usr/bin/perl -w
+# (c) 2007, Joe Perches <joe@perches.com>
+#           created from checkpatch.pl
+#
+# Print the contact information for the maintainers
+# of the files modified in a patch
+#
+# usage: perl scripts/get_maintainers.pl <patch>
+#
+# Licensed under the terms of the GNU GPL License version 2
+
+use strict;
+
+my $P = $0;
+$P =~ s@.*/@@g;
+
+my $V = '0.06';
+
+use Getopt::Long qw(:config no_auto_abbrev);
+
+my $tree = "./";
+my $email_maintainer = 1;
+my $email_usename = 1;
+my $email_list = 1;
+my $email_subscriber_list = 0;
+my $email_separator = ", ";
+my $email_git = 1;
+my $email_git_chief_penguins = 0;
+my $email_multiline = 0;
+my %saw;
+
+my $chief_penguins = "(Linus Torvalds|Andrew Morton)";
+
+GetOptions(
+	   'tree=s' => \$tree,
+	   'git!' => $email_git,
+	   'git-chief-penguins' => \$email_git_chief_penguins,
+	   'm!' => \$email_maintainer,
+	   'n!' => \$email_usename,
+	   'l!' => \$email_list,
+	   's!' => \$email_subscriber_list,
+	   'multiline!' => \$email_multiline,
+	   'separator=s' => \$email_separator,
+	   ) or exit;
+
+my $exit = 0;
+
+if ($#ARGV < 0 ||
+    ($email_maintainer == 0
+     && $email_list == 0
+     && $email_subscriber_list == 0
+     && $email_git == 0)) {
+    print "usage: $P [options] patchfile\n";
+    print "version: $V\n";
+    print "  --tree [path] => linux kernel source path\n";
+    print "  --git => include recent git \*-by: signers\n";
+    print "  --git_chief_penguins => include ${chief_penguins}\n";
+    print "  --m => include maintainer(s) if any\n";
+    print "  --n => include name 'Full Name <addr\@domain.tld>'\n";
+    print "  --l => include list(s) if any\n";
+    print "  --s => include subscriber only list(s) if any\n";
+    print "  --separator [, ] => separator for multiple addresses on 1 line\n";
+    print "  --multiline => print 1 address per line\n";
+    print "Default: [--g --m --l --separator \", \"]\n";
+    print "Be sure to select something...\n";
+    exit(1);
+}
+
+if ($tree && !top_of_kernel_tree($tree)) {
+    if (${tree} ne "") {
+	print "'${tree}' ";
+    } else {
+	print "The current directory ";
+    }
+    print "doesn't appear to be a linux kernel source tree\n";
+    exit(2);
+}
+
+## Read MAINTAINERS for type/value pairs
+
+my @typevalue = ();
+open(MAINT, "<${tree}MAINTAINERS") || die "$P: Can't open ${tree}MAINTAINERS\n";
+while (<MAINT>) {
+    if (m/^(\C):\s*(.*)/) {
+	my $type = $1;
+	my $value = $2;
+
+	##Filename pattern matching
+	if ($type eq "F" || $type eq "X") {
+	    $value =~ s@\.@\\\.@g;       ##Convert . to \.
+	    $value =~ s/\*/\.\*/g;       ##Convert * to .*
+	}
+	push(@typevalue, "$type:$value");
+    } elsif (!/^(\s)*$/) {
+	push(@typevalue, $_);
+    }
+}
+close(MAINT);
+
+## Find the patched filenames
+
+my @patchedfiles = ();
+open(PATCH, "<$ARGV[0]") or die "Can't open $ARGV[0]\n";
+while (<PATCH>) {
+    if (m/^\+\+\+\s+(\S+)/) {
+	my $file = $1;
+	$file =~ s@^[^/]*/@@;
+	$file =~ s@\n@@;
+	push(@patchedfiles, $file);
+    }
+}
+close(PATCH);
+
+# Sort and uniq patchedfiles
+
+undef %saw;
+@patchedfiles = sort @patchedfiles;
+@patchedfiles = grep(!$saw{$_}++, @patchedfiles);
+
+# Find responsible parties
+
+my @email_to = ();
+foreach (@patchedfiles) {
+    my $patchedfile = $_;
+    my $exclude = 0;
+
+#Git
+
+    recent_git_signoffs($patchedfile);
+
+#Do not match excluded file patterns
+
+    foreach (@typevalue) {
+	if (m/^(\C):(.*)/) {
+	    my $type = $1;
+	    my $value = $2;
+	    if ($type eq 'X') {
+		if (file_match_pattern($patchedfile, $value)) {
+		    $exclude = 1;
+		}
+	    }
+	}
+    }
+
+    if ($exclude == 0) {
+	my $tvi = 0;
+	foreach (@typevalue) {
+	    if (m/^(\C):(.*)/) {
+		my $type = $1;
+		my $value = $2;
+		if ($type eq 'F') {
+		    if (file_match_pattern($patchedfile, $value)) {
+			add_emails($tvi);
+		    }
+		}
+	    }
+	    $tvi++;
+	}
+    }
+}
+
+## sort and uniq email_to
+
+@email_to = sort @email_to;
+undef %saw;
+@email_to = grep(!$saw{$_}++, @email_to);
+
+## add lk if no one is interested...
+
+my $address_cnt = @email_to;
+if ($address_cnt == 0 && $email_list > 0) {
+    push(@email_to, "linux-kernel\@vger.kernel.org");
+}
+if ($email_multiline != 0) {
+    foreach (@email_to) {
+	print("$_\n");
+    }
+} else {
+    print(join($email_separator, @email_to));
+    print("\n");
+}
+
+exit($exit);
+
+sub file_match_pattern {
+    my ($file, $pattern) = @_;
+    if (substr($pattern, -1) eq "/") {
+	if ($file =~ m@^$pattern@) {
+	    return 1;
+	}
+    } else {
+	if ($file =~ m@^$pattern@) {
+	    my $s1 = ($file =~ tr@/@@);
+	    my $s2 = ($pattern =~ tr@/@@);
+	    if ($s1 == $s2) {
+		return 1;
+	    }
+	}
+    }
+    return 0;
+}
+
+sub top_of_kernel_tree {
+	my ($tree) = @_;
+
+	if ($tree ne "" && substr($tree,length($tree)-1,1) ne "/") {
+	    $tree = $tree . "/";
+	}
+	if (   (-f "${tree}COPYING")
+	    && (-f "${tree}CREDITS")
+	    && (-f "${tree}Kbuild")
+	    && (-f "${tree}MAINTAINERS")
+	    && (-f "${tree}Makefile")
+	    && (-f "${tree}README")
+	    && (-d "${tree}Documentation")
+	    && (-d "${tree}arch")
+	    && (-d "${tree}include")
+	    && (-d "${tree}drivers")
+	    && (-d "${tree}fs")
+	    && (-d "${tree}init")
+	    && (-d "${tree}ipc")
+	    && (-d "${tree}kernel")
+	    && (-d "${tree}lib")
+	    && (-d "${tree}scripts")) {
+		return 1;
+	}
+	return 0;
+}
+
+sub format_email {
+    my ($name, $email) = @_;
+    my $formatted_email = $name;
+
+    if ($name =~ /[^a-z0-9 \.\-]/i) {    ##has "must quote" chars
+	$name =~ s/(?<!\\)"/\\"/g;       ##escape quotes
+	$formatted_email = "\"${name}\"\ \<${email}\>";
+    } else {
+	$formatted_email = "${name} \<${email}\>";
+    }
+    return $formatted_email;
+}
+
+sub add_emails {
+    my ($index) = @_;
+
+    $index = $index - 1;
+    while ($index >= 0) {
+	my $tv = $typevalue[$index];
+	if ($tv =~ m/^(\C):(.*)/) {
+	    my $ptype = $1;
+	    my $pvalue = $2;
+	    if ($ptype eq "L") {
+		my $subscr = $pvalue;
+		if ($subscr =~ m/\s*\(subscribers-only\)/) {
+		    if ($email_subscriber_list > 0) {
+			$subscr =~ s/\s*\(subscribers-only\)//g;
+			push(@email_to, $subscr);
+		    }
+		} else {
+		    if ($email_list > 0) {
+			push(@email_to, $pvalue);
+		    }
+		}
+	    } elsif ($ptype eq "M") {
+		if ($email_maintainer > 0) {
+		    if ($index >= 0) {
+			my $tv = $typevalue[$index - 1];
+			if ($tv =~ m/^(\C):(.*)/) {
+			    if ($1 eq "P" && $email_usename > 0) {
+				push(@email_to, format_email($2, $pvalue));
+			    } else {
+				push(@email_to, $pvalue);
+			    }
+			}
+		    } else {
+			push(@email_to, $pvalue);
+		    }
+		}
+	    }
+	    $index--;
+	} else {
+	    $index = -1;
+	}
+    }
+}
+
+sub which {
+    my ($bin) = @_;
+
+    my $path;
+
+    foreach $path (split /:/, $ENV{PATH}) {
+	if (-e "$path/$bin") {
+	    return "$path/$bin";
+	}
+    }
+    
+    return "";
+}
+
+sub recent_git_signoffs {
+    my ($file) = @_;
+
+    my $sign_offs = "";
+    my $cmd = "";
+    my $output = "";
+
+    my @lines = ();
+
+    if (which("git") eq "") {
+	die("Git not found\n");
+    }
+
+# Search the git logs for "by:" lines per file
+# sort in reverse order by occurance
+# add at most 5
+
+    $cmd = "git log --since=6.months.ago -- ${file} ";
+    $cmd = $cmd . " | grep -i '^    [-a-z]*by:.*\\\@' ";
+    if ($email_git_chief_penguins == 0) {
+	$cmd = $cmd . " | grep -E -v '${chief_penguins}'";
+    }
+    $cmd = $cmd . " | sort | uniq -c | sort -r -n | head -n 5";
+    $cmd = $cmd . " | cut -f 2 -d ':' -s ";
+
+    $output = `${cmd}`;
+
+    $output =~ s/^\s*//gm;
+
+    @lines = split("\n", $output);
+    foreach (@lines) {
+	my $line = $_;
+	if ($line =~ m/(.*) <(.*)>/) {
+	    my $git_name = $1;
+	    my $git_addr = $2;
+	    $git_name =~ tr/^\"//;
+	    $git_name =~ tr/\"$//;
+	    if ($email_usename > 0) {
+		push(@email_to, format_email($git_name, $git_addr));
+	    } else {
+		push(@email_to, $git_addr);
+	    }
+	} elsif ($line =~ m/<(.*)>/) {
+	    my $git_addr = $1;
+	    push(@email_to, $git_addr);
+	} else {
+	    push(@email_to, $line);
+	}
+    }
+    return $output;
+}
Junio C Hamano· Aug 15, 2007, 01:31 UTC · re: Joe Perches · lore
Joe Perches <joe@perches.com> writes:
Show 22 quoted lines
> On Tue, 2007-08-14 at 17:53 +0200, Rene Herman wrote:
>> It isn't about MODULE_FOO() tags, it is about tagging /source/ files 
>> to help with putting CCs on patch submissals.
>> If we want to link source file foo.c and the 
>> MAINTAINERS information, we have 3 options:
>> 1. MAINTAINERS --> foo.c
>> 2. foo.c --> MAINTAINERS
>> 3. foo.c <--> some 3rd file <--> MAINTAINERS
>
> I added git@vger.kernel.org and Junio Hamano
>
> Another possibility is improving git to allow
> some sort of "declaration of interest" in bits
> of projects.
>
> That would allow options like:
>
> o  git-format-patch to include CCs
> o  git-commit and git-branch to notify or
>      take some other action
>
> etc...

There are things git can help, and other things git does not have any business with.

1. Finding out who the potentially interested parties are.
   Linus already gave a script to grep *-by: lines from commit
   messages.  I find this is probably be the best option, as it
   follows "yesterday's weather".  People who had dealt with the
   area are the ones who are likely to be interested.
   git records who did the work (author) and who did the
   integration to git-based patch flow (committer).  It does not
   structurally track intermediate people who touched the patch
   on e-mail, but Signed-off-by: and Acked-by: (and sometimes I
   see Cc: as well in the commit messages) are accepted social
   convention in the kernel community, and taking advantage of
   that is a good idea.
2. Making it easier to send your patches to these people.
   There are three possible places to add Signed-off-by: and
   friends in the commit messages you would mail out:
   - When you create your own commit, or commit a patch that
     came to you via e-mail.  The commit object in your tree
     will carry them --- you can send format-patch output as-is
     to Linus or Andrew and you are done.
   - When you run format-patch; your commit will not have extra
     Cc: or "interested parties" information, you will use the
     result of 1. and insert it near your own Signed-off-by: to
     the format-patch output.
   - When you send format-patch output, via git-send-email
     perhaps.
   To make the result useful for "yesterday's weather" approach,
   I think it would be the best to do the first.  After all,
   your commit may propagate via "git pull" not over e-mail, and
   no postprocessing approach would work in such a case.
   The second one is my least favorite.  format-patch output is
   designed to record author/committer (i.e. origin) and not to
   record recipient at all.  "Who's interested in this" does not
   simply belong there.
   On the other hand, git-send-email _is_ all about sending it
   out, and it needs to know who your patch should reach.  I
   think it makes sense to have one script that, given a set of
   paths that are affected, gives a list of potentially
   interested people (that is "Finding" part -- and I see there
   are 600+ patches to implement this on the list), and a new
   option to git-send-email to (1) inspect the patch to see what
   paths are affected, and (2) call that "Find" script to figure
   out whom to send it to, and probably asking for confirmation.
Joe Perches· Aug 15, 2007, 02:12 UTC · re: Junio C Hamano · lore
On Tue, 2007-08-14 at 18:31 -0700, Junio C Hamano wrote:
Show 9 quoted lines
>    On the other hand, git-send-email _is_ all about sending it
>    out, and it needs to know who your patch should reach.  I
>    think it makes sense to have one script that, given a set of
>    paths that are affected, gives a list of potentially
>    interested people (that is "Finding" part -- and I see there
>    are 600+ patches to implement this on the list), and a new
>    option to git-send-email to (1) inspect the patch to see what
>    paths are affected, and (2) call that "Find" script to figure
>    out whom to send it to, and probably asking for confirmation.
Yes please.
The LK MAINTAINERS file is ugly.
Might there be a git portable way to "find"?

Rene Herman had an idea about using some git metadata that might be useful. The completely external data approach suggested by Al Viro might be OK too in that it wouldn't tie listeners to git requiring more content in git metadata.

Perhaps both via something like:
	--external-find "cmd @filelist"
Thanks,  Joe
Junio C Hamano· Aug 15, 2007, 05:25 UTC · re: Joe Perches · lore
Joe Perches <joe@perches.com> writes:
> Yes please.
Huh?
Show 5 quoted lines
> Rene Herman had an idea about using some git
> metadata that might be useful.  The completely
> external data approach suggested by Al Viro 
> might be OK too in that it wouldn't tie listeners
> to git requiring more content in git metadata.

The reason I found Linus's suggestion desirable is because it fundamentally does not require git to track any metadata. If the commits are in git, then his script would let you gather the data, but otherwise you should be able to do the same by grepping patches. Obviously you would need to filter by paths, looking at the diffstat, but the approach does _not_ tie users to git.

Rene Herman· Aug 15, 2007, 05:42 UTC · re: Junio C Hamano · lore
On 08/15/2007 07:25 AM, Junio C Hamano wrote:
> Joe Perches <joe@perches.com> writes:
Show 13 quoted lines
>> Rene Herman had an idea about using some git
>> metadata that might be useful.  The completely
>> external data approach suggested by Al Viro 
>> might be OK too in that it wouldn't tie listeners
>> to git requiring more content in git metadata.
> 
> The reason I found Linus's suggestion desirable is because it
> fundamentally does not require git to track any metadata.  If
> the commits are in git, then his script would let you gather the
> data, but otherwise you should be able to do the same by
> grepping patches.  Obviously you would need to filter by paths,
> looking at the diffstat, but the approach does _not_ tie users
> to git.

I believe that wouldn't be much of a problem really. Users in this context are people submitting patches and most people who do will, could and maybe even should be running git these days -- git is very good, GPLd and the Linux source code managament system.

But for occasional contributors that don't, a MAINTAINERS file much like the current could also be generated into releases; it's just that the source would live as file/directory metadata inside git.

Still like the notion of a generic file/directory metadata implementation inside git, through that "<tag>=<value>" system that I suggested. Wouldn't be intrinsically tied to Linux or anything, with any project being free to invent their own tags and has heaps of possible uses, from the current MAINTAINERS info, through summary information, author/licese information, anything goes...

Rene.
Stefan Richter· Aug 15, 2007, 09:39 UTC · re: Joe Perches · lore
Joe Perches wrote:
> On Tue, 2007-08-14 at 18:31 -0700, Junio C Hamano wrote:
>>    On the other hand, git-send-email _is_ all about sending it
>>    out, and it needs to know who your patch should reach.  I
>>    think it makes sense to have one script that,
[...]
Show 5 quoted lines
> Yes please.
> 
> The LK MAINTAINERS file is ugly.
> 
> Might there be a git portable way to "find"?
Note, maintainer contacts
  - should be available to patch submitters and
  - must be available to *problem reporters*
without having to have git and a .git repo.
-- 
Stefan Richter
-=====-=-=== =--- -====
http://arcgraph.de/sr/
Rene Herman· Aug 15, 2007, 11:44 UTC · re: Stefan Richter · lore
On 08/15/2007 11:39 AM, Stefan Richter wrote:
> Note, maintainer contacts
>   - should be available to patch submitters and
>   - must be available to *problem reporters*
> without having to have git and a .git repo.

That "must" seems rather strong. But those few non-developer users that could care are served by a MAINTAINERS file generated into releases.

Rene.
Joe Perches· Aug 15, 2007, 17:26 UTC · re: Rene Herman · lore
On Wed, 2007-08-15 at 13:44 +0200, Rene Herman wrote:
Show 7 quoted lines
> On 08/15/2007 11:39 AM, Stefan Richter wrote:
> > Note, maintainer contacts
> >   - should be available to patch submitters and
> >   - must be available to *problem reporters*
> > without having to have git and a .git repo.
> That "must" seems rather strong. But those few non-developer users that 
> could care are served by a MAINTAINERS file generated into releases.

Good idea for scripts to help kernel bug reporters. REPORTING-BUGS is underutilized as a guide.

I think Bug reporting is a separate issue from patch CC'ing. I'd rather have MAINTAINERS disappear altogether.

Joe Perches· Aug 17, 2007, 02:13 UTC · re: Junio C Hamano · lore
On Tue, 2007-08-14 at 18:31 -0700, Junio C Hamano wrote:
Show 9 quoted lines
>    On the other hand, git-send-email _is_ all about sending it
>    out, and it needs to know who your patch should reach.  I
>    think it makes sense to have one script that, given a set of
>    paths that are affected, gives a list of potentially
>    interested people (that is "Finding" part -- and I see there
>    are 600+ patches to implement this on the list), and a new
>    option to git-send-email to (1) inspect the patch to see what
>    paths are affected, and (2) call that "Find" script to figure
>    out whom to send it to, and probably asking for confirmation.

Sorry, not a git developer, so the paths are wrong. This seems to work:

Example:
git-send-email \
   --cc-cmd "perl scripts/get_maintainers.pl -non -multiline" foo.diff

--- git-send-email.pl 2007-08-16 19:06:07.000000000 -0700 +++ /usr/local/bin/git-send-email 2007-05-01 11:59:14.000000000 -0700

Show changes to diff +1 −15
@@ -47,9 +47,6 @@ Options:
    --cc           Specify an initial "Cc:" list for the entire series
                   of emails.
 
-   --cc-cmd       Specify a command to execute per file which adds
-                  per file specific cc address entries
-
    --bcc          Specify a list of email addresses that should be Bcc:
 		  on all the emails.
 
@@ -143,7 +140,7 @@ my (@to,@cc,@initial_cc,@bcclist,@xh,
 
 # Behavior modification variables
 my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc,
-	$dry_run, $cc_cmd) = (1, 0, 0, 0, 0, 0);
+	$dry_run) = (1, 0, 0, 0, 0);
 my $smtp_server;
 my $envelope_sender;
 
@@ -176,7 +173,6 @@ my $rc = GetOptions("from=s" => \$from,
 		    "subject=s" => \$initial_subject,
 		    "to=s" => \@to,
 		    "cc=s" => \@initial_cc,
-		    "cc-cmd=s" => \$cc_cmd,
 		    "bcc=s" => \@bcclist,
 		    "chain-reply-to!" => \$chain_reply_to,
 		    "smtp-server=s" => \$smtp_server,
@@ -611,16 +607,6 @@ foreach my $t (@files) {
 		}
 	}
 	close F;
-
-	if (${cc_cmd} ne "") {
-	    my $output = `${cc_cmd} $t`;
-	    my @lines = split("\n", $output);
-	    foreach my $c (@lines) {
-		push @cc, $c;
-		printf("(sob) Adding cc: %s from cc-cmd: '%s'\n", $c, $t) unless $quiet;
-	    }
-	}
-
 	if (defined $author_not_sender) {
 		$author_not_sender = unquote_rfc2047($author_not_sender);
 		$message = "From: $author_not_sender\n\n$message";
Joe Perches· Aug 17, 2007, 02:30 UTC · re: Joe Perches · lore
On Thu, 2007-08-16 at 19:13 -0700, Joe Perches wrote:
> Sorry, not a git developer, so the paths are wrong.
> This seems to work:
Sorry.  Patch reversed too.

--- /usr/local/bin/git-send-email 2007-05-01 11:59:14.000000000 -0700 +++ /home/joe/bin/git-send-email.pl 2007-08-16 19:25:53.000000000 -0700

Show changes to diff +15 −1
@@ -47,6 +47,9 @@ Options:
    --cc           Specify an initial "Cc:" list for the entire series
                   of emails.
 
+   --cc-cmd       Specify a command to execute per file which adds
+                  per file specific cc address entries
+
    --bcc          Specify a list of email addresses that should be Bcc:
 		  on all the emails.
 
@@ -140,7 +143,7 @@ my (@to,@cc,@initial_cc,@bcclist,@xh,
 
 # Behavior modification variables
 my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc,
-	$dry_run) = (1, 0, 0, 0, 0);
+	$dry_run, $cc_cmd) = (1, 0, 0, 0, 0, "");
 my $smtp_server;
 my $envelope_sender;
 
@@ -173,6 +176,7 @@ my $rc = GetOptions("from=s" => \$from,
 		    "subject=s" => \$initial_subject,
 		    "to=s" => \@to,
 		    "cc=s" => \@initial_cc,
+		    "cc-cmd=s" => \$cc_cmd,
 		    "bcc=s" => \@bcclist,
 		    "chain-reply-to!" => \$chain_reply_to,
 		    "smtp-server=s" => \$smtp_server,
@@ -607,6 +611,16 @@ foreach my $t (@files) {
 		}
 	}
 	close F;
+
+	if (${cc_cmd} ne "") {
+	    my $output = `${cc_cmd} $t`;
+	    my @lines = split("\n", $output);
+	    foreach my $c (@lines) {
+		push @cc, $c;
+		printf("(sob) Adding cc: %s from cc-cmd: '%s'\n", $c, $t) unless $quiet;
+	    }
+	}
+
 	if (defined $author_not_sender) {
 		$author_not_sender = unquote_rfc2047($author_not_sender);
 		$message = "From: $author_not_sender\n\n$message";
Joe Perches· Aug 17, 2007, 17:54 UTC · re: Joe Perches · lore

[PATCH] - git-send-email.perl

Here's a path to enable a command line option that takes a string argument

	cc-cmd

This modifies the @cc array to include whatever output is produced by cc_cmd $patchfile

cccmd can be stored in a config settings file

previous versions of this patch were submitted against an older version of git-send-email.perl

Show changes to git-send-email.perl +17 −2
diff --git a/git-send-email.perl b/git-send-email.perl
index 69559b2..828a77a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -46,6 +46,9 @@ Options:
    --cc           Specify an initial "Cc:" list for the entire series
                   of emails.
 
+   --cc-cmd       Specify a command to execute per file which adds
+                  per file specific cc address entries
+
    --bcc          Specify a list of email addresses that should be Bcc:
 		  on all the emails.
 
@@ -157,13 +160,14 @@ if ($@) {
 my ($quiet, $dry_run) = (0, 0);
 
 # Variables with corresponding config settings
-my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc);
+my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);
 
 my %config_settings = (
     "thread" => [\$thread, 1],
     "chainreplyto" => [\$chain_reply_to, 1],
     "suppressfrom" => [\$suppress_from, 0],
     "signedoffcc" => [\$signed_off_cc, 1],
+    "cccmd" => [\$cc_cmd, ""],
 );
 
 foreach my $setting (keys %config_settings) {
@@ -189,6 +193,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "smtp-server=s" => \$smtp_server,
 		    "compose" => \$compose,
 		    "quiet" => \$quiet,
+		    "cc-cmd=s" => \$cc_cmd,
 		    "suppress-from!" => \$suppress_from,
 		    "signed-off-cc|signed-off-by-cc!" => \$signed_off_cc,
 		    "dry-run" => \$dry_run,
@@ -652,11 +657,21 @@ foreach my $t (@files) {
 		}
 	}
 	close F;
+
+	if (${cc_cmd} ne "") {
+	    my $output = `${cc_cmd} $t`;
+	    my @lines = split("\n", $output);
+	    foreach my $c (@lines) {
+		push @cc, $c;
+		printf("(cc-cmd) Adding cc: %s from: '%s'\n", $c, $cc_cmd)
+		    unless $quiet;
+	    }
+	}
+
 	if (defined $author) {
 		$message = "From: $author\n\n$message";
 	}
 
-
 	send_message();
 
 	# set up for the next message
Junio C Hamano· Aug 17, 2007, 23:38 UTC · re: Joe Perches · lore

Re: [PATCH] - git-send-email.perl

Joe Perches <joe@perches.com> writes:
Show 12 quoted lines
> Here's a path to enable a command line option
> that takes a string argument
>
> 	cc-cmd
>
> This modifies the @cc array to include whatever
> output is produced by cc_cmd $patchfile
>
> cccmd can be stored in a config settings file
>
> previous versions of this patch were submitted
> against an older version of git-send-email.perl
... Signed-off-by: ...
Show 14 quoted lines
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 69559b2..828a77a 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -46,6 +46,9 @@ Options:
>     --cc           Specify an initial "Cc:" list for the entire series
>                    of emails.
>  
> +   --cc-cmd       Specify a command to execute per file which adds
> +                  per file specific cc address entries
> +
>     --bcc          Specify a list of email addresses that should be Bcc:
>  		  on all the emails.
>  
I do not see a patch to "Documentation/git-send-email.txt" here...
Show 15 quoted lines
> @@ -652,11 +657,21 @@ foreach my $t (@files) {
>  		}
>  	}
>  	close F;
> +
> +	if (${cc_cmd} ne "") {
> +	    my $output = `${cc_cmd} $t`;
> +	    my @lines = split("\n", $output);
> +	    foreach my $c (@lines) {
> +		push @cc, $c;
> +		printf("(cc-cmd) Adding cc: %s from: '%s'\n", $c, $cc_cmd)
> +		    unless $quiet;
> +	    }
> +	}
> +
Something like this, with appropriate error checking, perhaps?
	open my $cc, "${cc_cmd} $t |";
        while (my $c = <$cc>) {
        	...
	}
        close $cc;
Joe Perches· Aug 18, 2007, 01:51 UTC · re: Junio C Hamano · lore

Re: [PATCH] - git-send-email.perl

On Fri, 2007-08-17 at 16:38 -0700, Junio C Hamano wrote:
Show 10 quoted lines
> Joe Perches <joe@perches.com> writes:
> ... Signed-off-by: ...
> I do not see a patch to "Documentation/git-send-email.txt" here...
> Something like this, with appropriate error checking, perhaps?
> 
> 	open my $cc, "${cc_cmd} $t |";
>         while (my $c = <$cc>) {
>         	...
> 	}
>         close $cc;

Add --cc-cmd, the ability to execute an arbitrary "cmd" to generate per patch file specific "Cc:"s to git-send-email.perl

Signed-off-by: Joe Perches <joe@perches.com>
Show changes to 2 files +30 −2

Documentation/git-send-email.txt, git-send-email.perl

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index d243ed1..9a48847 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -34,6 +34,12 @@ The --bcc option must be repeated for each user you want on the bcc list.
 +
 The --cc option must be repeated for each user you want on the cc list.
 
+--cc-cmd::
+	Specify a command to execute once per patch file which
+	should generate patch file specific "Cc:" entries.
+	Output of this command must be single email address per line.
+	Default is the value of 'sendemail.cccmd' configuration value.
+	
 --chain-reply-to, --no-chain-reply-to::
 	If this is set, each email will be sent as a reply to the previous
 	email sent.  If disabled with "--no-chain-reply-to", all emails after
@@ -124,6 +130,9 @@ sendemail.aliasfiletype::
 	Format of the file(s) specified in sendemail.aliasesfile. Must be
 	one of 'mutt', 'mailrc', 'pine', or 'gnus'.
 
+sendemail.cccmd::
+	Command to execute to generate per patch file specific "Cc:"s.
+
 sendemail.bcc::
 	Email address (or alias) to always bcc.
 
diff --git a/git-send-email.perl b/git-send-email.perl
index 69559b2..d49947c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -46,6 +46,9 @@ Options:
    --cc           Specify an initial "Cc:" list for the entire series
                   of emails.
 
+   --cc-cmd       Specify a command to execute per file which adds
+                  per file specific cc address entries
+
    --bcc          Specify a list of email addresses that should be Bcc:
 		  on all the emails.
 
@@ -157,13 +160,14 @@ if ($@) {
 my ($quiet, $dry_run) = (0, 0);
 
 # Variables with corresponding config settings
-my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc);
+my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);
 
 my %config_settings = (
     "thread" => [\$thread, 1],
     "chainreplyto" => [\$chain_reply_to, 1],
     "suppressfrom" => [\$suppress_from, 0],
     "signedoffcc" => [\$signed_off_cc, 1],
+    "cccmd" => [\$cc_cmd, ""],
 );
 
 foreach my $setting (keys %config_settings) {
@@ -189,6 +193,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "smtp-server=s" => \$smtp_server,
 		    "compose" => \$compose,
 		    "quiet" => \$quiet,
+		    "cc-cmd=s" => \$cc_cmd,
 		    "suppress-from!" => \$suppress_from,
 		    "signed-off-cc|signed-off-by-cc!" => \$signed_off_cc,
 		    "dry-run" => \$dry_run,
@@ -652,11 +657,25 @@ foreach my $t (@files) {
 		}
 	}
 	close F;
+
+	if (${cc_cmd} ne "") {
+	    open(F, "${cc_cmd} $t |")
+		or die "(cc-cmd) Could not execute '${cc_cmd}'\n";
+	    while(<F>) {
+		my $c = $_;
+		$c =~ s/^\s*//g;
+		$c =~ s/\n$//g;
+		push @cc, $c;
+		printf("(cc-cmd) Adding cc: %s from: '%s'\n", $c, $cc_cmd)
+		    unless $quiet;
+	    }
+	    close F;
+	}
+
 	if (defined $author) {
 		$message = "From: $author\n\n$message";
 	}
 
-
 	send_message();
 
 	# set up for the next message

← back to recent threads