Bug#471560: can't migrate to git-buildpackage when coming from a debian/-only history

2008-03-19 Thread Stefano Zacchiroli
severity 471560 wishlist
thanks

On Tue, Mar 18, 2008 at 11:39:21PM +0100, Stefano Zacchiroli wrote:
 More generally, also suggestions on how to fix the merge problem
 manually are totally welcome, I can contribute them back as a snippet
 for README.Debian if you want, but first I need to know the actual
 solution :-)

OK, here is the by hand solution for the problem (thanks to [1]
mainly):

  $ git-symbolic-ref HEAD refs/heads/upstream
  $ git rm --cached -r .
  $ git commit --alow-empty -m 'initial upstream branch'
  $ git checkout -f master
  $ git merge upstream
  $ # git-import-orig ../foo.tar.gz  now works!

Basically I'm creating a new empty branch called upstream without any
history, then I'm committing it ensuring that the corresponding tree
object is empty. At that point I can merge it easily in master. After
that git-import-orig at the next run will happily notice that, wow, the
new upstream release finally contain some code :)

So I guess this bug report turns into a feature request. Can you please
add a -f/--force flag to git-import-orig which does exactly the above in
case of missing upstream branch instead of failing?

Given that git-import-dsc can now be run also on top of pre-existing
repositories it would be wonderful to have the same behaviour also in
it.

TIA,
Cheers.

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

-- 
Stefano Zacchiroli -*- PhD in Computer Science ... now what?
[EMAIL PROTECTED],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



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#471560: can't migrate to git-buildpackage when coming from a debian/-only history

2008-03-19 Thread Guido Günther
Hi Stefano,
On Wed, Mar 19, 2008 at 03:39:24PM +0100, Stefano Zacchiroli wrote:
 So I guess this bug report turns into a feature request. Can you please
 add a -f/--force flag to git-import-orig which does exactly the above in
 case of missing upstream branch instead of failing?
This would be a --empty-upstream instead of --force but it's quiet
reasonable for svn converts.
 -- Guido



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#471560: can't migrate to git-buildpackage when coming from a debian/-only history

2008-03-18 Thread Stefano Zacchiroli
Package: git-buildpackage
Version: 0.4.21
Severity: normal

[ I guess this is somehow related to #411206, but from a twisted
perspective, hence I'm reporting a new bug ]

Executive summary
-

I have a git repository containing the history of a package *only* from
the point of view of the debian/ directory, upstream sources have never
been part of the history. Now I want to migrate to the usual
git-buildpackage layout. Apparently this is impossible^Whard to achieve
ATM.


Long story
--

I'm converting a Subversion repository (the one of the pkg-ocaml-maint
alioth project) to several git repositories. The svn repo was using the
debian only layouts supported by svn-buildpackage. I used to have
.orig.tar.gzs around which were supported by such a tool. Now that I
have git and its space efficiency, of course I want to have upstream
sources checked in the repo and use the usual master/upstream
branches.

Of course I started converting the old svn repo to git repos. The
resulting git repos have only master branch, with all the past
history, but are lacking the upstream branch.

Simply doing git-import-orig on top of the repo won't work as
git-buildpackage complains about missing upstream branch. Simply
creating it won't do either, as the following (I guess) is happening:

- I branch upstream from master
- I run git-import-orig
- git-import-orig observes a deletion of the debian/ dir from the
  upstream repo as part of the new tarball injection
- git-import-orig merges upstream with master and BOOM, I've just lost
  the debian/ dir as part of the merge

A working yet horrible solution I've found is to use git-filter-branch
on upstream to remove the debian/ dir. But this is horrible as the
history is duplicated in upstream and master, partly with the debian/
dir and partly without. I guess a git-rebase -i squashing everything
will fix that, but it still horrible.

I've noticed that git-import-dsc can now (after #432082 has been fixed)
be run on top of an already existing git repo, but it stills complain
about missing upstream branch and is prone to the same problem of
git-import-orig.

Maybe the easiest solution for fixing this problem is to hack
git-import-dsc so that it works also when upstream is lacking? (Though
even in this case I don't know how it can solve the problem that merge
blows away the debian/ dir ...)

More generally, also suggestions on how to fix the merge problem
manually are totally welcome, I can contribute them back as a snippet
for README.Debian if you want, but first I need to know the actual
solution :-)

Thanks for git-buildpackage!
Cheers.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages git-buildpackage depends on:
ii  devscripts   2.10.19 scripts to make the life of a Debi
ii  git-core 1:1.5.4.4-1 fast, scalable, distributed revisi
ii  python   2.4.4-6 An interactive high-level object-o
ii  python-support   0.7.7   automated rebuilding support for P

git-buildpackage recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]