-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
filter-repo: change the --replace-refs default to 'update-no-add'
I have been meaning to make this change for a couple years. In addition to the replace-refs issues I knew about when I made filter-repo start writing replace refs, namely: * Many refs might slow down git operations * replace refs are not pushed or pulled by default, making them a bit harder for users to take advantage of * libgit2 and jgit do not support replace refs * the the various Code Hosting sites (Gerrit, GitHub, GitLab) do not support replace refs in their UI I have found that the negatives about having replace-refs turned on by default have seemed to be bigger than I realized, and the positives for it have turned out to be much less than I imagined. Some of the additional factors are: * commit-graphs disable themselves if there are _any_ replace refs (it wouldn't need to for the kind we write, but there is no more specialized logic in place) * Git itself still has buggy handling of replace refs (as per https://lore.kernel.org/git/CABPp-BEAbN05+hCtK=xhGg5uZFqbUvH9hMcCNMcBWp5JWLqzPw@mail.gmail.com/ ) * users continue to assume replace refs do things they don't in new and interesting ways contrary to any and all documentation. I've been surprised a few times by new powers users can dream and assert they have. * my big monorepo rewrite at ${FORMER_EMPLOYER} shrunk the repository dramatically, as desired, when we finally got to approval to do it after years of talking about it. But despite years of pings about making sure we had a way to refer to new commits with old commit IDs as part of that conversion, and providing that way, it was used dramatically less than I had expected. I might have even gotten entirely away without providing such a mapping, though I'm happy that we had it and I was able to proactively provide it to the users and comfort their fears about the transition. Now, all this said, I still think that being able to create replace refs as a mechanism for users to refer to new commits using old commit IDs is a great ability. However, I now think it should be off by default, which is achieved with the 'update-no-add' setting. In addition to changing the default in the code, also update the documentation and the built-in help, and add a few new testcases to make sure everything is well tested. Signed-off-by: Elijah Newren <[email protected]>
- Loading branch information
Showing
3 changed files
with
91 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters