[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/12] checkpatch: consider git extended headers vali
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 06/12] checkpatch: consider git extended headers valid patches |
Date: |
Tue, 19 Jul 2016 10:34:13 +0200 |
From: Stefan Hajnoczi <address@hidden>
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>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <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 05/12] megasas: remove useless check for cmd->frame, (continued)
- [Qemu-devel] [PULL 05/12] megasas: remove useless check for cmd->frame, Paolo Bonzini, 2016/07/19
- [Qemu-devel] [PULL 03/12] hw/i386: add device tree support, Paolo Bonzini, 2016/07/19
- [Qemu-devel] [PULL 04/12] compiler: never omit assertions if using a static analysis tool, Paolo Bonzini, 2016/07/19
- [Qemu-devel] [PULL 08/12] cpu-exec: Move down some declarations in cpu_exec(), Paolo Bonzini, 2016/07/19
- [Qemu-devel] [PULL 07/12] exec: avoid realloc in phys_map_node_reserve, Paolo Bonzini, 2016/07/19
- [Qemu-devel] [PULL 10/12] block/iscsi: fix rounding in iscsi_allocationmap_set, Paolo Bonzini, 2016/07/19
- [Qemu-devel] [PULL 09/12] Move README to markdown, Paolo Bonzini, 2016/07/19
- [Qemu-devel] [PULL 06/12] checkpatch: consider git extended headers valid patches,
Paolo Bonzini <=
- [Qemu-devel] [PULL 12/12] target-i386: Remove redundant HF_SOFTMMU_MASK, Paolo Bonzini, 2016/07/19
- [Qemu-devel] [PULL 11/12] block/iscsi: allow caching of the allocation map, Paolo Bonzini, 2016/07/19
- Re: [Qemu-devel] [PULL v2 00/12] Misc patches for 2.7 hard freeze from 2016-07-18, Peter Maydell, 2016/07/19