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

Which workspace files belong in version control?

asked 2019-09-14 11:00:37 -0500

rgov gravatar image

I ran catkin_make to set up a Catkin workspace, and it created build, devel, and src directories. I checked devel and src into Git.

Now I'm less sure about devel, because the files contain paths that are specific to my system.

I recognize that most of the time you would want to put each package in a separate repo, but in this case I would like to just have a repo for my workspace, because it is just tutorial code that is not reusable.

edit retag flag offensive close merge delete

Comments

Please see whether #q264600 (or any of the linked Q&As there) answer your question.

If it does, please close this as a duplicate.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-14 11:03:25 -0500 )edit

@gvdhoorn Thanks for the pointers. I didn't see any of them that address whether devel should be in version control.

rgov gravatar image rgov  ( 2019-09-14 11:39:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-09-14 11:56:27 -0500

gvdhoorn gravatar image

A few of the Q&As I linked in my comment state that it's not recommended to version complete workspaces. If you want to distribute sets of packages, put them in a single repository, or use a tool like wstool to clone them all with a single command.

All of that is preferable over versioning workspaces, as there are literally no advantages over putting related packages into a single repository. The src space is just an empty directory (the CMakeLists.txt in there (if using catkin_make) is a link, and is machine and ROS version specific), and it doesn't matter whether you have sub directories in catkin_ws/src containing packages, or whether the package directories are in catkin_ws/src directly.

in this case I would like to just have a repo for my workspace, because it is just tutorial code that is not reusable.

I don't understand how this is a rationale for wanting to version an entire src space.

Now I'm less sure about devel, because the files contain paths that are specific to my system.

To make it explicit: no top-level directories from a Catkin workspace should be versioned directly (so neither src, nor devel, build or install). Only sub directories of the src space would make sense.

If you absolutely must, you could add an empty src directory as the root of your repository and place your packages in there. As you shouldn't version the CMakeLists.txt link there (see earlier comment), it will just be a directory named src. That doesn't make it a Catkin source space though.

edit flag offensive delete link more

Comments

Ok, thanks for the explicit answer.

I was a little surprised that just putting multiple packages in the top level of my repository and then cloning it into my (non-version controlled) workspace's src/ directory worked at all, without a CMakeLists.txt. But Catkin seems to handle this case correctly.

rgov gravatar image rgov  ( 2019-09-14 14:17:39 -0500 )edit

The tool just recursively searches for packages.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-14 14:42:42 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-09-14 11:00:37 -0500

Seen: 328 times

Last updated: Sep 14 '19