git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] Multiple remotes without conflicts
@ 2010-03-18 11:52 Andreas Gruenbacher
  2010-03-13 17:17 ` [PATCH 1/9] fetch: Check for a "^{}" suffix with suffixcmp() Andreas Gruenbacher
  2010-03-18 19:07 ` [PATCH 0/9] Multiple remotes without conflicts Shawn O. Pearce
  0 siblings, 2 replies; 14+ messages in thread
From: Andreas Gruenbacher @ 2010-03-18 11:52 UTC (permalink / raw)
  To: git

Hello,

I'm still trying to find a simple and painless way of sharing the object
store among multiple repositories: the idea is to have a "parent"
repository which contains the actual object store, and a number of
"child" repositories which link to that object store.  The obvious
problem is garbage collection: we can only garbage collect the parent
once it has all refs of all its children.

One way of ensuring that is to make each child a "remote" of the parent,
and to fetch all remotes first.  This works for branches, but not for
tags or for the reflog.

The problem with tags is that they all share the same namespace (they
are fetched with +refs/tags/*:refs/tags/*).  The obvious fix seems to be
to use a different refspec for tags, but with the built-in default
refspec, tags are then fetched twice (for example, with
+refs/*:refs/remotes/<remote>/*, refs/tags/foo is fetched as
refs/remotes/<remote>/tags/foo as well as refs/tags/foo).  Also, when
tags are included in refspecs, automatic tag fetching and the --tags and
--no-tags options break.

This patch series fixes this, and makes refspecs which match tags work
in a reasonable way.  (There may be problems with pruning still; I did
not look into that, yet.)

The other issue is that the "parent" won't know about things
referenced in the child's reflog.  This is not an issue for the setup I
have in mind because the children won't have reflogs (they will only be
accessed remotely), so I have not addressed this so far.

Here is an example for setting up a shared object store:

	TOP=$PWD
	mkdir ab a b

	cd $TOP/ab
	git init --bare
	for x in a b; do
		git remote add $x ../$x
		git config --unset remote.$x.fetch
		git config --add remote.$x.fetch "+refs/*:refs/remotes/$x/*"
	done

	for x in a b; do
		cd $TOP/$x
		git init
		git config gc.auto 0
		rm -r .git/objects
		ln -s ../../ab/objects .git/objects
	done

Comments welcome!

Thanks,
Andreas

---

Andreas Gruenbacher (9):
  fetch: Check for a "^{}" suffix with suffixcmp()
  fetch: Properly initialize refspec on stack
  fetch: Fix minor memory leak
  fetch: Move deepening fetch check into builtin/fetch.c
  fetch: Move loop checking which refs we have already
  fetch: Check if all objects exist after fetching
  fetch: Use the same ref map for all branches and tags
  fetch: Don't fetch tags twice
  fetch: Make automatic tag following work with arbitrary refspecs

 builtin/fetch.c |  430 ++++++++++++++++++++++++++++++++-----------------------
 cache.h         |    4 +-
 transport.c     |   38 ++----
 3 files changed, 264 insertions(+), 208 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-03-18 19:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 11:52 [PATCH 0/9] Multiple remotes without conflicts Andreas Gruenbacher
2010-03-13 17:17 ` [PATCH 1/9] fetch: Check for a "^{}" suffix with suffixcmp() Andreas Gruenbacher
2010-03-12 22:27   ` [PATCH 2/9] fetch: Properly initialize refspec on stack Andreas Gruenbacher
2010-03-15 22:18     ` [PATCH 3/9] fetch: Fix minor memory leak Andreas Gruenbacher
2010-03-16 15:45       ` [PATCH 4/9] fetch: Move deepening fetch check into builtin/fetch.c Andreas Gruenbacher
2010-03-16 17:49         ` [PATCH 5/9] fetch: Move loop checking which refs we have already Andreas Gruenbacher
2010-03-16 18:48           ` [PATCH 6/9] fetch: Check if all objects exist after fetching Andreas Gruenbacher
2010-03-17 21:42             ` [PATCH 7/9] fetch: Use the same ref map for all branches and tags Andreas Gruenbacher
2010-03-17 23:02               ` [PATCH 8/9] fetch: Don't fetch tags twice Andreas Gruenbacher
2010-03-17 23:59                 ` [PATCH 9/9] fetch: Make automatic tag following work with arbitrary refspecs Andreas Gruenbacher
2010-03-18 19:08             ` [PATCH 6/9] fetch: Check if all objects exist after fetching Shawn O. Pearce
2010-03-18 19:36               ` Andreas Gruenbacher
2010-03-18 19:07 ` [PATCH 0/9] Multiple remotes without conflicts Shawn O. Pearce
2010-03-18 19:42   ` Andreas Gruenbacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).