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

Re: [PATCH] Added --mirror-all to git-fetch.

From
Junio C Hamano <junkio@cox.net>
Date
Sep 20, 2006, 16:06 UTC
Message-ID
<7vac4ujzf0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060919232851.GA12195@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
Show 5 quoted lines
> The --mirror-all option to git-fetch can be used to obtain a copy of
> every available remote ref into the current repository.  This can be
> a rather destructive update as the local repository will have its
> HEAD ref overwritten, as well as any ref which it shares in common
> with the remote repository.

I can sort of see where something like this is very much useful, but it sounds like a tool quite different from git-fetch.

 (1) I really do not like rolling this kind of speciale purpose
     command into git-fetch, which is frequently used by end
     users, to avoid mistakes.
     If there is reluctance against adding yet another new
     command (and there certainly is), this feels more like a
     cousin of "git-clone --bare".
 (2) Although there is no inherent reason not allowing a working
     tree associated with the repository that is kept updated
     this way, the user will be utterly confused in a working
     tree whose current branch head is updated like this, until
     the working tree and the index is matched to the updated
     HEAD.  It might be reasonable to run checkout -f HEAD when
     a working tree is associated with the repository (the
     command is screwing over even the current branch HEAD, so
     losing what happened to be in the working tree is really
     not an issue), but as a much easier safety measure we might
     want to allow this mode of updating only on a bare
     repository (that is, .git/index should not exist).
 (3) This feels primarily meant for something like Pasky is
     trying to run --- mirrored distribution point of git
     repositories perhaps displayed with gitweb.  When updating
     such a repository, you would want to do things like running
     update-server-info and automatically repacking the object
     store.  Especially the latter would be an interesting topic
     (the archive vs active repacking strategy we talked about,
     combined with set of packs with staggered spans to help
     commit walkers Pasky talked about quite a while ago).
Show 6 quoted lines
> ... 
> such as if you are providing Git repository hosting and mirroring
> source repositories on other systems.
>
> Currently local refs are not deleted even if they do not exist in the
> remote repository.  This may be taken as either a feature or a bug.
For that purpose I would say that is definitely a bug.
Previous: Petr BaudisNext: Petr Baudis
Message 3 of 14 in “Added --mirror-all to git-fetch.”
  1. Added --mirror-all to git-fetch.Shawn Pearce, Sep 19, 2006
  2. Petr BaudisSep 19, 2006
  3. Junio C HamanoSep 20, 2006
  4. Petr BaudisSep 20, 2006
  5. Shawn PearceSep 20, 2006
  6. Junio C HamanoSep 20, 2006
  7. Shawn PearceSep 20, 2006
  8. Junio C HamanoSep 20, 2006
  9. Shawn PearceSep 20, 2006
  10. Junio C HamanoSep 20, 2006
  11. A Large Angry SCMSep 20, 2006
  12. Petr BaudisSep 20, 2006
  13. Junio C HamanoSep 20, 2006
  14. Shawn PearceSep 20, 2006

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.