Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-scm
Navigation:
Lists: gentoo-scm: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-scm@g.o
From: Justin <justin@...>
Subject: Re: 'overlays' are altenatives to full tree clone
Date: Fri, 17 Apr 2009 08:48:01 +0200
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

Attachment:
signature.asc (OpenPGP digital signature)
References:
'overlays' are altenatives to full tree clone
-- Caleb Cushing
Re: 'overlays' are altenatives to full tree clone
-- Donnie Berkholz
Navigation:
Lists: gentoo-scm: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: 'overlays' are altenatives to full tree clone
Next by thread:
Converting a recent CVS copy - Item 1: mailmap fun
Previous by date:
Re: Converting a recent CVS copy - Item 3: pushing, availability
Next by date:
Re: Converting a recent CVS copy - Item 3: pushing, availability


Updated Jun 17, 2009

Summary: Archive of the gentoo-scm mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.