Package: devscripts
Version: 2.25.1
Severity: normal

Hi,

I'm trying to run this:

    salsa rename_branch debian/box64 --source-branch=master 
--dest-branch=debian/latest

This gives me a nonzero exit status and prints the following to stdout:

    salsa warn: Project debian/box64 not found
    salsa warn: Branch rename has failed for debian/box64 (missing ID)

It says that the project was not found. This is wrong. There can be a number of
reasons why this fails and running the above with --debug let me discover a few
of the possible reasons:

salsa debug: Error GETing 
https://salsa.debian.org/api/v4/projects/debian%2Fbox64 (HTTP 401): 
Unauthorized {"error":"invalid_token","error_description":"Toke... at 
/usr/share/perl5/Devscripts/Salsa.pm line 363.

salsa debug: Error GETing 
https://salsa.debian.org/api/v4/projects/debian%2Fbox64 (HTTP 403): Forbidden 
{"error":"insufficient_scope","error_description":... at 
/usr/share/perl5/Devscripts/Salsa.pm line 363.

salsa info: Error POSTing 
https://salsa.debian.org/api/v4/projects/71009/repository/branches (HTTP 400): 
Bad Request {"message":"Branch already exists"} at 
/usr/share/perl5/Devscripts/Salsa/rename_branch.pm line 26.

salsa info: Error DELETEing 
https://salsa.debian.org/api/v4/projects/71009/repository/branches/master (HTTP 
400): Bad Request {"message":"7:deletion denied by access checks: ru... at 
/usr/share/perl5/Devscripts/Salsa/rename_branch.pm line 32.

So the salsa tool *does* know why it fails but it doesn't print the reason to
the user unless --debug is passed. Is that intentional? I think the salsa tool
should instead:

 - point out that the token was invalid
 - inform that the scope was insufficient (what is the required scope? Not even 
the man page says that)
 - report that the target branch already exists
 - print that... i don't know, the debug message is cut off in the middle??

But what it does is to tell me "Project not found". This is misleading.

Please consider to instead print the real reason why the command failed to the
user.

Thanks!

cheers, josch

Reply via email to