Package: vcsh
Version: 1.0-1
Severity: normal

Dear Maintainer,

vcsh does not appear to quote arguments sufficiently when passing them on to
git. e.g. whem commiting using the -m option:

$ vcsh bash commit -a -m "This is a test"
fatal: Paths with -a does not make sense.
$ vcsh bash commit -m "This is a test" .bashrc 
error: pathspec 'is' did not match any file(s) known to git.
error: pathspec 'a' did not match any file(s) known to git.
error: pathspec 'test' did not match any file(s) known to git.

In both cases the argument to -m has ended up just "This" while "is", "a" and
"test" are separate arguments.

After a little light hacking the attached patch works for me, not sure it is
the best approach though.

Ian.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), 
(500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages vcsh depends on:
ii  git  1:1.7.10.4-1+wheezy1

Versions of packages vcsh recommends:
ii  mr                           1.12
ii  openssh-client [ssh-client]  1:6.0p1-3

vcsh suggests no packages.

-- no debconf information
--- /usr/bin/vcsh	2012-06-30 01:10:40.000000000 +0100
+++ ./vcsh	2013-01-27 13:10:48.000000000 +0000
@@ -169,7 +169,7 @@
 run() {
 	hook pre-run
 	use
-	$VCSH_EXTERNAL_COMMAND
+	"$@"
 	hook post-run
 }
 
@@ -259,7 +259,7 @@
 	export VCSH_REPO_NAME="$2"
 	export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
 	[ "$VCSH_COMMAND" = 'rename' ]         && export GIT_DIR_NEW="$VCSH_REPO_D/$3.git"
-	[ "$VCSH_COMMAND" = 'run' ] && shift 2 && export VCSH_EXTERNAL_COMMAND="$*"
+	[ "$VCSH_COMMAND" = 'run' ] && shift 2
 	[ "$VCSH_COMMAND" = 'write-gitignore' ]
 elif [ "$1" = 'list' ] ||
      [ "$1" = 'list-tracked' ]; then
@@ -270,7 +270,7 @@
 	export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
 	[ -d $GIT_DIR ] || { help; exit 1; }
 	shift 1
-	export VCSH_EXTERNAL_COMMAND="git $*"
+	set -- "git" "$@"
 elif [ -n "$1" ]; then
 	export VCSH_COMMAND='enter'
 	export VCSH_REPO_NAME="$1"
@@ -304,6 +304,6 @@
 verbose "$VCSH_COMMAND begin"
 export VCSH_COMMAND=$(echo $VCSH_COMMAND | sed 's/-/_/g')
 hook pre-command
-$VCSH_COMMAND
+$VCSH_COMMAND "$@"
 hook post-command
 verbose "$VCSH_COMMAND end, exiting"

Reply via email to