#791628 Make suggestions when config file options are wrong

#791628#5
Date:
2015-07-06 23:17:36 UTC
From:
To:
First, please DO NOT CLOSE THIS until it is fully clarified. Just don't!
It's insulting, even if you know immediately what the problem is; if
your docs don't make it clear to the user then your docs suck.

I tried to follow
file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.UPSTREAM-GIT
and switched from the old tar-imported upstream branch to upstream
repository on Github (upstream author moved a few months ago).
Checking the documentation, I figured it's a good idea to add:
git-upstream-tag='v%(version)s'
to debian/gbp.conf in order to not write it down again and again.

Result:
$ gbp buildpackage --git-pristine-tar --git-pristine-tar-commit
...
gbp:info: Orig tarball 'encfs_1.8.1.orig.tar.xz' not found at '../tarballs/'
gbp:warning: Pristine-tar branch "pristine-tar" not found
gbp:error: Pristine-tar couldn't checkout "encfs_1.8.1.orig.tar.xz": fatal: Path 'encfs_1.8.1.orig.tar.xz.delta' does not exist in 'refs/remotes/origin/pristine-tar'
pristine-tar: git show refs/remotes/origin/pristine-tar:encfs_1.8.1.orig.tar.xz.delta failed
gbp:error: upstream/1.8.1 is not a valid treeish

I tried this and that and couldn't see the reason. The message is IMHO
kinda pointless; why does it not simply commit as it's told by the
command line? As the final guess I added
--git-upstream-tag='v%(version)s' to the command line and it suddenly
worked. So it looks like the option is not read from gbp.conf. How
should I know that? gbp.conf(5) does not tell me which ones are valid
there and which are not.

Out of blue, I added git-pristine-tar and git-pristine-tar-commit there
and got:
gbp:error: File contains parsing errors: /home/user/debian/dev/encfs/debian/gbp.conf
	[line  5]: 'git-pristine-tar\n'
	[line  6]: 'git-pristine-tar-commit\n'

PARSING ERRORS? Seriously?

Or maybe something is not applicable in the DEFAULT section? Even if
that assumption is correct, the message should be something meaningful
and not a bogus "parsing error".

Regards,
Eduard.

#791628#10
Date:
2015-07-07 05:12:16 UTC
From:
To:
The docs say:

    All options in the config files are specified without the 'git-'
    prefix.

under "Configuation Files" of the man page. There are also examples
around that document the format. Use these and all the above will again
turn into non issues.

I recommend to read an respect the references at

     /usr/share/doc/reportbug/HowToReportGoodBugs.txt

so I can figure out what exactly you have issues with.
at
Cheers,
 -- Guido

#791628#15
Date:
2015-07-07 07:12:07 UTC
From:
To:
Hallo,
* Guido Günther [Tue, Jul 07 2015, 07:12:16AM]:

Okay. What about helping the user a little bit? This seems to be a good
practice nowadays (have a look at git, for example). Haven't looked at
your code yet but it should be a three-liner in Python, something like:

if (foo not in dictionary AND foo.startsWith("git-") AND foo.substr(4) is in dictionary)
print "Unable to parse " + foo + ", did you mean " + foo.substr(4)
fi

Sorry, not all of them.

$ gbp buildpackage
gbp:error: File contains parsing errors: /home/user/debian/dev/encfs/debian/gbp.conf
	[line  5]: 'pristine-tar\n'
	[line  6]: 'pristine-tar-commit\n'
http://anonscm.debian.org/cgit/collab-maint/encfs.git/log/?h=debian/sid
And the repro step should be simply running "gbp buildpackage".

Regards,
Eduard.