]> git.madduck.net Git - code/vcsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Revert "Implement basename in shell"
authorRichard Hartmann <richih@debian.org>
Mon, 9 Dec 2013 09:18:34 +0000 (10:18 +0100)
committerRichard Hartmann <richih@debian.org>
Mon, 9 Dec 2013 09:18:34 +0000 (10:18 +0100)
This reverts commit 794f0aac869dda034300211e9be45db123d84377.

Conflicts:
vcsh

Turns out the shell implementation didn't account for trailing
slashes. While, arguably, a proper interactive shell should eat
them before execution anyway, this can also be called in script
context.

This means that

    vcsh clone foo/

made it fail and even after commit 7e33e38a869989d04d12f2ef160d514041eb01e3

    vcsh clone foo//

would have failed.

Revert to safe and time-proven default: Standalone `basename`.

For further information, see:

https://github.com/RichiH/vcsh/pull/92

vcsh

diff --git a/vcsh b/vcsh
index b585f5c53ee2e848cfa02477072f8180ca7c4dd5..9f8e2748dd094b18fe2907dc7d179cce50f34b02 100755 (executable)
--- a/vcsh
+++ b/vcsh
 # This should always be the first line of code to facilitate debugging
 [ -n "$VCSH_DEBUG" ] && set -vx
 
-basename() {
-       # Implemented in shell to avoid spawning another process
-       local file
-       file="${1%/}"
-       file="${file##*/}"
-       [ -z "$2" ] || file="${file%$2}"
-       echo "$file"
-}
-
 SELF=$(basename $0)
 VERSION='1.20130909.git-HEAD'