-
-
Save hankpillow/838593 to your computer and use it in GitHub Desktop.
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 | |
if [ "$1" = "?" ] | |
then | |
B1="\033[1m"; | |
B2="\033[0m"; | |
echo -e ""; | |
echo -e "${B1}AUTHOR${B2}"; | |
echo -e " Marcelo Miranda Carneiro - [email protected]"; | |
echo -e ""; | |
echo -e "${B1}INFO${B2} (release 2011-01-11)"; | |
echo -e " log changes by user (SVN)"; | |
echo -e ""; | |
echo -e "${B1}USAGE${B2}"; | |
echo -e " log-by-user SVN_PARAMETERS USERNAME"; | |
echo -e ""; | |
echo -e "${B1}EXAMPLES${B2}"; | |
echo -e " log-by-user -l10 \"mcarneiro\""; | |
echo -e " log-by-user -r10:HEAD \"mcarneiro\""; | |
echo -e ""; | |
exit 1; | |
fi | |
svn log -v $1 | sed -n "/"$2"/,/-----$/ p" |
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 status $1 | grep "^?" | awk '{print $2}' | xargs svn add |
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 | |
if [ "$1" = "?" ] | |
then | |
B1="\033[1m"; | |
B2="\033[0m"; | |
echo -e ""; | |
echo -e "${B1}AUTHOR${B2}"; | |
echo -e " Marcelo Miranda Carneiro - [email protected]"; | |
echo -e ""; | |
echo -e "${B1}INFO${B2} (release 2011-01-11)"; | |
echo -e " add files and folders recursivelly applying the current \"svn:ignore\" property"; | |
echo -e ""; | |
echo -e "${B1}USAGE${B2}"; | |
echo -e " svn-ignore-add FOLDER_NAME"; | |
echo -e ""; | |
exit 1; | |
fi | |
svn add $1 --force --depth empty; svn pset svn:ignore "$(svn pget svn:ignore .)" $1; svn add $1 --force --depth files; | |
DIRECTORIES=(`svn st $1 | grep "^?" | awk '{print$2}'`); | |
if [ "$DIRECTORIES" != "" ] | |
then | |
for a in "${DIRECTORIES[@]}"; | |
do | |
if [ -d "$a" ] | |
then | |
svn-ignore-add $a; | |
fi; | |
done; | |
fi; |
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 | |
# quick way to get svn revision. useful for using in another functions | |
# usage svn-rev [FOLDER] | |
if [ "$1" = "?" ] | |
then | |
B1="\033[1m"; | |
B2="\033[0m"; | |
echo -e ""; | |
echo -e "${B1}AUTHOR${B2}"; | |
echo -e " Marcelo Miranda Carneiro - [email protected]"; | |
echo -e ""; | |
echo -e "${B1}INFO${B2} (release 2011-01-11)"; | |
echo -e " quick way to get svn revision. useful for using with another functions"; | |
echo -e ""; | |
echo -e "${B1}USAGE${B2}"; | |
echo -e " svn-rev [FOLDER]"; | |
echo -e ""; | |
exit 1; | |
fi | |
svn info $1 | grep "Revision:" | awk '{print$2}' |
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 | |
if [ "$1" = "?" ] | |
then | |
B1="\033[1m"; | |
B2="\033[0m"; | |
echo -e ""; | |
echo -e "${B1}AUTHOR${B2}"; | |
echo -e " Marcelo Miranda Carneiro - [email protected]"; | |
echo -e ""; | |
echo -e "${B1}INFO${B2} (release 2011-01-11)"; | |
echo -e " Gets only the url from svn info command"; | |
echo -e ""; | |
echo -e "${B1}USAGE${B2}"; | |
echo -e " svn-url [BACK] [FOLDER]"; | |
echo -e ""; | |
echo -e " BACK number of \"back directories\" from the current url"; | |
echo -e " FOLDER folder to execute svn info"; | |
echo -e ""; | |
echo -e "${B1}EXAMPLES${B2}"; | |
echo -e " svn-url # https://svn.domain:8443/svn/project/branches/" | |
echo -e " svn-url 1 # https://svn.desenv:8443/svn/project/" | |
echo -e " svn-url 0 test/ # https://svn.desenv:8443/svn/project/branches/test/" | |
echo -e ""; | |
exit 1; | |
fi | |
URL_BACK_NUM="0" | |
URL=$(svn info $2 | grep "URL:" | awk '{print $2}')"/" | |
if [ "$1" != "" ] | |
then | |
URL_BACK_NUM="$1" | |
fi | |
if [ "$URL_BACK_NUM" = "0" ] | |
then | |
echo $URL | |
else | |
URL_TO_FILTER=$(echo $URL | awk -F "/" '{print $(NF+'$(($URL_BACK_NUM))')}') | |
echo $URL | awk -F "$URL_TO_FILTER/" '{print$1}' | |
fi |
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 | |
if [ "$1" = "?" ] | |
then | |
B1="\033[1m"; | |
B2="\033[0m"; | |
echo -e ""; | |
echo -e "${B1}AUTHOR${B2}"; | |
echo -e " Marcelo Miranda Carneiro - [email protected]"; | |
echo -e ""; | |
echo -e "${B1}INFO${B2} (release 2011-01-11)"; | |
echo -e " Creates a zip file with the modified or created files from a range of revisions"; | |
echo -e ""; | |
echo -e "${B1}USAGE${B2}"; | |
echo -e " zip-by-log FILENAME SVN_PARAMETERS"; | |
echo -e ""; | |
echo -e "${B1}EXAMPLES${B2}"; | |
echo -e " zip-by-log ftp.zip -l10"; | |
echo -e " zip-by-log ftp.zip \"-r10 -r20\""; | |
echo -e ""; | |
exit 1; | |
fi | |
PATH_TO_FILTER="$(pwd | awk -F "/" '{print $(NF)}')"; | |
zip $1 $(svn log $2 -v | grep $PATH_TO_FILTER | grep -E "\s+?[AMR]" | awk -F "$PATH_TO_FILTER/" '{print $2}' | awk '{print $1}' | grep "\." | sort -u) |
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 | |
if [ "$1" = "?" ] | |
then | |
B1="\033[1m"; | |
B2="\033[0m"; | |
echo -e ""; | |
echo -e "${B1}AUTHOR${B2}"; | |
echo -e " Marcelo Miranda Carneiro - [email protected]"; | |
echo -e ""; | |
echo -e "${B1}INFO${B2} (release 2011-02-18)"; | |
echo -e " Creates a zip file with the modified or created files from the current changes on working copy"; | |
echo -e ""; | |
echo -e "${B1}USAGE${B2}"; | |
echo -e " zip-by-log [FILENAME]"; | |
echo -e ""; | |
echo -e "${B1}EXAMPLES${B2}"; | |
echo -e " zip-by-status # if no name is passed, creates a 'status.zip' file"; | |
echo -e " zip-by-status ftp.zip"; | |
echo -e ""; | |
exit 1; | |
fi | |
FILENAME=$1; | |
if [ "$FILENAME" = "" ]; | |
then | |
FILENAME="status.zip"; | |
fi | |
zip $FILENAME $(svn st | grep "^[AM]" | awk '{print$(NF)}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment