1

I need to document contribution to the project made by a particular user. Code is stored in github. I need to list all the code he has submitted, i don't need intermediate commits, only the final version.

Is there an easy way to export all his code? Thanks

Update: I need to know which lines of code written by a particular user made it to the final version of the app. What was his contribution to get it properly documented. Not the list of commits, but the code he has contributed.

So as the end result it should be all code submitted by this developer.

Elder
  • 437
  • 5
  • 17
  • This may help you on your way: http://stackoverflow.com/questions/4259996/how-can-i-view-a-git-log-of-just-one-users-commits – Brian Feb 01 '14 at 21:52
  • 1
    I think you might need to be more clear about what you mean. The code itself, or just commit messages. What if they have touched just one character of a file -do you want the entire file, or just the diffs...... much more information needed. – iandotkelly Feb 01 '14 at 22:42
  • What i need is a code listing as the end result. I want to know which lines of code in the final version were written by a particular developer. E.g. I need to know what lines of code were contributed by this developer. Thanks – Elder Feb 02 '14 at 10:44
  • And thanks for anonymously downvoting my question whoever you are, my friend. If you need clarification, why don't you just ask. If you don't like my question, why don't you explain yourself. This is a problem i'm facing and i'm looking for a solution, not some anonymous judging. – Elder Feb 02 '14 at 10:50

2 Answers2

2

I need to know which lines of code written by a particular user made it to the final version of the app. What was his contribution to get it properly documented

You can use git blame for that.

For applying git blame on multiple files, see "Git: Blame Statistics";

$  git ls-tree --name-only -z -r HEAD|egrep -z -Z -E '\.(cc|h|cpp|hpp|c|txt)$' \
   |xargs -0 -n1 git blame --line-porcelain|grep "^author "|sort|uniq -c|sort -nr

You might have to adapt that in order to grep and show the exact information you need, but git blame is made to show the lines contributed by a specific author.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

git log --author=your_name_here > log.txt

toolz
  • 871
  • 6
  • 12
  • Won't that just list all the author's commits? Now I think the question is almost impossible to answer, but I don't think this is what they are looking for, he says 'export all code'. – iandotkelly Feb 01 '14 at 22:21
  • Yeah that is impossible. This is the best I know how to do. – toolz Feb 01 '14 at 22:39
  • Thanks, but it lists user commits, i'm interested in listing submitted code – Elder Feb 02 '14 at 10:47