chiark
/
gitweb
/
~ian
/
topgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update version in tg script to 0.5
[topgit.git]
/
tg-depend.sh
diff --git
a/tg-depend.sh
b/tg-depend.sh
old mode 100644
(file)
new mode 100755
(executable)
index
af78808
..
ff4541c
--- a/
tg-depend.sh
+++ b/
tg-depend.sh
@@
-8,8
+8,16
@@
name=
## Parse options
## Parse options
-subcmd="$1"; shift
-[ "$subcmd" = "add" ] || die "unknown subcommand ($subcmd)"
+subcmd="$1"; shift || :
+case "$subcmd" in
+ -h|"")
+ echo "Usage: tg [...] depend add NAME" >&2
+ exit 1;;
+ add)
+ ;;
+ *)
+ die "unknown subcommand ($subcmd)";;
+esac
while [ -n "$1" ]; do
arg="$1"; shift
while [ -n "$1" ]; do
arg="$1"; shift
@@
-35,7
+43,7
@@
baserev="$(git rev-parse --verify "refs/top-bases/$name" 2>/dev/null)" ||
## Record new dependency
## Record new dependency
-echo "$name" >>
.topdeps
-git add
.topdeps
+echo "$name" >>
"$root_dir/.topdeps"
+git add
-f "$root_dir/.topdeps"
git commit -m"New TopGit dependency: $name"
$tg update
git commit -m"New TopGit dependency: $name"
$tg update