git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Brewster <adambrewster@gmail.com>
To: Andreas Gruenbacher <agruen@suse.de>
Cc: git@vger.kernel.org
Subject: Re: [RFC][PATCH 0/3] Different views on a repository
Date: Thu, 25 Feb 2010 23:30:33 -0500	[thread overview]
Message-ID: <c376da901002252030p49126bf5tc5ffdca9f2ad13c1@mail.gmail.com> (raw)
In-Reply-To: <cover.1267029680.git.agruen@suse.de>

On Wed, Feb 24, 2010 at 11:41 AM, Andreas Gruenbacher <agruen@suse.de>wrote:

> Hello,
>
> we have a use case with groups of repositories which share lots of
> objects, but which are logically independent.  There is no strict
> hierarchy between the repositories, the development modl is arbitrary.
> The alternates mechanism for sharig objects between repositories won't
> work.
>

I don't know what you're trying to accomplish, but for what it's
worth, I do something similar with a couple of shell scripts.

My goal was to make bundles (basically thin packs) smaller by taking
advantage of files I knew were available on the far side of the
air-gap even if they weren't in a the repository I was bundling that
particular day.

The idea was to push from all of my repositories into a super
repository with a fancy (and auto-generated) refspec.  The actual code
is impenetrable, but reconstructing it in everybody's favorite IDE,
gmail, I came up with

#!/bin/bash
PROJECTS=$HOME/projects
SUPER=$HOME/projects/.git-super-repo

[[ -d "$SUPER" ]] || \
 (mkdir "$SUPER"; git --git-dir="$SUPER" init)

for i in $PROJECTS/*/.git; do
 name=$(basename "$(dirname "$0")")
 echo "$SUPER/objects" > $i/.git/objects/info/alternates
 git --git-dir="$i" push -f "$SUPER" "*:refs/$name/*"
done

git --git-dir="$SUPER" gc --aggressive

for i in $PROJECTS/*/.git; do
 git --git-dir="$i" repack -Ad #unnecessary?
 git --git-dir="$i" gc --aggressive
done

Clearly I can lose data if I try to rebase $SUPER or something, but I
think it's pretty safe for normal use.

In your case, the "projects" are called "views".

Adam

  parent reply	other threads:[~2010-02-26  4:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 16:41 [RFC][PATCH 0/3] Different views on a repository Andreas Gruenbacher
2010-02-24 15:33 ` [PATCH 1/3] receive-pack: Two small code cleanups Andreas Gruenbacher
2010-02-24 15:57   ` [PATCH 2/3] Different views on a repository Andreas Gruenbacher
2010-02-24 16:14     ` [PATCH 3/3] Different views on a repository: HEAD mapping Andreas Gruenbacher
2010-02-24 17:42     ` [PATCH 2/3] Different views on a repository Shawn O. Pearce
2010-02-25  9:01     ` Michael J Gruber
2010-02-25  9:25       ` Andreas Gruenbacher
2010-02-25 12:30         ` Michael J Gruber
2010-02-25 14:35           ` Andreas Gruenbacher
2010-02-25 17:28             ` Junio C Hamano
2010-02-26  0:45               ` Andreas Gruenbacher
2010-02-26 21:35                 ` Andreas Gruenbacher
2010-02-24 17:29   ` [PATCH 1/3] receive-pack: Two small code cleanups Shawn O. Pearce
2010-02-25 20:13 ` [RFC][PATCH 0/3] Different views on a repository James Pickens
2010-02-26  4:30 ` Adam Brewster [this message]
     [not found] ` <c376da901002252012s507a6921q922e606bdce4b4fa@mail.gmail.com>
2010-02-26 12:01   ` Andreas Gruenbacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c376da901002252030p49126bf5tc5ffdca9f2ad13c1@mail.gmail.com \
    --to=adambrewster@gmail.com \
    --cc=agruen@suse.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).