git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bugfix: stop if directory already exists
@ 2005-11-13 14:03 Josef Weidendorfer
  2005-11-14  8:57 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Josef Weidendorfer @ 2005-11-13 14:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Fix a typo: We do not want to run the directory as command,
and want to terminate if the directory exists
Additionally, update the usage message

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>

---

Regarding the usage: I do not think that on an error condition
the usage string should be outputted. This helps nothing:
either the user knows the usage, and can see what is wrong by
the error message, or he should look up the man page.
Should we use "git clone" or "git-clone" in the usage message?
Or perhaps
 usage: git clone ...
 For more details, see 'man git-clone'
?

 git-clone.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

applies-to: 62fad3f1275b9bbf07fba50c328a3bd730c3454c
3de065bff303bd4caa433dfa685fdc1164be2b81
diff --git a/git-clone.sh b/git-clone.sh
index f99e0ad..c09979a 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -9,7 +9,7 @@
 unset CDPATH
 
 usage() {
-	echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> <dir>"
+	echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> [<dir>]"
 	exit 1
 }
 
@@ -98,7 +98,7 @@ fi
 dir="$2"
 # Try using "humanish" part of source repo if user didn't specify one
 [ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*/||g')
-[ -e "$dir" ] && $(echo "$dir already exists."; usage)
+[ -e "$dir" ] && echo "$dir already exists." && usage
 mkdir -p "$dir" &&
 D=$(
 	(cd "$dir" && git-init-db && pwd)
---
0.99.9.GIT

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-14 21:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-13 14:03 [PATCH] Bugfix: stop if directory already exists Josef Weidendorfer
2005-11-14  8:57 ` Junio C Hamano
2005-11-14  9:28   ` Andreas Ericsson
2005-11-14 10:36     ` Josef Weidendorfer
2005-11-14 10:47       ` Andreas Ericsson
2005-11-14 21:30     ` Junio C Hamano
2005-11-14  9:29   ` Josef Weidendorfer
2005-11-14  9:37     ` Andreas Ericsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).