Skip to content

Instantly share code, notes, and snippets.

@chfritz
Created January 3, 2014 18:29
Show Gist options
  • Save chfritz/8243479 to your computer and use it in GitHub Desktop.
Save chfritz/8243479 to your computer and use it in GitHub Desktop.
A small wrapper script for 'svn up' that sorts and colors the output depending on the type of the entry, e.g., yellow for untracked files, green for updated, blue for merged.
#!/bin/bash
BLACK="\033[30m"
RED="\033[31m"
GREEN="\033[32m"
YELLOW="\033[33m"
BLUE="\033[34m"
PINK="\033[35m"
CYAN="\033[36m"
WHITE="\033[37m"
NORMAL="\033[0;39m"
TMPFILE=.cvsup.tmp
svn up > $TMPFILE
svn status >> $TMPFILE
printf $YELLOW
grep -e ^"\? " -e ^"I " $TMPFILE
printf $GREEN
grep -e ^"R " -e ^"U " -e ^"G " $TMPFILE
printf $BLUE
grep -e ^"M " -e ^"E " $TMPFILE
printf $RED
grep -e ^"C " -e ^"! " -e ^"X " -e ^"~ " $TMPFILE
printf $PINK
grep ^"R " $TMPFILE
printf $PINK
grep ^"D " $TMPFILE
printf $CYAN
grep ^"A " $TMPFILE
printf $NORMAL
rm $TMPFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment