From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id B8A7E2BAF; Tue, 5 Sep 2017 00:05:43 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4442720EC0; Mon, 4 Sep 2017 18:05:43 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 04 Sep 2017 18:05:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:date:from:message-id:subject:to:x-me-sender:x-me-sender :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=1zZoc+VXJ+DKd9xIhcmDJQHtefR 13yiexHL3XtRY234=; b=QtW/saUQ51c779sz6pfnzJAvSMkuTgiuPWxz8gfQ1WI Xa1FZMLJocrQJTGPjUgWaMYrEV7MKzG4pfbBvG5b4oTBU9OHo18HNHfOob70vUNc 0YzlTqBBZNTE42BSyiqO2VotFWwluSYcd6xFb3NReqkq8OQUeNcVgwflgNbQmv/4 = DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=1zZoc+ VXJ+DKd9xIhcmDJQHtefR13yiexHL3XtRY234=; b=otUwMGVy/yMoV93f59hGcH FRNBryx/bhsx+bnsVOvhHsrXzOtPL0CJL8uhz2hZDYOe4MsFJBEUUczrOHhKqiDi DFkdmE2BgTwUDrrD5FjZ3vF/2yBJdpfhRh4vLqwYtckypWpAK8VRwcvalX+Grp5M 2pNOeWOT8JUBhMKgT3oz2vrBmTPZXHQozkGvt1yqZk2tG2obmaEGjIgqphgMrBKa 9sweXDNW/qatkjjEy/+dGAtHSGZoXDsy62z4XIcb4LNIiHQIBTdPWOZy1gFeFV/Z kPyBCAt/f2Ze7FoDtdCWfV+lyEUePllUz0I8+N5YGnbsfFKpEIYcr6MqhbuwJDfw == X-ME-Sender: X-Sasl-enc: TDpR5am3joM4XxWvFosgbra/tJbP4oVLrSKLdArMoHo5 1504562742 Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id AA4087E725; Mon, 4 Sep 2017 18:05:42 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org Date: Tue, 5 Sep 2017 00:05:32 +0200 Message-Id: <20170904220532.10175-1-thomas@monjalon.net> X-Mailer: git-send-email 2.14.1 Subject: [dpdk-stable] [PATCH] devtools: fix version search with git < 2.7.0 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, 04 Sep 2017 22:05:43 -0000 The script git-log-fixes.sh (used in check-git-log.sh) looks for git tags to find the version where a bug is introduced. In DPDK 17.08, the script has been fixed to ignore tags from non current branch. It was using the option --merged which was introduced in git 2.7.0. As git 2.7.0 is not so old, a fallback is provided for some years. The fallback is replacing the tag --merged option by a branch filter. If the tag is found in the branch, the branch name is replaced by the tag. This script could be improved to allow using another reference branch, instead of hard coding HEAD branch (the current one). Fixes: 26857dabb3c9 ("devtools: ignore non merged tags for backport") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- devtools/git-log-fixes.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/devtools/git-log-fixes.sh b/devtools/git-log-fixes.sh index 580068741..cd5cf8939 100755 --- a/devtools/git-log-fixes.sh +++ b/devtools/git-log-fixes.sh @@ -66,7 +66,16 @@ range="$*" # get major release version of a commit commit_version () # { - tag=$(git tag -l --contains $1 --merged | head -n1) + # use current branch as history reference + local refbranch=$(git rev-parse --abbrev-ref HEAD) + local tag=$( (git tag -l --contains $1 --merged $refbranch 2>&- || + # tag --merged option has been introduced in git 2.7.0 + # below is a fallback in case of old git version + for t in $(git tag -l --contains $1) ; do + git branch $refbranch --contains $t | + sed "s,.\+,$t," + done) | + head -n1) if [ -z "$tag" ] ; then # before -rc1 tag of release in progress make showversion | cut -d'.' -f-2 -- 2.14.1