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

Re: Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?

From
Christian Couder <christian.couder@gmail.com>
Date
Sep 16, 2012, 02:42 UTC
Message-ID
<CAP8UFD0sfBGT9OaGuS9OF68rdhoe1PTM4gYxE78z+NjTApF9Sw@mail.gmail.com>
In-Reply-To
<CACffvTroMt-s7X_DV9AHerzKdgz+xABXTd91aTUc2BtYO7QxCA@mail.gmail.com>
Hi,

On Sat, Sep 15, 2012 at 11:49 PM, David Chanters <david.chanters@googlemail.com> wrote:

Show 22 quoted lines
> Hi,
>
> On 15 September 2012 18:21, Junio C Hamano <gitster@pobox.com> wrote:
>
>> Assuming that they do, pushing the replacement ref makes the
>> replacing object available in the pushed-into repository, so
>> they will *not* rely on your repository.
>
> This makes sense.  But it is more the mechanics of what happens with
> needing to update the "fetch" line for the remote in .git/config I am
> more puzzled by.
>
> For example, if I have two repos -- repoA and repoB, where repoA
> contains the replace refs for repoB -- if I clone both repos with the
> intent of wanting to look at the two histories, what must I do in
> repoA to fetch the replace refs in the first place?
>
> I've tried:
>
> [remote "origin"]
>         fetch =
> +refs/replace/*:+refs/heads/*:refs/remotes/origin/*:refs/replace/*
Could you try the following:
[remote "origin"]
        fetch = +refs/replace/*:refs/replace/*
        fetch = +refs/heads/*:refs/remotes/origin/*
Show 5 quoted lines
> But this results in:
>
> % git pull
> fatal: Invalid refspec
> '+refs/replace/*:+refs/heads/*:refs/remotes/origin/*:refs/replace/*'

Best, Christian.

Previous: David ChantersNext: Junio C Hamano
Message 4 of 5 in “Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?”
  1. David ChantersSep 15, 2012
  2. Junio C HamanoSep 15, 2012
  3. David ChantersSep 15, 2012
  4. Christian CouderSep 16, 2012
  5. Junio C HamanoSep 16, 2012

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.