This is useful for piping to other commands, as well:
svn status | egrep '^(M|A)' | egrep -o '[^MA\ ].*$' | xargs $EDITOR
If (when) you forget to "svn rm" files from your repository, use this to let your repository know you want those files gone. Of course this works with adding and reverting too.
Really only valuable in a PHP-only project directory. This is using standard linux versions of the tools. On most older BSD variants of sed, use -E instead of -r. Or use: sed 's/\+[[:space:]]\{1,\}//' instead. Show Sample Output
Searches for all .project files in current folder and below and uses "svn info" to get the last changed revision. The last sed joins every two lines. Show Sample Output
This version makes uses of Bash shell expansion, so it might not work in all other shells.
Let's supose some moron used some m$ shit to commit to a later svnsynced repo. On a svn sync all his message logs cause a svnsync: Error setting property 'log': this commands finds all its contributions and fix all his commit logs Show Sample Output
The result of this command is a tar with all files that have been modified/added since revision 1792 until HEAD. This command is super useful for incremental releases.
otherwise you get this error message: svn: Can't move '.svn/tmp/entries' to '.svn/entries': Operation not permitted
Helps if you accidentally deleted files from an svn repo with plain rm and you would like to mark them for svn to delete too.
dirrrty: use -p to chomp automatically, substitute all newlines away and then replace the "---" by a newline ? bingo! s/// => s/// is just a cooler way to write s///, s/// which is just the small brother of s///; s/// (comma is an operator!) have fun!
If you don't have html2text Show Sample Output
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
List all svn externals dependencies of a specific project. Show Sample Output
simply change extension for others programming languages
If you have ever edited a locally checked out version of a file to tweak it for testing purposes, and came back to it over a weekend, you might have forgotten what you exactly changed. This command helps you see the differences between the the checked in SVN version, and the one you tweaked. Show Sample Output
handels @, ?, whitespaces in names. replace "?" and "add" by "!" and "rm" for svn mass remove. ---> I m looking for a nicer way to write it, perhaps with something using " perl -ne '`blahblah` if /\?(.*)/' " Show Sample Output
command to find out the unused SVN repositories from the server via svnlook. This lists the when the last commit (HEAD revision) has happened in the repository. Show Sample Output
This command allows you to revert every modified file one-by-one in a while loop, but also after "echo $file;" you can do any sort of processing you might want to add before the revert happens. Show Sample Output
Get the list of changed files between revision 43 and HEAD revision: svn diff . -r43:HEAD --summarize Strip extra 8 characters from every line: cut -c9-99999 Copy the listed files to home/me/destination: cpio -pvdmu ~/destination Make a plain copy (-p), list files being copied (-v), create needed directories (-d), preserve modification time (-m), overwrite unconditionally (-u) Show Sample Output
This one has a better performance, as it is a one pass count with awk. For this script it might not matter, but for others it is a good optiomization.
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.
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
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: