mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-11-07 09:20:29 +00:00
1fa8c2c70b
This adds the ability to automatically add new replacement refs for each rewritten commit (as well as delete or update replacement refs that existed before the run). This will allow users to use either new or old commit hashes to reference commits locally, though old commit hashes will need to be unabbreviated. The only requirement for this to work, is that the person who does the rewrite also needs to push the replace refs up where other users can grab them, and users who want to use them need to modify their fetch refspecs to grab the replace refs. However, other tools external to git may not understand replace refs... Tools like Gerrit and GitHub apparently do not yet natively understand replace refs. Trying to view "commits" by the replacement ref will yield various forms of "Not Found" in each tool. One has to instead try to view it as a branch with an odd name (including "refs/replace/"), and often branches are accessed via a different URL style than commits so it becomes very non-obvious to users how to access the info associated with an old commit hash. * In Gerrit, instead of being able to search on the sha1sum or use a pre-defined URL to search and auto-redirect to the appropriate code review with https://gerrit.SITE.COM/#/q/${OLD_SHA1SUM},n,z one instead has to have a special plugin and go to a URL like https://gerrit.SITE.COM/plugins/gitiles/ORG/REPO/+/refs/replace/${OLD_SHA1SUM} but then the user isn't shown the actual code review and will need to guess which link to click on to get to it (and it'll only be there if the user included a Change-Id in the commit message). * In GitHub, instead of being able to go to a URL like https://github.SITE.COM/ORG/REPO/commit/${OLD_SHA1SUM} one instead has to navigate based on branch using https://github.SITE.COM/ORG/REPO/tree/refs/replace/${OLD_SHA1SUM} but that will show a listing of commits instead of information about a specific commit; the user has to manually click on the first commit to get to the desired location. For now, providing replace refs at least allows users to access information locally using old IDs; perhaps in time as other external tools will gain a better understanding of how to use replace refs, the barrier to history rewrites will decrease enough that big projects that really need it (e.g. those that have committed many sins by commiting stupidly large useless binary blobs) can at least seriously contemplate the undertaking. History rewrites will always have some drawbacks and pain associated with them, as they should, but when warranted it's nice to have transition plans that are more smooth than a massive flag day. Signed-off-by: Elijah Newren <newren@gmail.com> |
||
---|---|---|
.. | ||
t9390 | ||
t9391 | ||
run_coverage | ||
t9390-filter-repo.sh | ||
t9391-filter-repo-lib-usage.sh | ||
t9392-python-callback.sh | ||
test-lib-functions.sh | ||
test-lib.sh |