ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Bloom-release: Cannot push to remote release repository. fatal: The current branch master has no upstream branch.

asked 2022-11-23 06:58:02 -0600

Roberto Z. gravatar image

updated 2022-11-23 07:11:28 -0600

Hello community,

I want to release a repository using bloom (first time) and I am following ROS2's official documentation: https://docs.ros.org/en/humble/How-To...

What I have done so far:
- Installed the tools required (python3-bloom python3-catkin-pkg)
- Created a release team
- Created a release repository
- Create a GIT access token to authenticate
- Created a 'bloom' file to use the GIT access token
- Create a ros/rosdistro source entry
- Generated a Changelog
- Bumped the package version using catkin_prepare_release

Then I executed:

bloom-release --new-track --rosdistro humble --track humble wall_follower_ros2

Which asked me to enter a release repository URL, which I did entering: https://github.com/ros2-gbp/wall_follower_ros2-release.git

And then I get prompt to enter the repository name, the repo URL, VSC type, among others (you can see values entered below).

My problem is that I get this error:

==> git push --dry-run
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

Cannot push to remote release repository.
Hint: If you just typed in your username/password and you have two-factor authentication,see:
  http://wiki.ros.org/bloom/Tutorials/GithubManualAuthorization

My guess is that this is related to the fact that locally I am on branch main and I don't have a master branch.

Output of git branch is:

*main

Output of git remote -v is:

origin  https://github.com/rfzeg/wall_follower_ros2.git (fetch)
origin  https://github.com/rfzeg/wall_follower_ros2.git (push)

I Googled it and I found this question that says regarding having having main as branch :

works OK for regular releases (as master will just be another branch to git and Github, and Bloom is able to find everything it needs just fine)

But I doesn't seem to work for me. What is it that I am doing wrong?

I really appreciate any help you can provide.

Roberto


Here are the lines of output of 'bloom-release` :

Release repository url [press enter to abort]: https://github.com/ros2-gbp/wall_follower_ros2-release.git
==> Fetching 'wall_follower_ros2' repository from 'https://github.com/ros2-gbp/wall_follower_ros2-release.git'
Cloning into '/tmp/tmp72wn05ft'...
warning: You appear to have cloned an empty repository.
WARNING [vcstools] Command failed: 'git checkout master'
 run at: '/tmp/tmp72wn05ft'
 errcode: 1:
error: pathspec 'master' did not match any file(s) known to git
[/vcstools]
Creating 'master' branch.
Creating track 'humble'...
Repository Name:
  <name>
    Name of the repository (used in the archive name)
  upstream
    Default value, leave this as upstream if you are unsure
  ['upstream']: wall_follower_ros2
Upstream Repository URI:
  <uri>
    Any valid URI. This variable can be templated, for example an svn url
    can be templated as such: "https://svn.foo.com/foo/tags/foo-:{version}"
    where the :{version} token will be replaced with the version for this release.
  [None]: https://github.com/rfzeg/wall_follower_ros2
Upstream VCS Type:
  git
    Upstream URI is a git repository
  hg
    Upstream URI is a hg repository
  svn
    Upstream URI is a svn repository
  tar
    Upstream URI is a tarball ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-23 09:50:13 -0600

gvdhoorn gravatar image

updated 2022-11-23 10:04:04 -0600

Bloom likely expects/assumes/requires a non-empty release repository.

"Non-empty" meaning: a repository with at least one branch in it.

ros2-gbp/wall_follower_ros2-release does not contain any branch, hence the error message.

I'd suggest doing something like:

git clone https://github.com/ros2-gbp/wall_follower_ros2-release.git /tmp/ros2-gbp/wall_follower_ros2-release
cd /tmp/ros2-gbp/wall_follower_ros2-release
# if needed:
# git config --local user.name ... && git config --local user.email ...
git commit --allow-empty -m "Initial commit"
git push origin master  # or whatever you have as default branch

It should start working after this.

edit flag offensive delete link more

Comments

Hello @gvdhoorn, thank you for your answer. I did as described in your answer but I didn't work. Any thoughts? This is what I did:

user:~/ros2_ws/src/wall_follower_ros2$ cd ..
user:~/ros2_ws/src$ git clone https://github.com/ros2-gbp/wall_follower_ros2-release.git
Cloning into 'wall_follower_ros2-release'...
warning: You appear to have cloned an empty repository.
user:~/ros2_ws/src$ cd wall_follower_ros2-release/
user:~/ros2_ws/src/wall_follower_ros2-release$ git commit --allow-empty -m "Initial commit"
[main (root-commit) 8b1bd57] Initial commit
user:~/ros2_ws/src/wall_follower_ros2-release$ git push origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/ros2-gbp/wall_follower_ros2-release.git'
user:~/ros2_ws/src/wall_follower_ros2-release$ git branch
* main
Roberto Z. gravatar image Roberto Z.  ( 2022-12-08 06:22:46 -0600 )edit

It managed to get past the point where bloom-release was failing before. I followed @gvdhoorn advice with one small change:
Once, inside the cloned wall_follower_ros2-release repository I had to create and switch to the master branch before creating the empty commit. Like so:

cd wall_follower_ros2-release/
git branch master
git switch master
Switched to branch 'master'
git commit --allow-empty -m "Initial commit"

Now bloom-release is failing with the message:

Bloom requires a version 4 or greater rosdistro index to support package format 3.
<== Error running command '['/usr/bin/git-bloom-generate', '-y', 'rosdebian', '--prefix', 'release/humble', 'humble', '-i', '1', '--os-name', 'ubuntu']'
Release failed, exiting.

Regardless I will mark this answer as correct since it pointed to the solution, and the error now is a different one. I will post a new question regarding the new error message. Thanks you @gvdhoorn !

Roberto Z. gravatar image Roberto Z.  ( 2022-12-08 07:04:49 -0600 )edit

From the git output:

[main (root-commit) 8b1bd57] Initial commit

you can see that main is actually the branch that was created/is the default.

That's why I added the comment:

# or whatever you have as default branch

I would expect a git push origin main to have worked. Bloom would most likely have complained there was no master branch, but would then have created it.

Explicitly creating a master branch and then pushing it obviously also works.

gvdhoorn gravatar image gvdhoorn  ( 2022-12-08 10:45:35 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-11-23 06:58:02 -0600

Seen: 211 times

Last updated: Nov 23 '22