On Sun, May 13, 2012 at 08:57:34PM +0200, Daniel Dehennin wrote: > Guido Günther <a...@sigxcpu.org> writes: > > > [...] > > >> - # FIXME: When creating a new package: find merge base > >> between HEAD and origin > >> - since = repo.find_version(options.debian_tag, > >> cp['Version']) > >> + # Take care of newly created debian/changelog > >> + if hasattr(cp, 'first') and cp.first: > > > > Hmm...where is first being set? I cloned > > > > git://git.baby-gnu.org/git-buildpackage > > tags/dad/create-inexistant-changelog/rebasable/on-f495df9-1 > > > > and couldn't find it at a first glance. > > I did it in gbp.deb.Changelog.create. > > I was thinking about adding a "first=Fales" parameter to > Changelog.__init__ and make Changelog.create using True. > > But this seems to be a "private" attribute, I don't like the idea of > exposing it in __init__ signature.
Can you point me to your tree that uses the first attribute? > > Maybe doing "self._first = False" in Changelog.__init__ and > Changelog.create set it to True is a better idea, no need call hasattr. > > > > > > >> + pattern = options.upstream_tag % dict(version='*') > >> + try: > >> + upstream = repo.find_tag('HEAD', pattern=pattern) > >> + except GitRepositoryError: > >> + gbp.debug('No upstream tag found') > >> + upstream = options.upstream_branch > >> + if options.upstream_tree == 'branch': > >> + upstream = options.upstream_branch > >> + since = repo.get_merge_base('HEAD', upstream) > > > > Need to catch exception if no merge base is found. > > I'm not sure, if we don't find a merge base there is nothing we can do. > > The user may set a wrong upstream-branch name in its gbp.conf, I think > the most significant thing to do is to report the > "GitRepositoryError: Failed to get common ancestor: fatal: Not a valid object > name XXXX" O.k. then. Just wanted to make sure you don't want to fall back to other heuristics in that case. Cheers, -- Guido -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org