From 42e83cb7a3d8d20e0f9bfb07fb1cc170d33abb05 Mon Sep 17 00:00:00 2001 From: Claudius Heine Date: Thu, 12 May 2022 14:12:50 +0200 Subject: [PATCH] repos: add --whitespace=nowarn to git apply command Patches contain tailing white space in empty lines around a change, those are generally expected by git-apply and cause no issue. However in cases where a patch file is added, removed or modified in a patch, that patch would necessarily include `- ` or `+ ` lines, since they operate on patch files. Applying those patches with git-apply will cause git to print out warnings about tailing white spaces per default, but still applies the patch. Those warnings will be picked up by kas, and since they are coming from stderr, print them out as `ERRORS`. To solve this add `--whitespace=nowarn` as a parameter to the git-apply call to silence those warnings. In case of kas, it is to be expected that patches are added, removed or changed in meta layers, so those supposedly errors will cause confusion. Signed-off-by: Claudius Heine Signed-off-by: Jan Kiszka --- kas/repos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kas/repos.py b/kas/repos.py index 448d723..8921bb4 100644 --- a/kas/repos.py +++ b/kas/repos.py @@ -393,7 +393,7 @@ class GitRepo(RepoImpl): format(refspec=self.remove_ref_prefix(self.refspec))] def apply_patches_file_cmd(self, path): - return ['git', 'apply', path] + return ['git', 'apply', '--whitespace=nowarn', path] def set_remote_url_cmd(self): return ['git', 'remote', 'set-url', 'origin', self.effective_url]