]> git.ozlabs.org Git - next-scripts/commitdiff
common.sh: don't duplicate reports of duplicated commits
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 28 May 2024 22:21:58 +0000 (08:21 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 28 May 2024 22:22:41 +0000 (08:22 +1000)
common.sh

index 1f66c136f5dc74092c245e8b802ef37d6274e1b7..7406e784bbe786f38ffd57ed062fa786cd187cca 100644 (file)
--- 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