Gentoo Archives: gentoo-scm

From: Justin <justin@×××××××××.net>
To: gentoo-scm@l.g.o
Subject: Re: [gentoo-scm] 'overlays' are altenatives to full tree clone
Date: Fri, 17 Apr 2009 06:48:04
In Reply to: Re: [gentoo-scm] 'overlays' are altenatives to full tree clone by Donnie Berkholz
Donnie Berkholz schrieb:
> On 13:14 Sun 12 Apr , Caleb Cushing wrote: >> just so you know, you don't need the full tree to patch it. git >> doesn't actually care if there's common history between 2 tree's when >> you merge. I was planning on writing a tutorial for this for dev in >> regen2 if anyone wants me to for here (since it sound like your w/ >> extra history) has some hugeness. > > Justin Lecher wrote up quick instructions about this, to preserve > history when merging from the sci overlay to the main tree. I don't know > if it's anywhere besides my inbox. >
Attached the little script how I import things from git to git overlays. It basically works, but one thing really could be optimized, preserving the directory structure. The way I do it with --subdirectory-filter results in in a new repo where the root of the repo is the package dir. If possible preserving the directory structure would be beneficial. There might be some tricks but this is high-level git magic. This way I do it preserves the history of every file inside the package dir and this is what we basically want. #!/bin/bash -v #git clone repoA #git clone repoB #cd repoA #git fetch ../repoB master:repoB-merge #git checkout repoB-merge #git filter-branch --subdirectory-filter ${CATEGOY}/${PN} -- repoB-merge if [[ -z $1 ]]; then exit fi CATPACK="${1}" CAT="${1%\/*}" PACK="${1#*\/}" cd /data/local/science git fetch /data/local/dberkholz master:"${CATPACK}"-import git checkout "${CATPACK}"-import rm -rf .git/refs/original git filter-branch --subdirectory-filter ${CATPACK} -- "${CATPACK}"-import git checkout master git pull --no-commit . "${CATPACK}"-import mkdir "${CATPACK}" for i in ${PACK}* ChangeLog Manifest metadata.xml files; do if [[ -e $i ]]; then git mv $i "${CATPACK}"/ fi done


File name MIME type
signature.asc application/pgp-signature