From 74e952f9771c8116100451a7eb177c663cf9c43b Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sun, 28 Feb 2010 14:57:41 +0100 Subject: [PATCH] tg-push: Filter out plain SHA1s from being pushed. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise, problems arise when branches depend (via .topdeps) on SHA1s: $ tg push -r tmp t/____longjmp_chk_cleanup_linux_x86_64 fatal: 77c84aeb81808c3109665949448dba59965c391e cannot be resolved to branch. fatal: The remote end hung up unexpectedly Signed-off-by: Thomas Schwinge Signed-off-by: Uwe Kleine-König --- tg-push.sh | 4 ++++ tg.sh | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/tg-push.sh b/tg-push.sh index cd208a0..199d738 100644 --- a/tg-push.sh +++ b/tg-push.sh @@ -53,6 +53,10 @@ push_branch() # if so desired omit non tgish deps $tgish_deps_only && [ -z "$_dep_is_tgish" ] && return 0 + # filter out plain SHA1s. These don't need to be pushed explicitly as + # the patches that depend on the sha1 have it already in their ancestry. + is_sha1 "$_dep" && return 0 + echo "$_dep" >> "$_listfile" [ -z "$_dep_is_tgish" ] || echo "top-bases/$_dep" >> "$_listfile" diff --git a/tg.sh b/tg.sh index 1f6d3da..91c374a 100644 --- a/tg.sh +++ b/tg.sh @@ -126,6 +126,13 @@ branch_annihilated() test "$(git rev-parse "$mb^{tree}")" = "$(git rev-parse "$_name^{tree}")"; } +# is_sha1 REF +# Whether REF is a SHA1 (compared to a symbolic name). +is_sha1() +{ + [ "$(git rev-parse "$1")" = "$1" ] +} + # recurse_deps CMD NAME [BRANCHPATH...] # Recursively eval CMD on all dependencies of NAME. # CMD can refer to $_name for queried branch name, -- 2.11.4.GIT