Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catkin_prepare_release fails #463

Closed
ahendrix opened this issue Jul 9, 2013 · 16 comments
Closed

catkin_prepare_release fails #463

ahendrix opened this issue Jul 9, 2013 · 16 comments
Assignees

Comments

@ahendrix
Copy link

ahendrix commented Jul 9, 2013

catkin_prepare_release fails on my repository:

pr2_mechanism $ catkin_prepare_release 
Repository type: git
Found packages: pr2_controller_manager, pr2_mechanism_diagnostics, pr2_controller_interface, pr2_mechanism, pr2_hardware_interface, pr2_mechanism_model
Warning: the following packages do not have a changelog file or entry for the to be released version: pr2_controller_interface, pr2_controller_manager, pr2_hardware_interface, pr2_mechanism, pr2_mechanism_diagnostics, pr2_mechanism_model
Continue without changelogs [y/N]?y
Bump version from 1.8.4 to 1.8.5
Committing the package.xml files...
[hydro-devel 8b2d3a2] 1.8.5
 6 files changed, 6 insertions(+), 6 deletions(-)
Tagging the repository...
Could not determine git remote: Command '['/usr/bin/git', 'config', '--get', 'branch.hydro-devel.remote']' returned non-zero exit status 1

For reference:

$ git remote -v
origin  git@github.com:PR2/pr2_mechanism.git (fetch)
origin  git@github.com:PR2/pr2_mechanism.git (push)
$ git branch
  beltcomp
  beltcomp_cturtle
  ft_sensor
* hydro-devel
  master
  online_cal
  pr2_mechanism-1.0
  pr2_mechanism-1.2
  pr2_mechanism-1.4
  pr2_mechanism-1.5
  pr2_mechanism-1.6
  shadowint

There is no confirmation step and no obvious message indicating what when wrong or what I can do to fix it, so I've now burned three minor release numbers fighting this. :(

@dirk-thomas
Copy link
Member

Can you please post the output and return code of these two commands:

git rev-parse --abbrev-ref HEAD
git config --get branch.hydro-devel.remote

Btw. catkin_prepare_release (the current version) will not push to your GBP repo. So you are free to reset the changes and try again without requiring to bump the version number multiple times.

@ahendrix
Copy link
Author

ahendrix commented Jul 9, 2013

$ git rev-parse --abbrev-ref HEAD
hydro-devel
$ echo $?
0
$ git config --get branch.hydro-devel.remote
$ echo $?
1

I suspect there's something wrong with the way this git repo is set up; it has had some adventures.

I was able to rewrite my commit history and remove the extra versions and tags.

@dirk-thomas
Copy link
Member

I don't know what would causes the git config line to fail. Please provide the output of:

git config --list

@ahendrix
Copy link
Author

ahendrix commented Jul 9, 2013

I fixed the git config line by setting my local branch to track an upstream branch, with:

$ git branch hydro-devel --set-upstream remotes/origin/hydro-devel
$ git config --get branch.hydro-devel.remote
origin

Suggest you make this check before making changes to the repository and explicitly warn the user about it.

@dirk-thomas
Copy link
Member

What check should catkin_prepare_release perform? I could only imagine a better error message if the command files - something like "check if the current branch is tracking an upstream branch".

@dirk-thomas
Copy link
Member

I will try to move the check to be performed earlier in the script. And add a custom error message...

@ahendrix
Copy link
Author

ahendrix commented Jul 9, 2013

That would be great; thanks!

@dirk-thomas
Copy link
Member

Well, which version of catkin are you using?

The current one (0.5.69) does either not push at all (so doesn't need to check) if invoked without any args; or if invoked with --push performs the check if pushing is possible before doing any modifications to the repo.

@ahendrix
Copy link
Author

ahendrix commented Jul 9, 2013

I'm using version 0.5.69 from debs, and invoking it without any arguments.

$ dpkg -l ros-hydro-catkin
...
ii ros-hydro-catkin 0.5.69-0precise-20130705-2354-+0000 Low-level build system macros and infrastructure for ROS.

@dirk-thomas
Copy link
Member

I see, it fails for you while generating the command lines which would need to be executed manually afterwards. I will create a patch which adds a comment like

May be the branch '%s' is not tracking a remote branch?

to the raised exception.

@ghost ghost assigned dirk-thomas Jul 9, 2013
@130s
Copy link
Member

130s commented Oct 21, 2015

I've faced this issue multiple times still occurs to me when I create a new branch, push it to the origin, then run catkin_prepare_release. Every time I came back to #463 (comment) and run those commands.

Assuming this is git's default behavior and out of catkin_prepare_release's scope to provide further care, where's a good place to add comments/document for that?

$ dpkg -p ros-indigo-catkin |grep Ver
Version: 0.6.15-0trusty-20150921-0207-+0000

@130s 130s reopened this Oct 21, 2015
@dirk-thomas
Copy link
Member

Please post much more information about the problem you are having (e.g. which repos, what is the state of the working copy, what commands do you run, what is the complete output of it, eventually further information about the git state).

@130s
Copy link
Member

130s commented Oct 21, 2015

Ok next time the same issue occurs I'll post more info before I apply workaround.

@130s 130s closed this as completed Oct 21, 2015
@djiglesias
Copy link

As of November 2017 the --set-upstream flag has depreciated. To set your current branch to be tracked for changes you can use --track instead.

$ git branch hydro-devel --track remotes/origin/hydro-devel

@130s
Copy link
Member

130s commented Mar 27, 2018

To set your current branch to be tracked for changes you can use --track instead.

Might not be the cace on Trusty yet? I get an error so still used --set-upstream (in the following case, hydro-devel already exists on remote).

git branch hydro-devel --track remotes/origin/hydro-devel
fatal: A branch named 'hydro-devel' already exists.

$ apt-cache policy git
git:
  Installed: 1:1.9.1-1ubuntu0.7
  Candidate: 1:1.9.1-1ubuntu0.7
  Version table:
 *** 1:1.9.1-1ubuntu0.7 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1:1.9.1-1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
$ git --version
git version 1.9.1

@dirk-thomas
Copy link
Member

@djiglesias @130s If you are having an issue please create a new ticket for it with sufficient information to reproduce and consider proposing a fix. Commenting on an issue which has been closed for several years will likely not get any attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants