From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by dpdk.org (Postfix) with ESMTP id 5FD515592 for ; Mon, 17 Sep 2018 20:07:41 +0200 (CEST) Received: by mail-wm1-f50.google.com with SMTP id y139-v6so10631336wmc.2 for ; Mon, 17 Sep 2018 11:07:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ypqMkjPGCsgR6gw+gjR0FgjUU3mKMdnCMU/dosUzaxI=; b=JycLhWiXf4GgORq0H30meF2pn0keaKouMjs7kqUV1xI9N903qUrWktNv5T1di1EBrn zpc8FgbT1l43gwJSPVgNqZuEtwwEs69O7GIAmmJHqZjVp8cHR9uKD+raYRCUlUv27KBB xO9QiVq9rIFsItVluEQCwKIx8bw6P/q7ei6Zo4WMPE1pFwTRVNh9ZxLtj/ciKOu7le4e 9s9fTINCP0wAy99AWM2YwsWgf2Pfq2cr3ebozHmOcKmIW9+ALYrONCh7ziUwL46LRGPN 8ZUvCOZ8jXE/jlhLL5XOXUbBvRhZ03H0NW521kx6gwLa9tlj1PStvYLvfmfn4QXGcxNo 75kA== X-Gm-Message-State: APzg51AqwuNEGl+ZCIwX+8XdyuqiTh2SGOFDq3tDFnA0esXCMWtgI45y COIMPFpab9yp9zDSv9PzYzpufp8v X-Google-Smtp-Source: ANB0VdbIWbYnFnyj1huwUkFoSI+JJPnElz+2M5etFOK0AhavgSvfaNBImpXz7SfnkgxC+y+2Sn13Jw== X-Received: by 2002:a1c:3a08:: with SMTP id h8-v6mr11738413wma.126.1537207660503; Mon, 17 Sep 2018 11:07:40 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id f6-v6sm12099398wrr.68.2018.09.17.11.07.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Sep 2018 11:07:39 -0700 (PDT) From: Luca Boccassi To: stable@dpdk.org Cc: christian.ehrhardt@canonical.com, yskoh@mellanox.com, ktraynor@redhat.com, Luca Boccassi Date: Mon, 17 Sep 2018 19:07:27 +0100 Message-Id: <20180917180727.21974-1-bluca@debian.org> X-Mailer: git-send-email 2.18.0 Subject: [dpdk-stable] [RFC stable-scripts] 1-import: don't filter commits for later releases that fix backported patches X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 18:07:41 -0000 A patch might fix a commit in a later release and so it is skipped. But that commit might have been backported in the past, so skipping the patch is wrong. Rework the list pruning to take this case into account. Signed-off-by: Luca Boccassi --- Tested and seems to be working fine. Slows down by a few seconds the runtime, but it's bearable and I'm sure it can be optimised, but it's a starting point. More testing would be very welcome. 1-import | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/1-import b/1-import index 05dfdf0..9f03c53 100755 --- a/1-import +++ b/1-import @@ -28,18 +28,35 @@ import_one_commit() if [ "$PRUNE_COMMITS" = "yes" ] then get_stable_release - # need to update it in 2021! - for _major in {16..20} + tmp_list=$PWD/$stable_release/tmp_list + rm -f $tmp_list + + pushd $STABLE_DIR &>/dev/null + log=$($GIT log v${RTE_VER_MAJOR}..v$last_release) + while read line do - for _minor in {02..11..3} - do - if verlte $stable_release $_major.$_minor - then - sed -i "/($_major.$_minor (partially.*\$/d" $commit_list - sed -i "/($_major.$_minor)\$/d" $commit_list - fi - done - done + # Get the id of the commit being fixed, for the first check + id=$(echo $line | awk '{print $2}') + fixes=$($GIT log --format='%b' -1 $id | sed -n 's,^ *\([Ff]ixes\|[Rr]everts\): *\([0-9a-f]*\).*,\2,p') + + # Was stable CC'ed without a Fixes line? If so select it just in case + if echo $line | grep -q "(N/A)" + then + echo $line >> $tmp_list + # Is the patch fixing a commit that was part of this stable release? + # If so select it + elif verlte `echo $line | sed "s/.*(\([0-9][0-9].[0-9][0-9]\).*)/\1/"` $stable_release + then + echo $line >> $tmp_list + # Was the commit (which might be only in a subsequent release) + # that the patch "fixes" backported? If so select it + elif test -n fixes && echo $log | grep -q -e "backported from commit $fixes" -e "upstream commit $fixes" + then + echo $line >> $tmp_list + fi + done < $commit_list + popd &>/dev/null + mv $tmp_list $commit_list fi if [ "$GIT_AM_PAUSE_ON_FAIL" = "yes" ] -- 2.18.0