ds300 / ds300/patch-package

GPG verified commits breaks patch package.

Open
#353 4 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.2k
Forks
325
PR merge metrics
No merged PRs in 30d

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used [patch-package](https://github.com/ds300/patch-package) to patch `patch-package@6.4.7` for the project I'm working on.

I saw that patch-package was broken when the latest commit is a gpg verified commit. This fixes it and to the extent of my knowledge, shouldn't have any negative side effects unless someone is using a very old version of git maybe. I used patch-package to fix patch-package, so that's fun too.

Here is the diff that solved my problem:

```diff
diff --git a/node_modules/patch-package/dist/makePatch.js b/node_modules/patch-package/dist/makePatch.js
index 985589e..4a5f296 100644
--- a/node_modules/patch-package/dist/makePatch.js
+++ b/node_modules/patch-package/dist/makePatch.js
@@ -120,7 +120,7 @@ function makePatch({ packagePathSpecifier, appPath, packageManager, includePaths
// remove ignored files first
filterFiles_1.removeIgnoredFiles(tmpRepoPackagePath, includePaths, excludePaths);
git("add", "-f", packageDetails.path);
- git("commit", "--allow-empty", "-m", "init");
+ git("commit", "--no-gpg-sign", "--allow-empty", "-m", "init");
// replace package with user's version
rimraf_1.sync(tmpRepoPackagePath);
// pnpm installs packages as symlinks, copySync would copy only the symlink
```

This is the error message I was seeing:
```
patch-package 6.4.7
• Creating temporary folder
• Installing @ajsf/core@0.4.0-beta.2 with npm
• Diffing your files with clean files
error: gpg failed to sign the data
fatal: failed to write commit object
```

This would only appear to people who have this in their `~/.config/git/config` file:
```
[commit]
gpgsign = true
```

This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.