chiark
/
gitweb
/
~ian
/
topgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tg-completion: complete options for `tg summary`
[topgit.git]
/
tg-depend.sh
diff --git
a/tg-depend.sh
b/tg-depend.sh
index af78808805449428ca0db06a2c5076ae116ac6a2..ef5f94ff2919c605f268ff7b12f702b1f63e5e5d 100644
(file)
--- 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,9
@@
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
+
+# vim:noet