Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List last edits of all file by a collection of users

Question: Given a git repo, show the files modified by a specific set of users, plus the last editor (from that set of users) of those files.

Potential solution:

git ls-files | xargs -n 1 git log -1 --author="example.com" --name-only --pretty=format:'%aN' --follow -p | paste -d";" - -

This will produce desired output (below) but it's slow:

<author_a>;<file_a>
<author_b>;<file_b>
<author_b>;<file_c>
...

Is there a faster/better way to do this?

like image 906
stephenfin Avatar asked Oct 31 '22 11:10

stephenfin


1 Answers

You can make alias for that so it will save you the typing or the copying of that line.

To make alias you simply add alias using git alias command or pasting it directly in your .gitconfig file

Another thing you can do is modify this script to suite your desired format and add it to your path, then add alias to this script in your git config.

for example if you want to call it git l

 = "!bash -c 'source ~/.githelpers && pretty_git_log'"
like image 94
CodeWizard Avatar answered Dec 19 '22 06:12

CodeWizard