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

Re: Bringing a bit more sanity to $GIT_DIR/objects/info/alternates?

From
SCSascha Cunz <sascha-ml@babbelbox.org>
Date
Aug 8, 2012, 01:42 UTC
Message-ID
<5037389.HDN2QUVQO5@mephista>
In-Reply-To
<7vmx2a3pif.fsf@alter.siamese.dyndns.org>
[..]
Show 5 quoted lines
>  - By design, the borrowed object store MUST not ever lose any
>    object from it, as such an object loss can corrupt the borrowing
>    repositories.  In theory, it is OK for the object store whose
>    objects are borrowed by repositories to acquire new objects, but
>    losing existing objects is an absolute no-no.
[...]
>    In practice, this means that users who use "clone -s" to make a
>    new repository can *never* prune the original repository without
>    risking to corrupt its borrowing repository [*1*].
[...]

Given your example of /git/linux.git being a clone of Linus' repository, cloning a related repository using it as --reference:

     $ cd /git
     $ git clone --reference /git/linux.git git://k.org/linux-next.git mine

Wouldn't it be by far a less intrusive alternative to do the following (in the clone step above):

- create the file /git/linux.git/objects/borrowing/_git_mine (This is where we
  borrow FROM).
  This file would hold a packed-ref list of HEADs from the /git/mine clone of
  the repository.
  _git_mine here is slash-stripped version of the destination path. Maybe the
  packed-ref format could also be extended by a single line containing a full
  path to the foreign repository.
- On every update-ref to /git/mine, update the 'borrowing' refs in
  /git/linux.git
- On any maintenance on /git/linux.git (gc, prune, repack, etc.) consider refs
  in the packed-refs at objects/borrowing to be valid references.
  If packed-ref format was adopted like stated above, we could stat() here if
  this directory still exists and error out if it doesn't (In this case the
  user should tell us if she moved or removed the clone).

Any alternatives for looking up the packed-refs list for borrowing would also be doable; i.E. putting the list of valid borrowing-packed-refs-files into the config file (as opposed to lookup $GIT_DIR/objects/borrowing above). Putting this list into the config file would eliminate need for the packed-ref format change and give the user the ability to maintain her clones with well- known command 'git config'

Previous: Junio C HamanoNext: Hallvard Breien Furuseth
Message 6 of 26 in “Bringing a bit more sanity to $GIT_DIR/objects/info/alternates?”
  1. Junio C HamanoAug 5, 2012
  2. Michael HaggertyAug 5, 2012
  3. Junio C HamanoAug 5, 2012
  4. Jeff KingAug 7, 2012
  5. Junio C HamanoAug 6, 2012
  6. Sascha CunzAug 8, 2012
  7. Hallvard Breien FurusethAug 11, 2012
  8. Oswald BuddenhagenAug 27, 2012
  9. GC of alternate object store (was: Bringing a bit more sanity to $GIT_DIR/objects/info/alternates?)Hallvard Breien Furuseth, Aug 28, 2012
  10. Oswald BuddenhagenAug 29, 2012
  11. Junio C HamanoAug 29, 2012
  12. Oswald BuddenhagenAug 30, 2012
  13. Junio C HamanoAug 30, 2012
  14. Oswald BuddenhagenAug 31, 2012
  15. Dan JohnsonAug 31, 2012
  16. Junio C HamanoAug 31, 2012
  17. fetch --all: pass --tags/--no-tags through to each remoteDan Johnson, Sep 1, 2012
  18. Jeff KingSep 1, 2012
  19. 1/2 argv-array: add pop functionJeff King, Sep 1, 2012
  20. 2/2 fetch: use argv_array instead of hand-building arraysJeff King, Sep 1, 2012
  21. Jens LehmannSep 1, 2012
  22. submodule: use argv_array instead of hand-building arraysJens Lehmann, Sep 1, 2012
  23. Jeff KingSep 1, 2012
  24. 3/2 argv-array: fix bogus cast when freeing arrayJeff King, Sep 1, 2012
  25. [PATCHv2] fetch --all: pass --tags/--no-tags through to each remoteDan Johnson, Sep 5, 2012
  26. Junio C HamanoSep 7, 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.