Squash commits without using a worktree
Right now we squash using a worktree. This has a number of limitations:
- We have to do some tricky spare checkout logic to handle the case when there are no diff files.
- Squash doesn't work with UTF-8 files because applying a diff to a UTF-8 file causes Git to warn:
warning: Cannot merge binary files: my-filename.txt (ours vs. theirs)
. Theworking-tree-encoding
(https://git-scm.com/docs/gitattributes/2.18.0#_working_tree_encoding) parameter helps here, but this file isn't in a sparse checkout (we could add it though?)! - It can be slow to checkout files.
Now that we have git2go available, we might be able to use the rebase code to squash on the same branch?
This relates to: