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
Message-Id: 49E82621.1030103@j-schmitz.net
In Reply to: Re: [gentoo-scm] 'overlays' are altenatives to full tree clone by Donnie Berkholz
1 Donnie Berkholz schrieb:
2 > On 13:14 Sun 12 Apr , Caleb Cushing wrote:
3 >> just so you know, you don't need the full tree to patch it. git
4 >> doesn't actually care if there's common history between 2 tree's when
5 >> you merge. I was planning on writing a tutorial for this for dev in
6 >> regen2 if anyone wants me to for here (since it sound like your w/
7 >> extra history) has some hugeness.
8 >
9 > Justin Lecher wrote up quick instructions about this, to preserve
10 > history when merging from the sci overlay to the main tree. I don't know
11 > if it's anywhere besides my inbox.
12 >
13
14 Attached the little script how I import things from git to git overlays. It basically works, but one
15 thing really could be optimized, preserving the directory structure. The way I do it with
16 --subdirectory-filter results in in a new repo where the root of the repo is the package dir. If
17 possible preserving the directory structure would be beneficial. There might be some tricks but this is
18 high-level git magic. This way I do it preserves the history of every file inside the package dir and
19 this is what we basically want.
20
21
22 #!/bin/bash -v
23 #git clone repoA
24 #git clone repoB
25 #cd repoA
26 #git fetch ../repoB master:repoB-merge
27 #git checkout repoB-merge
28 #git filter-branch --subdirectory-filter ${CATEGOY}/${PN} -- repoB-merge
29
30 if [[ -z $1 ]]; then
31 exit
32 fi
33
34 CATPACK="${1}"
35 CAT="${1%\/*}"
36 PACK="${1#*\/}"
37
38
39 cd /data/local/science
40
41 git fetch /data/local/dberkholz master:"${CATPACK}"-import
42 git checkout "${CATPACK}"-import
43 rm -rf .git/refs/original
44 git filter-branch --subdirectory-filter ${CATPACK} -- "${CATPACK}"-import
45 git checkout master
46 git pull --no-commit . "${CATPACK}"-import
47 mkdir "${CATPACK}"
48 for i in ${PACK}* ChangeLog Manifest metadata.xml files; do
49 if [[ -e $i ]]; then
50 git mv $i "${CATPACK}"/
51 fi
52 done

Attachments

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