@@ -18,7 +18,13 @@ check_checkpatch() {
1818 git --no-pager show --format=" %h %s" " $commit " --name-only
1919 # Skip empty commits, assume cover letter
2020 # and those only touching non-upstream directories .github ci and docs
21- local files=$( git diff --diff-filter=ACMR --name-only $commit ~..$commit | grep -v ^ci | grep -v ^.github | grep -v ^docs || true)
21+ # A treeless (--filter=tree:0) fetch could be done to fetch
22+ # full commit message history before running checkpatch, but
23+ # that may mess-up the cache and is only useful for checking
24+ # SHA references in the commit message, with may not even apply
25+ # if the commit is from upstream. Instead, just delegate to the
26+ # user to double check the referenced SHA.
27+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $commit ~..$commit | grep -v ^ci | grep -v ^.github | grep -v ^docs || true)
2228 if [[ -z " $files " ]]; then
2329 echo " empty, skipped"
2430 continue
@@ -114,7 +120,7 @@ check_checkpatch() {
114120}
115121
116122check_dt_binding_check () {
117- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
123+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
118124 local fail=0
119125
120126 echo " dt_binding_check on range $base_sha ..$head_sha "
@@ -164,7 +170,7 @@ check_dt_binding_check() {
164170}
165171
166172check_coccicheck () {
167- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
173+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
168174 local mail=
169175 local warn=0
170176
@@ -241,7 +247,7 @@ check_coccicheck() {
241247}
242248
243249check_cppcheck () {
244- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
250+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
245251 local regex=' ^[[:alnum:]/._-]+:[[:digit:]]+:[[:digit:]]+: .*$'
246252 local mail=
247253 local fail=0
@@ -335,7 +341,7 @@ compile_devicetree() {
335341
336342 echo " compile devicetree on range $base_sha ..$head_sha "
337343
338- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
344+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
339345 local dtsi_files=$( echo " $files " | grep ^arch/$ARCH /boot/dts/ | grep dtsi$ || true)
340346 if [[ ! -z " $dtsi_files " ]]; then
341347 echo " collecting dts files that include dtsi"
@@ -644,7 +650,7 @@ compile_kernel_smatch() {
644650}
645651
646652compile_gcc_fanalyzer () {
647- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
653+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
648654 local regex=' ^[[:alnum:]/._-]+:[[:digit:]]+:[[:digit:]]+: .*$'
649655 local mail=
650656 local fail=0
@@ -731,7 +737,7 @@ compile_gcc_fanalyzer () {
731737}
732738
733739compile_clang_analyzer () {
734- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
740+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
735741 local regex=' ^[[:alnum:]/._-]+:[[:digit:]]+:[[:digit:]]+: .*$'
736742 local mail=
737743 local fail=0
@@ -826,7 +832,7 @@ compile_clang_analyzer () {
826832}
827833
828834assert_compiled () {
829- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
835+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
830836 local fail=0
831837
832838 echo " assert sources were compiled on range $base_sha ..$head_sha "
@@ -865,7 +871,7 @@ apply_prerun() {
865871 # e.g. manipulate the source code depending on run conditons or target.
866872 local coccis=$( ls ci/prerun/* .cocci 2> /dev/null)
867873 local bashes=$( ls ci/prerun/* .sh 2> /dev/null)
868- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
874+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
869875
870876 echo " apply_prerun on range $base_sha ..$head_sha "
871877
@@ -894,13 +900,13 @@ apply_prerun() {
894900}
895901
896902touch_files () {
897- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
903+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
898904
899905 touch $files
900906}
901907
902908auto_set_kconfig () {
903- local files=$( git diff --diff-filter=ACMR --name-only $base_sha ..$head_sha )
909+ local files=$( git diff --diff-filter=ACM --no-renames --name-only $base_sha ..$head_sha )
904910 declare -a o_files
905911
906912 echo " get_kconfig on range $base_sha ..$head_sha "
0 commit comments