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

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

From
AGAndreas Gruenbacher <agruen@suse.de>
Date
Feb 26, 2010, 12:01 UTC
Message-ID
<201002261301.39243.agruen@suse.de>
In-Reply-To
<c376da901002252012s507a6921q922e606bdce4b4fa@mail.gmail.com>
On Friday 26 February 2010 05:12:45 Adam Brewster wrote:
Show 24 quoted lines
> 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
Previous: Adam Brewster
Message 16 of 16 in “Different views on a repository”
  1. Andreas GruenbacherFeb 24, 2010
  2. 1/3 receive-pack: Two small code cleanupsAndreas Gruenbacher, Feb 24, 2010
  3. 2/3 Different views on a repositoryAndreas Gruenbacher, Feb 24, 2010
  4. 3/3 Different views on a repository: HEAD mappingAndreas Gruenbacher, Feb 24, 2010
  5. Shawn O. PearceFeb 24, 2010
  6. Michael J GruberFeb 25, 2010
  7. Andreas GruenbacherFeb 25, 2010
  8. Michael J GruberFeb 25, 2010
  9. Andreas GruenbacherFeb 25, 2010
  10. Junio C HamanoFeb 25, 2010
  11. Andreas GruenbacherFeb 26, 2010
  12. Andreas GruenbacherFeb 26, 2010
  13. Shawn O. PearceFeb 24, 2010
  14. James PickensFeb 25, 2010
  15. Adam BrewsterFeb 26, 2010
  16. Andreas GruenbacherFeb 26, 2010

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.