Last active
October 18, 2021 17:33
-
-
Save jhcarr/f602e56f8a60967fe1d2ea4f16c2749a to your computer and use it in GitHub Desktop.
Create a new SVN changelist, named <name> and add modified project files to it; similar to \`git add -u\`. All further arguments are ignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
### SVN Changelist-Maker | |
### Justin Carr : 8-31-2017 | |
### I miss git's `add -U` functionality ... and git in general. | |
breakLine=0; | |
function printUsage(){ | |
echo "changelist-maker"; | |
echo; | |
echo "USAGE:"; | |
echo " changelist-maker <name>"; | |
echo; | |
echo "Changelist-maker will create a new SVN changelist, named <name> and add modified project files to it; similar to \`git add -u\`. All further arguments are ignored."; | |
echo; | |
} | |
if [ -z $1 ] | |
then | |
printUsage; | |
exit 0; | |
fi | |
echo; | |
echo "Making changelist $1 ..."; | |
echo; | |
breakLine=$(svn st | grep -n "\-\-\- Changelist" | head -1 | sed 's|:.*||g'); | |
if [ -z $breakLine ] | |
then | |
svn st | grep '^[AM]' | cut -c9- | xargs svn cl $1; | |
else | |
svn st | head -n $breakLine | grep '^[AM]' | cut -c9- | xargs svn cl $1; | |
fi | |
echo; | |
echo "... done."; | |
echo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment