From: Stephen Rothwell Date: Tue, 28 May 2024 22:21:58 +0000 (+1000) Subject: common.sh: don't duplicate reports of duplicated commits X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=69f4cf9852424c7f4128480b3c30044fca547b1f;p=next-scripts common.sh: don't duplicate reports of duplicated commits --- diff --git a/common.sh b/common.sh index 1f66c13..7406e78 100644 --- a/common.sh +++ b/common.sh @@ -143,10 +143,11 @@ check_dups() name="$1" base="$2" sha="$3" + dlfile="$top_dir/duplicates/linus/$name" if [ "$base" = "HEAD" ]; then dfile="$top_dir/duplicates/next/$name" else - dfile="$top_dir/duplicates/linus/$name" + dfile="$dlfile" fi # if there is anything in this tree, then check for duplicates @@ -157,6 +158,9 @@ check_dups() dups=$(git cherry "$base" "$sha" | sed -n 's/^- //p' | xargs -r -n 1 "$tools_dir"/clog | sort) + if [ "$base" = "HEAD" ] && [ -f "$dlfile" ]; then + dups=$(printf '%s\n' "$dups" | comm -23 - "$dlfile") + fi if [ -z "$dups" ]; then rm -f "$dfile" elif ! [ -f "$dfile" ]; then