Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp413559pxj; Wed, 2 Jun 2021 02:16:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtEdaNl91R1t3j/8yxcCQFBUJ/l3y6sSz7ZRRCTfrgrV/0fHsvJfhBesr9Dl0JVsBrCfXo X-Received: by 2002:a17:906:36d4:: with SMTP id b20mr33521277ejc.44.1622625410340; Wed, 02 Jun 2021 02:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622625410; cv=none; d=google.com; s=arc-20160816; b=ahrciW8u0iT7djoOr6x7HkiC5niGCReR+yzn1P1hRKaGlrbjecpOj2oWXNksNKBIZL amveUqKfkeeEdk70Djt2+XfAu6skIfQ9fL2uJ4IDbpxUZ/HmFMSaZoXvZs9oU85Aw80+ aGCbCkMXJ0l7ZVje03pvcb9krIsR33z2j/mPCt5TLe+NGO33LnCToP0BwqdaGqRP0QQq TMa3nk8XKi9hxw9awgLQ5pxRhj2RbwYMvPGv3erB87uVwAFco/USMEiY5ZBFzwHrsR5B VA6JiAQoCgVNHHzKYIf1LxYAiagU5ix48fxIWJE2qek6X1odaNsnL9dBAlgTOKrbCCbM +KBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=05Fgq52dKVdEKI1fvQffD3mtzrY8PhVbzseAckmChrE=; b=OQh5RulH99OihS2VB7gkagUXpRQmiWtNhyElPQ20ZRIS9shY31W/zqzLM1IGITe/UF atvhJ3z7KINp0/NLgufXt2WzuRGyk99nuQMprq8nPEnPBcKBHuA3SmcivRgn+h8FSg23 0fRq3B9lTAaItBxTnbw2Jj2MWwD5Qc5k6tH/dItrUmNUa4L8vJFcBud371lMNVWotIU+ LRSH4laeUd7H587jn6089oQws2iK8KJmNtOaGX4fw1g0P6v3C/rzrZCbwtJqSqwO2uB6 6YLPgqpTGTA1WgyUIXMXX5WqCJvrqg6HiM/YNKzE7H+jXJJPdGyrNhbTaajSeaW5bTRB H1gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=EuOcZO8h; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si3736662ejd.137.2021.06.02.02.16.26; Wed, 02 Jun 2021 02:16:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=EuOcZO8h; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232201AbhFBHtg (ORCPT + 99 others); Wed, 2 Jun 2021 03:49:36 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:46264 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232282AbhFBHtb (ORCPT ); Wed, 2 Jun 2021 03:49:31 -0400 Received: from relay2.suse.de (unknown [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3A8CE1FD32; Wed, 2 Jun 2021 07:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622620068; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=05Fgq52dKVdEKI1fvQffD3mtzrY8PhVbzseAckmChrE=; b=EuOcZO8h2enDYK9iz/1rKTpE+T3wdoPpSkKaXk/BTjzN8soAXnDcCp/5alYnkTT8lxJiq6 j5p4IRcNQaeUfvdSqQNoRRa60pO4A+8abBtAl/lnGIbVK1cAkB04iUIAIlZgV8pq9oazTl EfqWbCpWqsXWWzPA7zHnLd5DbZFACk0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622620068; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=05Fgq52dKVdEKI1fvQffD3mtzrY8PhVbzseAckmChrE=; b=G43ESwXgZJR1CZvLX+cJQxXN2ko9PHTu94KhFiWy+FuK5zaonvmExCnr5Ldz7LVxBbRZf+ YG3/E2faUQ5cSNAw== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 32B97A3B81; Wed, 2 Jun 2021 07:47:48 +0000 (UTC) Date: Wed, 02 Jun 2021 09:47:48 +0200 Message-ID: From: Takashi Iwai To: Dongliang Mu Cc: Takashi Iwai , Stephen Rothwell , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: Fixes tag needs some work in the sound-current tree In-Reply-To: References: <20210602170946.37a2c6ec@canb.auug.org.au> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Wed_Jun__2_09:47:48_2021-1" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Multipart_Wed_Jun__2_09:47:48_2021-1 Content-Type: text/plain; charset=US-ASCII On Wed, 02 Jun 2021 09:42:15 +0200, Dongliang Mu wrote: > > On Wed, Jun 2, 2021 at 3:36 PM Takashi Iwai wrote: > > > > On Wed, 02 Jun 2021 09:09:46 +0200, > > Stephen Rothwell wrote: > > > > > > Hi all, > > > > > > In commit > > > > > > b3531c648d87 ("ALSA: control led: fix memory leak in snd_ctl_led_register") > > > > > > Fixes tag > > > > > > Fixes: a135dfb5de1 ("ALSA: led control - add sysfs kcontrol LED marking layer") > > > > > > has these problem(s): > > > > > > - SHA1 should be at least 12 digits long > > > > > > This is probably not worth rebasing to fix, but can be avoided in the > > > future by setting core.abbrev to 12 (or more) or (for git v2.11 or later) > > > just making sure it is not set (or set to "auto"). > > > > My bad, I must have overlooked the warning at applying. > > Hi Takashi, > > I don't know why checkpatch.pl does not capture this warning for me. > > ./scripts/checkpatch.pl > 0001-ALSA-control-led-fix-memory-leak-in-snd_ctl_led_regi.patch > total: 0 errors, 0 warnings, 89 lines checked > > 0001-ALSA-control-led-fix-memory-leak-in-snd_ctl_led_regi.patch has no > obvious style problems and is ready for submission. > > Any idea? checkpatch doesn't check it strictly, IIRC. I'm using a script Stephen posted some time ago. This should be better covered generically in checkpatch, though... Takashi --Multipart_Wed_Jun__2_09:47:48_2021-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="git-check-fixes" Content-Transfer-Encoding: 7bit #!/bin/bash if [ "$#" -lt 1 ]; then printf 'Usage: %s \n', "$0" 1>&2 exit 1 fi commits=$(git rev-list --no-merges -i --grep='^[[:space:]]*Fixes:' "$@") if [ -z "$commits" ]; then exit 0 fi # This should be a git tree that contains *only* Linus' tree Linus_tree="${HOME}/kernels/linus.git" split_re='^([Cc][Oo][Mm][Mm][Ii][Tt])?[[:space:]]*([[:xdigit:]]{5,})([[:space:]]*)(.*)$' nl=$'\n' tab=$'\t' # Strip the leading and training spaces from a string strip_spaces() { [[ "$1" =~ ^[[:space:]]*(.*[^[:space:]])[[:space:]]*$ ]] echo "${BASH_REMATCH[1]}" } for c in $commits; do commit_log=$(git log -1 --format='%h ("%s")' "$c") commit_msg="In commit $commit_log " fixes_lines=$(git log -1 --format='%B' "$c" | grep -i '^[[:space:]]*Fixes:') while read -r fline; do [[ "$fline" =~ ^[[:space:]]*[Ff][Ii][Xx][Ee][Ss]:[[:space:]]*(.*)$ ]] f="${BASH_REMATCH[1]}" fixes_msg="Fixes tag $fline has these problem(s): " sha= subject= msg= if [[ "$f" =~ $split_re ]]; then first="${BASH_REMATCH[1]}" sha="${BASH_REMATCH[2]}" spaces="${BASH_REMATCH[3]}" subject="${BASH_REMATCH[4]}" if [ "$first" ]; then msg="${msg:+${msg}${nl}} - leading word '$first' unexpected" fi if [ -z "$subject" ]; then msg="${msg:+${msg}${nl}} - missing subject" elif [ -z "$spaces" ]; then msg="${msg:+${msg}${nl}} - missing space between the SHA1 and the subject" fi else printf '%s%s - %s\n' "$commit_msg" "$fixes_msg" 'No SHA1 recognised' commit_msg='' continue fi if ! git rev-parse -q --verify "$sha" >/dev/null; then printf '%s%s - %s\n' "$commit_msg" "$fixes_msg" 'Target SHA1 does not exist' commit_msg='' continue fi if [ "${#sha}" -lt 12 ]; then msg="${msg:+${msg}${nl}} - SHA1 should be at least 12 digits long${nl} Can be fixed by setting core.abbrev to 12 (or more) or (for git v2.11${nl} or later) just making sure it is not set (or set to \"auto\")." fi # reduce the subject to the part between () if there if [[ "$subject" =~ ^\((.*)\) ]]; then subject="${BASH_REMATCH[1]}" elif [[ "$subject" =~ ^\((.*) ]]; then subject="${BASH_REMATCH[1]}" msg="${msg:+${msg}${nl}} - Subject has leading but no trailing parentheses" fi # strip matching quotes at the start and end of the subject # the unicode characters in the classes are # U+201C LEFT DOUBLE QUOTATION MARK # U+201D RIGHT DOUBLE QUOTATION MARK # U+2018 LEFT SINGLE QUOTATION MARK # U+2019 RIGHT SINGLE QUOTATION MARK re1=$'^[\"\u201C](.*)[\"\u201D]$' re2=$'^[\'\u2018](.*)[\'\u2019]$' re3=$'^[\"\'\u201C\u2018](.*)$' if [[ "$subject" =~ $re1 ]]; then subject="${BASH_REMATCH[1]}" elif [[ "$subject" =~ $re2 ]]; then subject="${BASH_REMATCH[1]}" elif [[ "$subject" =~ $re3 ]]; then subject="${BASH_REMATCH[1]}" msg="${msg:+${msg}${nl}} - Subject has leading but no trailing quotes" fi subject=$(strip_spaces "$subject") target_subject=$(git log -1 --format='%s' "$sha") target_subject=$(strip_spaces "$target_subject") # match with ellipses case "$subject" in *...) subject="${subject%...}" target_subject="${target_subject:0:${#subject}}" ;; ...*) subject="${subject#...}" target_subject="${target_subject: -${#subject}}" ;; *\ ...\ *) s1="${subject% ... *}" s2="${subject#* ... }" subject="$s1 $s2" t1="${target_subject:0:${#s1}}" t2="${target_subject: -${#s2}}" target_subject="$t1 $t2" ;; esac subject=$(strip_spaces "$subject") target_subject=$(strip_spaces "$target_subject") if [ "$subject" != "${target_subject:0:${#subject}}" ]; then msg="${msg:+${msg}${nl}} - Subject does not match target commit subject${nl} Just use${nl}${tab}git log -1 --format='Fixes: %h ("%s")'" fi lsha=$(cd "$Linus_tree" && git rev-parse -q --verify "$sha") if [ -z "$lsha" ]; then count=$(git rev-list --count "$sha".."$c") if [ "$count" -eq 0 ]; then msg="${msg:+${msg}${nl}} - Target is not an ancestor of this commit" fi fi if [ "$msg" ]; then printf '%s%s%s\n' "$commit_msg" "$fixes_msg" "$msg" commit_msg='' fi done <<< "$fixes_lines" done exit 0 --Multipart_Wed_Jun__2_09:47:48_2021-1--