git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Should 'git replace' respect GIT_NAMESPACE?

From
Christian Couder <christian.couder@gmail.com>
Date
Jan 15, 2025, 09:21 UTC
Message-ID
<CAP8UFD1ioX4R6J+Spb2oPEeTHvUBrt62iBqvRgMNJVbp45sw_Q@mail.gmail.com>
In-Reply-To
<CAFAcib9cJOp26J=PxU3XwmLT0hQVqCb8vcS7MdGpFd5TNVfDzw@mail.gmail.com>

On Tue, Jan 14, 2025 at 11:40 PM Josh Bleecher Snyder <josharian@gmail.com> wrote:

Show 8 quoted lines
> 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.

Previous: Josh Bleecher Snyder
Message 4 of 4 in “Should 'git replace' respect GIT_NAMESPACE?”
  1. Josh Bleecher SnyderJan 14, 2025
  2. Christian CouderJan 14, 2025
  3. Josh Bleecher SnyderJan 14, 2025
  4. Christian CouderJan 15, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.