Stefano Zacchiroli | 19 Mar 10:25
Favicon

switching versioning from distro only to distro+upstream

[ the technical aspect of the problem I'm describing is debian+git
specific, but the conceptual problem is applicable to every
distro/$DVCS, I guess ]

I've a git repository which has been used to version only the debian/
dir thus far [1]. Now that we have git and its space efficiency, I want
to version both upstream sources and the debian dir in the very same
system. The usual layout supported by git-buildpackage (but I guess one
of the obvious layout) is to have two branches, an "upstream" branch
with upstream source only and a "master" branch (which I believe is the
one called informally "integration" branch) with both upstream sources +
the debian/ dir.

Moving to what I have (i.e. just a single "master" branch) to such a
layout ain't easy apparently. The key problem is: how to generate from
scratch an upstream branch which only contains upstream sources.

The naive solution (which is actually what git-buildpackage tries to do
when using git-import-orig/dsc) of branching off an upstream branch from
the master branch and then deleting the debian/ dir does not work, as
when we try to merge usptream back into master git will merge even the
deletion of the debian/ dir.

Ideally I should be branching the root of the commit dag, but
unfortunately even that has a debian/ dir which has been added as the
first commit (and no, at least in git there is no such a think as the
parent of the commit dag root, I've tried that :)).

I've found some ugly solution using git-filter-branch on an upstream
branch branched from master, but the resulting history is horrible.
(Continue reading)

James Westby | 19 Mar 10:39

Re: switching versioning from distro only to distro+upstream

On Wed, 2008-03-19 at 10:28 +0100, Stefano Zacchiroli wrote:
> What I would need is the ability to create a separate history line from
> scratch, call it "usptream", tie it with the master history with a new
> (fake) commit root, and then merge the two into master. Is that possible
> with git or some other $DVCS?

git itself has this in it's history with the "todo" branch. 
Unfortunately, I can't find you a reference to the instructions to do
this at the moment, perhaps someone else can provide them.

Thanks,

James
Jan Luebbe | 19 Mar 11:38

Re: switching versioning from distro only to distro몛ⶭ

I don't have much time now, but something like this should work

Make a new repo:
cd foo-new
git init

Make the old stuff available:
git remote add old ../foo
git fetch old

Import the first upstream source:
tar xf ../tarballs/foo_0.1.origtar.gz --strip 1
git add .
git commit -a -m 'Import upstream snapshot 0.1'
git tag upstream/0.1

Import second and following sources:
for i in $(ls -A); do if [ "$i" != ".git" ]; then rm -rf $i; fi done
tar xf ../tarballs/foo_0.2.origtar.gz --strip 1
git add .
git commit -a -m 'Import upstream snapshot 0.2'
git tag upstream/0.2

Rename the branch:
git branch -m upstream

Create master branch:
git checkout -b master upstream/0.1

Show all tags:
(Continue reading)

martin f krafft | 19 Mar 11:49
Favicon

Re: switching versioning from distro only to distro+upstream

also sprach Stefano Zacchiroli <zack <at> debian.org> [2008.03.19.1028 +0100]:
> I've a git repository which has been used to version only the debian/
> dir thus far [1]. Now that we have git and its space efficiency, I want
> to version both upstream sources and the debian dir in the very same
> system.

Doesn't http://madduck.net/blog/2007.10.03:packaging-with-git/ do
exactly this? It doesn't use git-buildpackage though.

> What I would need is the ability to create a separate history line
> from scratch, call it "usptream", tie it with the master history
> with a new (fake) commit root, and then merge the two into master.
> Is that possible with git or some other $DVCS?

http://madduck.net/blog/2007.07.11:creating-a-git-branch-without-ancestry/

--

-- 
 .''`.   martin f. krafft <madduck <at> debian.org>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems

"stab it and steer"
                                                             -- sailor
_______________________________________________
vcs-pkg-discuss mailing list
vcs-pkg-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/vcs-pkg-discuss
(Continue reading)

Stefano Zacchiroli | 19 Mar 16:49
Favicon

Re: switching versioning from distro only to distro+upstream

Thanks to all who have replied, with the branch with no ancestry trick
I've indeed solved the issue.

--

-- 
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{upsilon.cc,cs.unibo.it,debian.org}  -<%>-  http://upsilon.cc/zack/
(15:56:48)  Zack: e la demo dema ?    /\    All one has to do is hit the
(15:57:15)  Bac: no, la demo scema    \/    right keys at the right time
_______________________________________________
vcs-pkg-discuss mailing list
vcs-pkg-discuss@...
http://lists.alioth.debian.org/mailman/listinfo/vcs-pkg-discuss

Gmane