qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] gitlab: minor fixes for checkpatch CI job
@ 2020-10-19 14:35 Daniel P. Berrangé
  2020-10-19 14:35 ` [PATCH 1/2] gitlab: skip checkpatch.pl checks if no commit delta on branch Daniel P. Berrangé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2020-10-19 14:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Thomas Huth, Philippe Mathieu-Daudé,
	Daniel P. Berrangé,
	Wainer dos Santos Moschetta

This fixes a bogus error when pushing a branch whose content has no
delta against upstream git master.

Daniel P. Berrangé (2):
  gitlab: skip checkpatch.pl checks if no commit delta on branch
  scripts: fix error from checkpatch.pl when no commits are found

 .gitlab-ci.d/check-patch.py | 8 ++++++++
 scripts/checkpatch.pl       | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.26.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] gitlab: skip checkpatch.pl checks if no commit delta on branch
  2020-10-19 14:35 [PATCH 0/2] gitlab: minor fixes for checkpatch CI job Daniel P. Berrangé
@ 2020-10-19 14:35 ` Daniel P. Berrangé
  2020-10-19 14:35 ` [PATCH 2/2] scripts: fix error from checkpatch.pl when no commits are found Daniel P. Berrangé
  2020-10-21 12:32 ` [PATCH 0/2] gitlab: minor fixes for checkpatch CI job Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2020-10-19 14:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Thomas Huth, Philippe Mathieu-Daudé,
	Daniel P. Berrangé,
	Wainer dos Santos Moschetta

If the current branch is synced to the current upstream git master,
there are no commits that need checking. This causes checkpatch.pl
to print an error that it found no commits. We need to avoid calling
checkpatch.pl in this case.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 .gitlab-ci.d/check-patch.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.gitlab-ci.d/check-patch.py b/.gitlab-ci.d/check-patch.py
index 5a14a25b13..0ff30ee077 100755
--- a/.gitlab-ci.d/check-patch.py
+++ b/.gitlab-ci.d/check-patch.py
@@ -33,8 +33,16 @@ ancestor = subprocess.check_output(["git", "merge-base",
 
 ancestor = ancestor.strip()
 
+log = subprocess.check_output(["git", "log", "--format=%H %s",
+                               ancestor + "..."],
+                              universal_newlines=True)
+
 subprocess.check_call(["git", "remote", "rm", "check-patch"])
 
+if log == "":
+    print("\nNo commits since %s, skipping checks\n" % ancestor)
+    sys.exit(0)
+
 errors = False
 
 print("\nChecking all commits since %s...\n" % ancestor)
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] scripts: fix error from checkpatch.pl when no commits are found
  2020-10-19 14:35 [PATCH 0/2] gitlab: minor fixes for checkpatch CI job Daniel P. Berrangé
  2020-10-19 14:35 ` [PATCH 1/2] gitlab: skip checkpatch.pl checks if no commit delta on branch Daniel P. Berrangé
@ 2020-10-19 14:35 ` Daniel P. Berrangé
  2020-10-21 12:32 ` [PATCH 0/2] gitlab: minor fixes for checkpatch CI job Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2020-10-19 14:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Thomas Huth, Philippe Mathieu-Daudé,
	Daniel P. Berrangé,
	Wainer dos Santos Moschetta

The error message was supposed to mention the input revision list start
point, not the branch flag.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 6ed34970f9..88c858f67c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -392,7 +392,7 @@ if ($chk_branch) {
 
 	close $HASH;
 
-	die "$P: no revisions returned for revlist '$chk_branch'\n"
+	die "$P: no revisions returned for revlist '$ARGV[0]'\n"
 	    unless @patches;
 
 	my $i = 1;
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] gitlab: minor fixes for checkpatch CI job
  2020-10-19 14:35 [PATCH 0/2] gitlab: minor fixes for checkpatch CI job Daniel P. Berrangé
  2020-10-19 14:35 ` [PATCH 1/2] gitlab: skip checkpatch.pl checks if no commit delta on branch Daniel P. Berrangé
  2020-10-19 14:35 ` [PATCH 2/2] scripts: fix error from checkpatch.pl when no commits are found Daniel P. Berrangé
@ 2020-10-21 12:32 ` Alex Bennée
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2020-10-21 12:32 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Thomas Huth, Philippe Mathieu-Daudé,
	qemu-devel, Wainer dos Santos Moschetta


Daniel P. Berrangé <berrange@redhat.com> writes:

> This fixes a bogus error when pushing a branch whose content has no
> delta against upstream git master.

Queued to testing/next, thanks.

>
> Daniel P. Berrangé (2):
>   gitlab: skip checkpatch.pl checks if no commit delta on branch
>   scripts: fix error from checkpatch.pl when no commits are found
>
>  .gitlab-ci.d/check-patch.py | 8 ++++++++
>  scripts/checkpatch.pl       | 2 +-
>  2 files changed, 9 insertions(+), 1 deletion(-)


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-21 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 14:35 [PATCH 0/2] gitlab: minor fixes for checkpatch CI job Daniel P. Berrangé
2020-10-19 14:35 ` [PATCH 1/2] gitlab: skip checkpatch.pl checks if no commit delta on branch Daniel P. Berrangé
2020-10-19 14:35 ` [PATCH 2/2] scripts: fix error from checkpatch.pl when no commits are found Daniel P. Berrangé
2020-10-21 12:32 ` [PATCH 0/2] gitlab: minor fixes for checkpatch CI job Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).