Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [RFC][PATCH 0/3] Different views on a repository

From: Andreas Gruenbacher <hidden>
Date: 2016-06-15 22:48:21

On Friday 26 February 2010 05:12:45 Adam Brewster wrote:
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
I see, when multiple projects share the same objects, you push them into those 
projects independently first, and the script will later move them to $SUPER.
Clearly I can lose data if I try to rebase $SUPER or something, but I think
it's pretty safe for normal use.
It looks safe unless somebody messes with $SUPER.  A lot of repacking will 
still occur as part of moving stuff to $SUPER, though.

I was trying to set things up so that this extra work won't be necessary in 
the first place.

Thanks!

Andreas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help