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

Re: git-who

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Oct 8, 2008, 18:35 UTC
Message-ID
<alpine.LFD.2.00.0810081119490.3208@nehalem.linux-foundation.org>
In-Reply-To
<48EC4F9D.4020202@viscovery.net>
On Wed, 8 Oct 2008, Johannes Sixt wrote:
> 
> Wouldn't
> 
>    git shortlog -s -- path/to/file

I suspect "-sn" is better. It sorts by number rather than by name, and if you're interested in who has touched a file, you probably wants to know who has touched it _most_.

And as usual, the nice thing about it is that all the normal git rules apply, so you can do it by multiple files or subdirectories, and you can filter by time. And ignore merges, since they tend to be about upper-level maintainers than about the people doing patches.

So for the kernel, you can do something like
	git shortlog -ns --no-merges --since=6.months.ago drivers/scsi include/scsi
and see who has been doing scsi-related stuff lately.

Of course, when it comes to relevance, it may be more interesting to just look at 'git blame' output, and then you're limited to single files at a time. And performance is going to be a problem, especially if you enable movement detection.

But we don't have anything special for that. You can do it with something like

	git blame -M -w kernel/sched.c |
		grep -v '^^' |
		cut -d'(' -f2- |
		cut -c1-20 |
		sort |
		uniq -c |
		sort -n

which will ignore the root commit (so as not to give me all the credit for old history), but it would probably be better (but more complex - need perl or some other "real" language with associative arrays etc to remember the commit information) to parse the output of "git blame --incremental" instead.

		Linus
Previous: Rhodes, Kate
Message 7 of 7 in “git-who”
  1. Rhodes, KateOct 7, 2008
  2. Miklos VajnaOct 7, 2008
  3. Jeff KingOct 8, 2008
  4. Rhodes, KateOct 8, 2008
  5. Johannes SixtOct 8, 2008
  6. Rhodes, KateOct 8, 2008
  7. Linus TorvaldsOct 8, 2008

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.