X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=devtools%2Fgit-log-fixes.sh;h=6d468d67314786518bd524bf14ce76ad670f1ad9;hb=4c4f83944683eca973d5fc5df76cd6199a090e5f;hp=5800687419c881eae36c119163f9847c662c6dba;hpb=26857dabb3c91031beb2faab6237969951341a30;p=dpdk.git diff --git a/devtools/git-log-fixes.sh b/devtools/git-log-fixes.sh index 5800687419..6d468d6731 100755 --- a/devtools/git-log-fixes.sh +++ b/devtools/git-log-fixes.sh @@ -1,34 +1,6 @@ #! /bin/sh -e - -# BSD LICENSE -# +# SPDX-License-Identifier: BSD-3-Clause # Copyright 2016 6WIND S.A. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of 6WIND S.A. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. print_usage () { @@ -66,7 +38,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 @@ -113,11 +94,23 @@ stable_tag () # fi } +# print a marker for fixes tag presence +fixes_tag () # +{ + if git log --format='%b' -1 $1 | grep -qi '^Fixes: *' ; then + echo 'F' + else + echo '-' + fi +} + git log --oneline --reverse $range | while read id headline ; do origins=$(origin_filter $id) stable=$(stable_tag $id) - [ "$stable" = "S" ] || [ -n "$origins" ] || echo "$headline" | grep -q fix || continue + fixes=$(fixes_tag $id) + [ "$stable" = "S" ] || [ "$fixes" = "F" ] || [ -n "$origins" ] || \ + echo "$headline" | grep -q fix || continue version=$(commit_version $id) if [ -n "$origins" ] ; then origver="$(origin_version $origins)" @@ -127,5 +120,5 @@ while read id headline ; do else origver='N/A' fi - printf '%s %7s %s %s (%s)\n' $version $id $stable "$headline" "$origver" + printf '%s %7s %s %s %s (%s)\n' $version $id $stable $fixes "$headline" "$origver" done