[
https://issues.apache.org/jira/browse/HADOOP-11906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14526874#comment-14526874
]
Allen Wittenauer commented on HADOOP-11906:
-------------------------------------------
After doing a bit of playing, two things:
* file tends to output 'diff' on most platforms I've tested on
* git format-patch files show up as ascii text due to the header.
So we might need to use two checks, file and a grep for diff. It's also
worthwhile noting that it's possible to generate a patch that smart-apply-patch
can take but will confuse the hell out of test-patch.sh. For example:
using git diff:
{code}
diff --git a/start-build-env.sh b/start-build-env.sh
old mode 100644
new mode 100755
{code}
start-build-env.sh is not in the changed files list so shellcheck does not get
triggered.
> test-patch.sh should use 'file' command for patch determinism
> -------------------------------------------------------------
>
> Key: HADOOP-11906
> URL: https://issues.apache.org/jira/browse/HADOOP-11906
> Project: Hadoop Common
> Issue Type: Test
> Reporter: Allen Wittenauer
>
> test-patch.sh currently restricts patches to the extension .patch. It might
> be useful to also check if the file command says it is a diff. This would
> allow us to determine if files that end in .txt are actually patches.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)