Skip to content

Commit 9821512

Browse files
authored
Fix ApplyPatch Mechanism (#362)
This ports #358 Pass option -C0 which ignores the surrounding context of the changes. Also remove ERROR_QUIET flag which makes debugging harder. Signed-off-by: haonanya <[email protected]>
1 parent baf89af commit 9821512

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cmake/modules/CMakeFunctions.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ function(is_backport_patch_present patch_path repo_dir patch_in_branch)
5757
WORKING_DIRECTORY ${repo_dir}
5858
RESULT_VARIABLE patch_not_in_branches
5959
OUTPUT_QUIET
60-
ERROR_QUIET
6160
)
6261
if(patch_not_in_branches)
6362
set(patch_in_branch False PARENT_SCOPE) # The patch is not present in local branch
@@ -74,7 +73,6 @@ function(is_valid_revision repo_dir revision return_val)
7473
COMMAND ${GIT_EXECUTABLE} log -1 ${revision}
7574
WORKING_DIRECTORY ${repo_dir}
7675
RESULT_VARIABLE output_var
77-
ERROR_QUIET
7876
OUTPUT_QUIET
7977
)
8078
if(${output_var} EQUAL 0)
@@ -106,7 +104,6 @@ function(apply_patches repo_dir patches_dir base_revision target_branch ret)
106104
COMMAND ${GIT_EXECUTABLE} rev-parse --verify --no-revs -q ${target_branch}
107105
WORKING_DIRECTORY ${repo_dir}
108106
RESULT_VARIABLE patches_needed
109-
ERROR_QUIET
110107
OUTPUT_QUIET
111108
)
112109
if(patches_needed EQUAL 128) # not a git repo
@@ -121,7 +118,6 @@ function(apply_patches repo_dir patches_dir base_revision target_branch ret)
121118
WORKING_DIRECTORY ${repo_dir}
122119
OUTPUT_VARIABLE repo_head
123120
OUTPUT_STRIP_TRAILING_WHITESPACE
124-
ERROR_QUIET
125121
)
126122
message(STATUS "[OPENCL-CLANG] ref ${base_revision} not exists in repository, using current HEAD:${repo_head}")
127123
set(base_revision ${repo_head})
@@ -141,10 +137,9 @@ function(apply_patches repo_dir patches_dir base_revision target_branch ret)
141137
message(STATUS "[OPENCL-CLANG] Patch ${patch} is already in local branch - ignore patching")
142138
else()
143139
execute_process( # Apply the patch
144-
COMMAND ${GIT_EXECUTABLE} am --3way --ignore-whitespace ${patch}
140+
COMMAND ${GIT_EXECUTABLE} am --3way --ignore-whitespace -C0 ${patch}
145141
WORKING_DIRECTORY ${repo_dir}
146142
OUTPUT_VARIABLE patching_log
147-
ERROR_QUIET
148143
RESULT_VARIABLE ret_apply_patch
149144
)
150145
message(STATUS "[OPENCL-CLANG] Not present - ${patching_log}")
@@ -157,7 +152,6 @@ function(apply_patches repo_dir patches_dir base_revision target_branch ret)
157152
execute_process( # Check it out
158153
COMMAND ${GIT_EXECUTABLE} checkout ${target_branch}
159154
WORKING_DIRECTORY ${repo_dir}
160-
ERROR_QUIET
161155
OUTPUT_QUIET
162156
RESULT_VARIABLE ret_check_out
163157
)

0 commit comments

Comments
 (0)