Skip to content

Commit

Permalink
feat: add patch for @changesets/git package
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuhanW committed Dec 5, 2024
1 parent 9d5e15d commit 09e56bd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 39 deletions.
13 changes: 7 additions & 6 deletions patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
diff --git a/dist/changesets-git.cjs.js b/dist/changesets-git.cjs.js
index 415542c09ff1a3dbfc3eef7ff52f9d592a3be334..45d2e19a09a09b9a8f30dbe61c14f6f7e8ec4bb0 100644
index 415542c09ff1a3dbfc3eef7ff52f9d592a3be334..34f646a2f052a200521aebddcb12105e66224480 100644
--- a/dist/changesets-git.cjs.js
+++ b/dist/changesets-git.cjs.js
@@ -87,7 +87,7 @@ async function getCommitsThatAddFiles(gitPaths, {
do {
// Fetch commit information for all paths we don't have yet
const commitInfos = await Promise.all(remaining.map(async gitPath => {
- const [commitSha, parentSha] = (await spawn__default["default"]("git", ["log", "--diff-filter=A", "--max-count=1", short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p", gitPath], {
+ const [commitSha, parentSha] = (await spawn__default["default"]("git", ["log", "--follow", "--diff-filter=A", "--max-count=1", short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p", gitPath], {
+ const [commitSha, parentSha] = (await spawn__default["default"]("git", ["log", "--follow", `--after=${new Date(new Date().setMonth(new Date().getMonth() -2)).toISOString()}`, "--diff-filter=A", "--max-count=1", short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p", gitPath], {
cwd
})).stdout.toString().split(":");
return {
diff --git a/dist/changesets-git.esm.js b/dist/changesets-git.esm.js
index 58f76fe0cb21c35fa600e83f20fbbd23ee7d0ba0..0d65008e8e3a3f99277949f13c0c96584c60401c 100644
index 58f76fe0cb21c35fa600e83f20fbbd23ee7d0ba0..b82da6c93e8039e728af7be257d769b11e017d66 100644
--- a/dist/changesets-git.esm.js
+++ b/dist/changesets-git.esm.js
@@ -75,7 +75,7 @@ async function getCommitsThatAddFiles(gitPaths, {
do {
// Fetch commit information for all paths we don't have yet
const commitInfos = await Promise.all(remaining.map(async gitPath => {
- const [commitSha, parentSha] = (await spawn("git", ["log", "--diff-filter=A", "--max-count=1", short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p", gitPath], {
+ const [commitSha, parentSha] = (await spawn("git", ["log", "--follow", "--diff-filter=A", "--max-count=1", short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p", gitPath], {
+ const [commitSha, parentSha] = (await spawn("git", ["log", "--follow", `--after=${new Date(new Date().setMonth(new Date().getMonth() -2)).toISOString()}`, "--diff-filter=A", "--max-count=1", short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p", gitPath], {
cwd
})).stdout.toString().split(":");
return {
diff --git a/src/index.ts b/src/index.ts
index 7e3aee53439f3724886eacc2bb9ea8b9abc6b6cf..306ade4b8a56a9c1f0af9f87a94ac65447271ed1 100644
index 7e3aee53439f3724886eacc2bb9ea8b9abc6b6cf..d44d159b7e411f017baf38f10e440d01f2b8a6f5 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -80,6 +80,7 @@ export async function getCommitsThatAddFiles(
@@ -80,6 +80,8 @@ export async function getCommitsThatAddFiles(
"git",
[
"log",
+ "--follow",
+ `--after=${new Date(new Date().setMonth(new Date().getMonth() -2)).toISOString()}`,
"--diff-filter=A",
"--max-count=1",
short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p",
66 changes: 33 additions & 33 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 09e56bd

Please sign in to comment.