iMarc | Interactive Media Architects
  • Portfolio
  • Process
  • About
  • Communiqué
  • Contact
  • Support
  • Search

svncheck: SVN Commit Audit over Multiple Projects

by Dave Tufts - March 12, 2008 / 1:52pm

My life is now in SVN. Work projects are under Subversion's control. Status reports are in SVN. Personal projects are in SVN. It's great.

The only problem with so many repositories is remembering to check in all my updates.

My SVN environment consists of Mac OS X, scplugin, and built-in Terminal commands.

Throughout the day, I may edit 4–5 repositories. Inevitably, there's a chance of forgetting to commit. Using scplugin, I could manually right-clicking on each directory. That sounds tedious. Using the terminal, I could manually execute svn stat [directory]. That would be just as time consuming.

Hello svncheck.

I wrote this simple shell script to loop through all sub-directories in my SVN root and tell me if anything, across any project, needs to be committed. It assumes that you're organized enough to keep all SVN projects under a common parent-directory. The default script loops through ~/svn/.

Installation (OS X)

  1. Copy the script below to a text file
  2. Name it svncheck and save it on your Desktop.
  3. Open a terminal and execute the following.
    • chmod 755 ~/Desktop/svncheck
    • sudo mv ~/Desktop/svncheck /usr/local/bin/svncheck

Usage

Open your terminal and type svncheck. If the terminal doesn't return anything, you're all good — all your files are checked in.

If you see something like this…

  M  massbio.org/trunk/css/site.css
  M  status.imarc.net/trunk/dave-status.xls
  M  status.imarc.net/trunk/dave-people.xls

…that's telling you that one file in the 'massbio.org' repository and two files in the 'status.imarc.net' repository need to be committed.

svncheck doesn't commit your files. It just acts as an audit of all repositories, reporting any files that have been updated but not checked in.

svncheck: The Script

Here's the script. You'll notice the default SVN_HOME parameter is set to '~/svn'. If you keep repositories somewhere else, change this default. Otherwise you'll have execute something like svncheck /path/to/your/svn/root

#!/bin/sh

# 
# svncheck runs 'svn stat' on each directory in your SVN root.
# If you work on multiple projects throughout the day, it's a 
# quick way to check if any project needs committing.
# 
# USAGE
# svncheck [/path/to/svn/root]
# 

SVN_HOME=$1

if [ "$SVN_HOME" == "" ]; then
    SVN_HOME=${HOME}/svn/
fi;

cd ${SVN_HOME}

for i in *; do
svn stat $i
done

exit;

I run svncheck every evening before I turn my computer off. Enjoy!

More Articles Get the RSS Feed Post A Comment
No comments yet.

Add A Comment

Statements and opinions expressed in this blog and any comments made are the private opinions of the respective poster, and, as such, iMarc LLC is neither responsible nor liable for such content.

iMarc

iMarc is a web development company in Newburyport, MA. This is our blog.
View all blogs or learn more about iMarc.

About the Author

Dave's Head Dave Tufts, Vice President of Technology
I help people build websites.
I have two daughters.
I'm obsessed with Ron Paul.
More blogs by Dave

Search Our Blog

Recent Communiqués

  • for lack of nail
  • You're Not Crazy for Smiling at your Plant
  • Book Recommendation: Writing Tools
  • Redundancy: Good or Bad?
  • Making the Switch to Gmail
  • Character Removal
  • Subway Art
  • Using rsync to synchronize iTunes libraries
  • Enough is Enough.
  • Targeted Inspiration
  • Green Benefit, Good Cause
  • Dashes, Underscores, URLs, SEO and Humans
  • Newburyport Web Geek Meetup, Thursday March 20th
  • 01001110 01001001 01001110: The Revolution Continues
  • iMarc's Newest Member

Popular Communiqués

  • for lack of nail
  • You're Not Crazy for Smiling at your Plant
  • How to Make Links
  • Book Recommendation: Writing Tools
  • Using rsync to synchronize iTunes libraries
  • Patrick, From My Perspective
  • Subway Art
  • Character Removal
  • Dashes, Underscores, URLs, SEO and Humans
  • Green Benefit, Good Cause

Recent Comments

  • You're Not Crazy for Smiling at your Plant

    By Elyse Holladay: Watch out - that notebook looks like it'd bite your hand off!

  • for lack of nail

    By Patrick McPhail: Fixed: http://$controller->url.nin

  • for lack of nail

    By Peter R. Wood: Nice to see they're using an MVC paradigm. Too bad they didn't test their email first.

  • You're Not Crazy for Smiling at your Plant

    By Robert Mohns: "You'll note that there is an odd number so that votes can't end up in a tie." Now we…

  • You're Not Crazy for Smiling at your Plant

    By Fred LeBlanc: You'll note that there is an odd number so that votes can't end up in a tie.

RSS

RSS Icon Learn about RSS and get the feed for our blog.

About iMarc

  • We build custom web sites
  • In-house strategy, design, programming, hosting
  • In business since 1997
  • We’re located in Newburyport, MA
  • Call us at (978) 462-8848

© 2008 iMarc LLC, Contact Us

Links

  • Home
  • Portfolio
  • Client Support
  • Log In
  • (icon)RSS

Meet the Team

Craig's Head Craig Henry, Creative Director

Designing Media types that exemplify innovation, excitement, and growth to our industry and our clients.

Learn More | Meet the Others