All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	Matteo Croce <mcroce@redhat.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] checkpatch.pl: perform commit ID check from external to git folder
Date: Thu, 11 Jun 2020 15:59:57 +0300	[thread overview]
Message-ID: <20200611125957.1993741-1-leon@kernel.org> (raw)

From: Leon Romanovsky <leonro@mellanox.com>

The execution of scripts/checkpatch.pl in folder outside of git produces
complains about invalid commit ID, despite having valid one.

➜  /tmp /home/leonro/src/kernel/scripts/checkpatch.pl \
	--root=/home/leonro/src/kernel \
	--color=always \
	--summary-file /tmp/0001-RDMA-core-Annotate-CMA-unlock-helper-routine.patch

WARNING: Unknown commit id 'e83f195aa45c', maybe rebased or not pulled?
Fixes: e83f195aa45c ("RDMA/cm: Pull duplicated code into cm_queue_work_unlock()")

/tmp/0001-RDMA-core-Annotate-CMA-unlock-helper-routine.patch total: 0 errors, 1 warnings, 7 lines checked

Fixes: a8dd86bf7462 ("checkpatch.pl: warn on invalid commit id")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index eac40f0abd56..286bc78dc6fc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -966,7 +966,7 @@ sub seed_camelcase_includes {
 sub git_commit_info {
 	my ($commit, $id, $desc) = @_;

-	return ($id, $desc) if ((which("git") eq "") || !(-e ".git"));
+	return ($id, $desc) if ((which("git") eq "") || !(-e "$root/.git"));

 	my $output = `${git_command} log --no-color --format='%H %s' -1 $commit 2>&1`;
 	$output =~ s/^\s*//gm;
--
2.26.2


             reply	other threads:[~2020-06-11 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 12:59 Leon Romanovsky [this message]
2020-06-11 18:22 ` [PATCH] checkpatch.pl: perform commit ID check from external to git folder Joe Perches
2020-06-11 20:08   ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200611125957.1993741-1-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=leonro@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcroce@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.