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

Re: [PATCH] Introduce git-mirror, a tool for exactly mirroring another repository.

From
Junio C Hamano <junkio@cox.net>
Date
Nov 1, 2006, 16:15 UTC
Message-ID
<7vodrr2ldy.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061101151859.0e984d3f.vsu@altlinux.ru>
Sergey Vlasov <vsu@altlinux.ru> writes:
Show 9 quoted lines
> What name format should be used for such saved refs?  refs/old/`date -I`
> is not unique enough; probably `date --utc +%Y.%m.%d-%H.%M.%S`?  And it
> would be good if multiple refs which were deleted or modified in a
> non-fast-forward way during a single operation (like git-mirror) would
> be saved together - which may be tricky if they are saved at the lower
> level (in update-ref).
>
> Adding the fast-forward check into update-ref also does not look nice,
> but this check is required for full safety.

I wasn't going to suggest doing the check or even naming at such a low level. From the usability point of view, the caller should decide if the discarded refs are even saved at all, and if so in which namespace. That way commit_lock_file() can just notice the old version of the locked file (it is always sitting next to it) and hardlink the discarded one to the purgatory before renaming the newly created .lock file there.

Previous: Jakub Narebski
Message 10 of 10 in “Introduce git-mirror, a tool for exactly mirroring another repository.”
  1. Introduce git-mirror, a tool for exactly mirroring another repository.Shawn Pearce, Sep 25, 2006
  2. Junio C HamanoSep 26, 2006
  3. Shawn PearceSep 26, 2006
  4. Sergey VlasovOct 31, 2006
  5. Shawn PearceOct 31, 2006
  6. Junio C HamanoNov 1, 2006
  7. Jakub NarebskiNov 1, 2006
  8. Sergey VlasovNov 1, 2006
  9. Jakub NarebskiNov 1, 2006
  10. Junio C HamanoNov 1, 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.