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

Re: How to stop sharing objects between repositories

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2009, 19:16 UTC
Message-ID
<7vmy5z603d.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090816135703.GA31638@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 25 quoted lines
> Subject: [PATCH] docs: mention how to break alternates dependency
>
> A user who has created a repository dependency by using "git
> clone -s" does not necessarily know where to look to find
> out how to break that dependency. Let's mention it right
> under "-s", where they are most likely to find it.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  Documentation/git-clone.txt |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
> index b14de6c..87fa687 100644
> --- a/Documentation/git-clone.txt
> +++ b/Documentation/git-clone.txt
> @@ -72,6 +72,11 @@ These objects may be removed by normal git operations (such as 'git-commit')
>  which automatically call `git gc --auto`. (See linkgit:git-gc[1].)
>  If these objects are removed and were referenced by the cloned repository,
>  then the cloned repository will become corrupt.
> ++
> +To break the dependency of the cloned repository to the source
> +repository, run `git repack -a` in the cloned repository, which will
> +create a new pack in that repository with all referenced objects,
> +including those in the source repository.

After reading this, two points come to my mind. They may or may not be issues.

 (1) Such a user does not necessarily know a casual "git repack -a" breaks
     the dependency, defeating the -s option s/he deliberately used in
     order to save disk space in the first place.  Perhaps we can reword
     this further to kill two penguins with a single stone?
	Note that the pack resulting from running `git repack -a` in the
	repository cloned with the `-s` option will include objects that
	are borrowed from the source repository.  It essentially breaks
	the dependency created by cloning with the `-s` option by copying
	the objects from the source repository.  To keep borrowing from
	the source repository to save disk space, do not use `repack -a`.
     We should suggest an alternative immediately after this sentence,
     e.g. "Instead, use `repack -l`" or something, but somebody should
     check if it is a valid/viable alternative.
 (2) IIRC, "git gc --auto" runs "repack -A".  What is its effect with
     respect to this dependency between object stores?  I suspect it would
     also break the dependency, but if so, is it a good thing?  Perhaps
     should we change it to use a version that keeps the dependency
     instead?
Previous: Jeff KingNext: Mike Galbraith
Message 8 of 18 in “How to stop sharing objects between repositories”
  1. Jon JensenAug 16, 2009
  2. Johannes SchindelinAug 16, 2009
  3. Jeff KingAug 16, 2009
  4. Johannes SchindelinAug 16, 2009
  5. Daniel VilleneuveAug 16, 2009
  6. Johannes SchindelinAug 16, 2009
  7. Jeff KingAug 16, 2009
  8. Junio C HamanoAug 16, 2009
  9. Mike GalbraithAug 17, 2009
  10. Jeff KingAug 17, 2009
  11. Mike GalbraithAug 17, 2009
  12. Junio C HamanoAug 17, 2009
  13. Jeff KingAug 17, 2009
  14. Junio C HamanoAug 17, 2009
  15. Jeff KingAug 17, 2009
  16. Jeff KingAug 17, 2009
  17. Jeff KingAug 17, 2009
  18. Jeff KingAug 17, 2009

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.