[
https://issues.apache.org/jira/browse/HADOOP-12018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14570415#comment-14570415
]
Akira AJISAKA commented on HADOOP-12018:
----------------------------------------
Two comments:
1. {{has_prefix()}} returns 0 if the input is as follows:
{code}
diff --git
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/resources/images/rm-ha-overview.png
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/resources/images/rm-ha-overview.png
deleted file mode 100644
{code}
The method should return 1 with the input.
2. {{$1}} should be {{$PATCH_FILE}}.
{code}
# Case for git-diff patches
if [[ $(head -1 $1) =~ ^diff\ --git ]]; then
{code}
> smart-apply-patch.sh fails if the patch edits CR+LF files and is created by
> 'git diff --no-prefix'
> --------------------------------------------------------------------------------------------------
>
> Key: HADOOP-12018
> URL: https://issues.apache.org/jira/browse/HADOOP-12018
> Project: Hadoop Common
> Issue Type: Bug
> Components: build
> Reporter: Akira AJISAKA
> Assignee: Kengo Seki
> Priority: Minor
> Attachments: HADOOP-12018.001.patch,
> HADOOP-12018.test-noprefix.patch, HADOOP-12018.test-noprefix.patch
>
>
> If the patch edits a file includes CR+LF and created by "git diff
> --no-prefix", smart-apply-patch.sh fails to patch. smart-apply-patch.sh
> checks if the patch is created by "git diff" or "patch", however, if a patch
> is created by "git diff --no-prefix", smart-apply-patch.sh detects the patch
> is created by "patch" command. That's why
> https://builds.apache.org/job/PreCommit-HADOOP-Build/6800/console fails.
> A workaround is to use "git diff" for creating patch if a file includes CR+LF
> is edited.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)