Hi Jonathan,
On Mon, Jan 17, 2011 at 10:01:46PM -0600, Jonathan Nieder wrote:
> Package: git-buildpackage
> Version: 0.5.17
> 
> Trying to import history of a Debian package from a git clone
> of the upstream repo:
> 
>  $ git import-dsc ../source-libwpd/libwpd_0.7.2-1.dsc 
>  gbp:info: Tag upstream/0.7.2 not found, importing Upstream tarball
>  fatal: Needed a single revision
>  gbp:error: Git command failed: can't find SHA1 for upstream
> 
> Two problems:
> 
>  1) the error message from rev-parse --verify is not so useful.
Agreed.

>  2) it's not clear to me why git-buildpackage wants the
>     'upstream' rev in the first place.  Couldn't it create
>     the branch itself?
Creating this automatically might make sense but where would we branch
that off? We should be able to distinguish this from a usage error like
trying to import a non native package into the repo of a Debian native
package. Maybe we should just print a more verbose error message and
point the user to the right docs?

> import-orig gives a friendlier message:
> 
>  $ git import-orig ../source-libwpd/libwpd_0.7.2.orig.tar.gz
>  gbp:error: 
>  Repository does not have branch 'upstream' for upstream sources. If there is 
> none see
>  
> file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.CONVERT
>  on howto create it otherwise use --upstream-branch to specify it.
> 
> Side note: instead of an upstream/0.7.2 tag, this repo has
> 
>  LIBWPD-0-8-0
>  LIBWPD-0-8-2
>  RELEASE-0-3-0
> [...]
>  RELEASE-0-6-3
>  RELEASE-0-7-1
>  RELEASE-0-7-2
> [...]
>  RELEASE-0-9-0
>  libwpd-0-6-2
>  release-0-7-0
>  release-0-8-1
>  start
Hmm...we could add transform capabilities to build_tag but I wonder if
retagging with upstream/<..> isn't simpler?

> Patch to somewhat mitigate (1) follows.  It might also make sense to
> use --quiet unconditionally.
Yes, gbp is lacking --quiet in quite some places, I recently added it to
force_head and we should also do this for rev_parse. I've fixed this in
my local tree.

> -- 8< --
> Subject: Use terminology more consistent with git
> 
> When an operation fails due to an unexpectedly absent git
> rev, gbp writes
> 
>  fatal: Needed a single revision
>  gbp:error: Git command failed: can't find SHA1 for upstream
> 
> At first glance it is not obvious that these two messages
> have much to do with each other.  Follow the git terminology:
> 
>  fatal: Needed a single revision
>  gbp:error: Git command failed: revision 'upstream' not found
Yes, this makes more sense. 

> to make what happened a little clearer.
> ---
> diff --git a/gbp/git.py b/gbp/git.py
> index 9fac3ba..26e2728 100644
> --- a/gbp/git.py
> +++ b/gbp/git.py
> @@ -331,7 +331,7 @@ def rev_parse(self, name, quiet=False):
>              args.insert(0, "--quiet")
>          sha, ret = self.__git_getoutput('rev-parse', args)
>          if ret:
> -            raise GitRepositoryError, "can't find SHA1 for %s" % name
> +            raise GitRepositoryError, "revision '%s' not found" % name
>          return sha[0].strip()
Appied. Thanks,
 -- Guido



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to