Re: Listing authors of each file in branch HEAD since given revision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

On Thu, May 29, 2008 at 01:47:29PM +0100, Johannes Schindelin wrote:
> On Thu, 29 May 2008, Alexander Gladysh wrote:
> 
> > For each file in the head of my current branch I need to get a list of 
> > all people who altered it since given revision. If file was not changed, 
> > it should be not listed.
> > 
> > Something like:
> > 
> >   my/file1.ext user1 user2 user3
> >   my/file2.ext user1
> 
> You will be able to do something like this easily from the output of
> 
> git log --pretty=format:%an --name-only HEAD
> 
> Probably just a Perl script which reads the author name, and then attaches 
> that author name to all following file names until an empty lines occurs, 
> recursively.

No rocket science:

git log --pretty=format:%an --no-merges -r --name-only HEAD~100..HEAD |
perl -lne 'our %i; $_ or $a = 0 or next; ++$a == 1 and $b = $_ and next;
$i{$_}{$b}++; END { print "$_: " . join(", ", keys %{$i{$_}}) for (keys
%i); }'

Sorry for the obfuscation. :-)

-- 
				Petr "Pasky" Baudis
Whatever you can do, or dream you can, begin it.
Boldness has genius, power, and magic in it.	-- J. W. von Goethe
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux