Skip to content

Instantly share code, notes, and snippets.

@rgngl
Created December 21, 2009 23:28
Show Gist options
  • Save rgngl/261351 to your computer and use it in GitHub Desktop.
Save rgngl/261351 to your computer and use it in GitHub Desktop.
#!/bin/bash
# reads file names from the file provided in the parameter and
# excludes them from the svn commit.
# Üstün Ergenoglu - 2009 - e g o _at_ u s t u n dot fi
if [ $# -lt 1 ]
then
echo "usage: $0 "
exit 1;
fi
FILES=`cat $1`
CHANGED_FILES=`svn status | grep ^M | cut -c 8-`
for i in $FILES
do
echo Excluding: $i
done
for i in $CHANGED_FILES
do
echo Changed file: $i
done
for i in $CHANGED_FILES
do
COMMIT=1
for j in $FILES
do
if [ $i = $j ];
then
echo "$i changed but excluding from commit."
COMMIT=0
fi
done
if [ $COMMIT = "1" ];
then
COMMIT_FILES=$COMMIT_FILES" $i"
fi
done
echo "Files to commit: $COMMIT_FILES"
svn ci $COMMIT_FILES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment