X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/1e30597178430554d0497cbd365f69a3cff63af8..794f0aac869dda034300211e9be45db123d84377:/vcsh?ds=sidebyside diff --git a/vcsh b/vcsh index c446fb9..c9c706b 100755 --- a/vcsh +++ b/vcsh @@ -1,7 +1,7 @@ #!/bin/sh # This program is licensed under the GNU GPL version 2 or later. -# (c) Richard "RichiH" Hartmann , 2011-2012 +# (c) Richard "RichiH" Hartmann , 2011-2013 # For details, see LICENSE. To submit patches, you have to agree to # license your code under the GNU GPL version 2 or later. @@ -9,8 +9,15 @@ # explain the choice of GPLv2+ over GPLv3+. # The author prefers GPLv3+ over GPLv2+ but feels it's better to maintain # full compability with git. In case git ever changes its licensing terms, +# which is admittedly extremely unlikely to the point of being impossible, # this software will most likely follow suit. +basename() { + local f; f="${1##*/}" + [ -z "$2" ] || f="${f%$2}" + echo "$f" +} + SELF=$(basename $0) VERSION='1.2' @@ -170,7 +177,7 @@ git_dir_exists() { hook() { for hook in $VCSH_HOOK_D/$1* $VCSH_HOOK_D/$VCSH_REPO_NAME.$1*; do [ -x "$hook" ] || continue - info "executing '$hook'" + verbose "executing '$hook'" "$hook" done } @@ -257,9 +264,9 @@ write_gitignore() { tempfile=$(mktemp) || fatal "could not create tempfile" 51 echo '*' > "$tempfile" || fatal "could not write to '$tempfile'" 57 for gitignore in $gitignores; do - echo "$gitignore" | sed 's/^/!/' >> "$tempfile" || fatal "could not write to '$tempfile'" 57 + echo "$gitignore" | sed 's@^@!/@' >> "$tempfile" || fatal "could not write to '$tempfile'" 57 if [ x$VCSH_GITIGNORE = x'recursive' ] && [ -d "$gitignore" ]; then - { echo "$gitignore/*" | sed 's/^/!/' >> "$tempfile" || fatal "could not write to '$tempfile'" 57; } + { echo "$gitignore/*" | sed 's@^@!/@' >> "$tempfile" || fatal "could not write to '$tempfile'" 57; } fi done if diff -N "$tempfile" "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" > /dev/null; then