Re: [RFC][PATCH 0/3] Different views on a repository
- From
Adam Brewster <adambrewster@gmail.com>
- Date
- Feb 26, 2010, 04:30 UTC
- Message-ID
- <c376da901002252030p49126bf5tc5ffdca9f2ad13c1@mail.gmail.com>
- In-Reply-To
- <cover.1267029680.git.agruen@suse.de>
On Wed, Feb 24, 2010 at 11:41 AM, Andreas Gruenbacher <agruen@suse.de>wrote:
Show 8 quoted lines
> 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