Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override commit.gpgsign when creating patch-file #456

Open
FibreFoX opened this issue Feb 21, 2023 · 0 comments · May be fixed by #508
Open

Override commit.gpgsign when creating patch-file #456

FibreFoX opened this issue Feb 21, 2023 · 0 comments · May be fixed by #508

Comments

@FibreFoX
Copy link

I have a local setup, where my global git-settings contains the following setting:

[commit]
  gpgsign = true

This creates a problem while creating a patch-file, which fails because there is no git-key configured (I manage these on local repository level ... yes I am weird, but this forces me to sign my commits properly).

I've created a patch-file for this (haha), which explicitly overrides that setting:

diff --git a/node_modules/patch-package/dist/makePatch.js b/node_modules/patch-package/dist/makePatch.js
index a76e39c..86dce12 100644
--- a/node_modules/patch-package/dist/makePatch.js
+++ b/node_modules/patch-package/dist/makePatch.js
@@ -117,6 +117,8 @@ function makePatch({ packagePathSpecifier, appPath, packageManager, includePaths
         git("init");
         git("config", "--local", "user.name", "patch-package");
         git("config", "--local", "user.email", "[email protected]");
+        // do not sign this temporary commit
+        git("config", "--local", "commit.gpgsign", "false");
         // remove ignored files first
         filterFiles_1.removeIgnoredFiles(tmpRepoPackagePath, includePaths, excludePaths);
         git("add", "-f", packageDetails.path);

Would you prefer a pull-request for this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant