gets all files committed to svn by a particular user since a particular date

svn log -v -r{2009-05-21}:HEAD | awk '/^r[0-9]+ / {user=$3} /yms_web/ {if (user=="george") {print $2}}' | sort | uniq
just change the date following the -r flag, and/or the user name in the user== conditional statement, and substitute yms_web with the name of your module

4
2009-06-05 14:07:28

1 Alternatives + Submit Alt

  • svn log -v --> takes log of all Filter1 -------- -r {from}{to} --> gives from and to revision Filter2 -------- awk of line 'r'with numbers Assign user=3rd column [ie; username] Filter3 -------- if username = George print details Filter4 -------- Print lines starts with M/U/G/C/A/D [* A Added * D Deleted * U Updated * G Merged * C Conflicted] Filter5 -------- sort all files Filter6 ------- Print only uniq file's name alone. Show Sample Output


    0
    svn log -v -r{2009-11-1}:HEAD | awk '/^r[0-9]+ / {user=$3} /./{if (user=="george") {print}}' | grep -E "^ M|^ G|^ A|^ D|^ C|^ U" | awk '{print $2}' | sort | uniq
    smilyface · 2011-12-05 07:36:44 0

What Others Think

OMG! Thanks man, for this peace of heaven. This command save my life (ok, but save hours of work). Congrats!
lawrence · 483 weeks and 5 days ago
Here is a shell for this. I just made for my usage. May be helpful for u too. The before told command itself i used , but with details of commit also included. Do as follows. create a file vi svn_get_user_committed_files_details.sh press i then copy & paste the following as it is. And then make the shell executable with the command chmod. [Don't forget to change PROJECT path. :)] #!/bin/bash PROJECT="/home/smily/workspace/MyProj" svnfile_log_all="/tmp/svnfile_log_all.txt" svnListUNames="/tmp/svnListUNames.txt" svnUserCommitted="/tmp/svnUserCommitted.txt" uName="$1" [ -f $svnfile_log_all ] && rm -f $svnfile_log_all [ -f $svnListUNames ] && rm -f $svnListUNames [ -f $svnUserCommitted ] && rm -f $svnUserCommitted echo -e "\nPlease wait..\n" svn log -v $PROJECT > $svnfile_log_all if [ -z $uName ]; then cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./ {print user} ' | grep -v "^$" |sort | uniq >> $svnListUNames else if [ `cat $svnfile_log_all | grep "$uName" | wc -l` -gt "0" ]; then echo $uName > $svnListUNames else echo -e "\n>>>>>user: $uName not committed any files. exit 0 fi fi echo -e "\n\nRepo Name: `cat $PROJECT/.svn/entries | grep " while read uName do echo -e "$uName committed files\n======================" >> $svnUserCommitted cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' | grep -E "^ M|^ G|^ A|^ D|^ C|^ U" | awk '{print $2}' | sort >> $svnUserCommitted echo -e "\n\nIn Detail:\n==========" >> $svnUserCommitted cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' >> $svnUserCommitted echo -e "\n" done < $svnListUNames echo -e "Log is in : $svnUserCommitted\n" cat $svnUserCommitted
smilyface · 364 weeks ago
A shell script for doing this kind of defeats the purpose of command line fu
jemptymethod · 364 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

Considering A New Car?

You should consider a Tesla. Get 6 Months Free Supercharging.

Free Supercharging

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: