needs_update() now verifies if the _dep refs exists and adds it
to a $missing_deps list if that's not the case.
echo "Depends: $deps"
depcheck="$(mktemp)"
echo "Depends: $deps"
depcheck="$(mktemp)"
needs_update "$name" >"$depcheck"
needs_update "$name" >"$depcheck"
+if [ -n "$missing_deps" ]; then
+ echo "MISSING: $missing_deps"
+fi
if [ -s "$depcheck" ]; then
echo "Needs update from:"
cat "$depcheck" |
if [ -s "$depcheck" ]; then
echo "Needs update from:"
cat "$depcheck" |
# to the branch (e.g. B_DIRTY B1 B2 NAME), one path per line,
# inner paths first. Innermost name can be ':' if the head is
# not in sync with the base.
# to the branch (e.g. B_DIRTY B1 B2 NAME), one path per line,
# inner paths first. Innermost name can be ':' if the head is
# not in sync with the base.
+# If needs_update() hits missing dependencies, it will append
+# them to space-separated $missing_deps list and skip them.
needs_update()
{
{
git cat-file blob "$1:.topdeps" 2>/dev/null |
while read _dep; do
needs_update()
{
{
git cat-file blob "$1:.topdeps" 2>/dev/null |
while read _dep; do
+ if !git rev-parse --verify "$_dep" >/dev/null 2>&1; then
+ # All hope is lost
+ missing_deps="$missing_deps $_dep"
+ continue
+ fi
+
_dep_is_tgish=1
git rev-parse --verify "refs/top-bases/$_dep" >/dev/null 2>&1 ||
_dep_is_tgish=
_dep_is_tgish=1
git rev-parse --verify "refs/top-bases/$_dep" >/dev/null 2>&1 ||
_dep_is_tgish=