[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/8] checkpatch: consider git extended headers valid
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 6/8] checkpatch: consider git extended headers valid patches |
Date: |
Mon, 18 Jul 2016 17:59:19 +0100 |
Renames look like this with git-diff(1) when diff.renames = true is set:
diff --git a/a b/b
similarity index 100%
rename from a
rename to b
This raises the "Does not appear to be a unified-diff format patch"
error because checkpatch.pl only considers a diff valid if it contains
at least one "@@" hunk.
This patch accepts renames and copies too so that checkpatch.pl exits
successfully when a diff only renames/copies files. The git diff
extended header format is described on the git-diff(1) man page.
Reported-by: Colin Lord <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
scripts/checkpatch.pl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index cf32c8f..afa7f79 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1279,6 +1279,11 @@ sub process {
}
}
+# Accept git diff extended headers as valid patches
+ if ($line =~ /^(?:rename|copy) (?:from|to) [\w\/\.\-]+\s*$/) {
+ $is_patch = 1;
+ }
+
#check the patch for a signoff:
if ($line =~ /^\s*signed-off-by:/i) {
# This is a signoff, if ugly, so do not double report.
--
2.7.4
- [Qemu-devel] [PULL 0/8] Block patches, Stefan Hajnoczi, 2016/07/18
- [Qemu-devel] [PULL 1/8] spec/parallels: fix a mistake, Stefan Hajnoczi, 2016/07/18
- [Qemu-devel] [PULL 2/8] linux-aio: share one LinuxAioState within an AioContext, Stefan Hajnoczi, 2016/07/18
- [Qemu-devel] [PULL 3/8] aio_ctx_check: follow CODING_STYLE, Stefan Hajnoczi, 2016/07/18
- [Qemu-devel] [PULL 4/8] linux-aio: prevent submitting more than MAX_EVENTS, Stefan Hajnoczi, 2016/07/18
- [Qemu-devel] [PULL 5/8] aio-posix: remove useless parameter, Stefan Hajnoczi, 2016/07/18
- [Qemu-devel] [PULL 7/8] virtio-blk: dataplane cleanup, Stefan Hajnoczi, 2016/07/18
- [Qemu-devel] [PULL 6/8] checkpatch: consider git extended headers valid patches,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 8/8] MAINTAINERS: Add include/block/aio.h to block I/O path section, Stefan Hajnoczi, 2016/07/18
- Re: [Qemu-devel] [PULL 0/8] Block patches, Peter Maydell, 2016/07/19