Skip to content

bun patch --commit causing patch header to grow on each run #19327

Open
@jpenilla

Description

@jpenilla

What version of Bun is running?

1.2.10

What platform is your computer?

Linux 6.14.3-arch1-1 x86_64 unknown

What steps can reproduce the bug?

Make a change to a dependency using bun patch <dep> and bun patch <dep> --commit.

Then without making any more changes, run bun patch <dep> --commit one or more times. The patch header will grow each time. This will also happen when you do make more changes, but it's not required to trigger the bug.

This is inconvenient for version controlled dependency patches.

What is the expected behavior?

diff --git a/dist/bits/select/select.svelte.js b/dist/bits/select/select.svelte.js
index a8dabcc76c8d2a732ffeb58857bc35886c9acac3..67e147b898806273916ea7620317c932dbc09e4c 100644
--- a/dist/bits/select/select.svelte.js
+++ b/dist/bits/select/select.svelte.js
@@ -55,7 +55,7 @@ class SelectBaseRootState {
     setHighlightedNode(node, initial = false) {
         this.highlightedNode = node;
         if (node && (this.isUsingKeyboard || initial)) {
-            node.scrollIntoView({ block: "nearest" });
+            node.scrollIntoView({ block: this.opts.scrollAlignment.current });
         }
     }
     getCandidateNodes() {
@@ -1018,7 +1018,7 @@ class SelectScrollDownButtonState {
             }
             this.scrollIntoViewTimer = afterSleep(5, () => {
                 const activeItem = this.root.highlightedNode;
-                activeItem?.scrollIntoView({ block: "nearest" });
+                activeItem?.scrollIntoView({ block: this.root.opts.scrollAlignment.current });
             });
         });
     }

What do you see instead?

diff --git a/node_modules/bits-ui/.bun-tag-49dd7e2724f69abf b/.bun-tag-49dd7e2724f69abf
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/node_modules/bits-ui/.bun-tag-59f657326b07902f b/.bun-tag-59f657326b07902f
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/node_modules/bits-ui/.bun-tag-b7ba0465c10494fc b/.bun-tag-b7ba0465c10494fc
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/node_modules/bits-ui/.bun-tag-e5aec9227d6cfa40 b/.bun-tag-e5aec9227d6cfa40
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/dist/bits/select/select.svelte.js b/dist/bits/select/select.svelte.js
index a8dabcc76c8d2a732ffeb58857bc35886c9acac3..67e147b898806273916ea7620317c932dbc09e4c 100644
--- a/dist/bits/select/select.svelte.js
+++ b/dist/bits/select/select.svelte.js
@@ -55,7 +55,7 @@ class SelectBaseRootState {
     setHighlightedNode(node, initial = false) {
         this.highlightedNode = node;
         if (node && (this.isUsingKeyboard || initial)) {
-            node.scrollIntoView({ block: "nearest" });
+            node.scrollIntoView({ block: this.opts.scrollAlignment.current });
         }
     }
     getCandidateNodes() {
@@ -1018,7 +1018,7 @@ class SelectScrollDownButtonState {
             }
             this.scrollIntoViewTimer = afterSleep(5, () => {
                 const activeItem = this.root.highlightedNode;
-                activeItem?.scrollIntoView({ block: "nearest" });
+                activeItem?.scrollIntoView({ block: this.root.opts.scrollAlignment.current });
             });
         });
     }

Additional information

Can be worked around by deleting redundant header lines before committing patches to version control

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbun installSomething that relates to the npm-compatible clientbun patch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions