X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=tg.sh;h=68967218640e519141c526b0ac49b8c0ad83377d;hb=14561a783f2bbf3dc21cdbdfe06296285c4f4052;hp=ae3dcda6446709183cf2f1032777f41655149a57;hpb=308892d0c071135031994606170c8be6653e7197;p=topgit.git diff --git a/tg.sh b/tg.sh index ae3dcda..6896721 100644 --- a/tg.sh +++ b/tg.sh @@ -76,7 +76,7 @@ measure_branch() # Whether B1 is a superset of B2. branch_contains() { - [ "$(git rev-list ^"$1" "$2" | wc -l)" -eq 0 ] + [ -z "$(git rev-list ^"$1" "$2")" ] } # needs_update NAME [BRANCHPATH...] @@ -112,6 +112,12 @@ needs_update() } || : # $1 is not tracked by TopGit anymore } +# branch_empty NAME +branch_empty() +{ + [ -z "$(git diff-tree "refs/top-bases/$1" "$1" | fgrep -v " .top")" ] +} + # switch_to_base NAME [SEED] switch_to_base() { @@ -148,7 +154,7 @@ shift case "$cmd" in help) - echo "TopGit - A different patch queue manager" + echo "TopGit v0.1 - A different patch queue manager" echo "Usage: tg (create|delete|info|patch|summary|update|help) ..." exit 1;; create|delete|info|patch|summary|update)