chiark
/
gitweb
/
~ian
/
topgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
README: Reword randomly
[topgit.git]
/
tg.sh
diff --git
a/tg.sh
b/tg.sh
index ae3dcda6446709183cf2f1032777f41655149a57..56c5709f1d8f319e7d356d1b0fe9f0880cf98fed 100644
(file)
--- a/
tg.sh
+++ b/
tg.sh
@@
-76,7
+76,7
@@
measure_branch()
# Whether B1 is a superset of B2.
branch_contains()
{
# 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...]
}
# needs_update NAME [BRANCHPATH...]
@@
-112,6
+112,12
@@
needs_update()
} || : # $1 is not tracked by TopGit anymore
}
} || : # $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()
{
# switch_to_base NAME [SEED]
switch_to_base()
{