On Tue, Jan 14, 2025 at 11:40 PM Josh Bleecher Snyder <josharian@xxxxxxxxx> wrote: > Do you have suggestions for alternative mechanisms I might use? > > I want to be able to easily enable/disable a set of replace directives > for the purposes of running other git commands, without globally > altering the repository. Otherwise I have to worry about locking, > cleanup when something goes wrong, and state visibility and > management. All possible to fix, but messy compared with something > like namespaces. The simplest would likely be to develop a small set of shell scripts/commands to move or copy replace refs around. These scripts or commands could use `git for-each-ref` to get replace ref information and then `git update-ref` to create and/or delete replace refs. For example a 'mv-rep-refs <src> <dst>' command would move all the refs under "refs/replace/views/<src>/" to "refs/replace/views/<dst>/" except if <src> or <dst> is '.' which would mean "refs/replace/". Then `mv-rep-refs build-fixes .` could activate the replace refs that fix the build. Alternatively you could work on implementing a similar "view" mechanism in Git itself and submit your patches here.