From 2259164bf0ed1dcbcc6dec60a0b3977affbc7921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= Date: Thu, 28 Dec 2023 05:39:27 +0100 Subject: [PATCH] extractPatchset: add git config core.abbrev=auto to format-patch call (#280) This makes sure that the patch output is consistent, even if users use different values for that option. `haikuporter -e` is called by developers and its output ends up in the haikuports repository, so it should be as consistent as possible to avoid unnecessary noise. Other commands either don't produce any visible output or are run on the buildmaster systems where there is a defined environment, so it isn't necessary to define the git config explicitly. If there are other options which influence the output of `format-patch`, they should also be set explicitly. --- HaikuPorter/Source.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HaikuPorter/Source.py b/HaikuPorter/Source.py index 72113942..c31a7a03 100644 --- a/HaikuPorter/Source.py +++ b/HaikuPorter/Source.py @@ -433,9 +433,9 @@ def extractPatchset(self, patchSetFilePath, archPatchSetFilePath): if not os.path.exists(patchSetDirectory): os.mkdir(patchSetDirectory) with open(patchSetFilePath, 'w') as patchSetFile: - check_call(['git', 'format-patch', '-kp', '--stdout', 'ORIGIN'], - stdout=patchSetFile, cwd=self.sourceDir, - env=self.gitEnv) + check_call(['git', '-c', 'core.abbrev=auto', 'format-patch', '-kp', + '--stdout', 'ORIGIN'], stdout=patchSetFile, + cwd=self.sourceDir, env=self.gitEnv) if needToRebase: # put PATCH_FUNCTION back in