openSUSE / osc

The Command Line Interface to work with an Open Build Service
http://openbuildservice.org/
GNU General Public License v2.0
170 stars 185 forks source link

osc refuses to checkout a package with "Install the obs-scm-bridge package to work on packages managed in scm (git)!" #1623

Open smithfarm opened 2 months ago

smithfarm commented 2 months ago

Describe the bug

osc refuses to checkout a package that is managed by git, even though the sources are present on the source server:

$ osc co foo:bar baz
Install the obs-scm-bridge package to work on packages managed in scm (git)!
$ echo $?
1

This is a bug, because there are valid use cases for checking out sources from an OBS instances even when the package in question is maintained in git. For example, someone might want to simply look at the sources that are stored on the OBS source server. Or they might want to repeatedly run osc buildinfo as this is much more convenient from within a checkout.

One can make the error go away by installing the package (as called for by the error message), but all this does is make the error go away. The functionality is the same.

Versions

Expected behavior

The checkout should succeed, allowing the user to peruse the sources as stored on the OBS source server.

Additional context

One obvious way to fix the bug would be to adjust the error handling in osc so the error is displayed only on operations that really do require the obs-scm-bridge package.

Another (perhaps easier) way to fix it would be to add a Requires: osc-scm-bridge to osc.spec.

adrianschroeter commented 2 months ago

we can add an option to checkout classic scm files nevertheless, without checking for the bridge.

However, I would not promote this in the error message, since it would result in a different representation of the checkout and when the user is then trying to commit modifications it would fail. So this would be an expert-only with internal knowledge of implementation feature.

adrianschroeter commented 2 months ago

https://github.com/openSUSE/osc/pull/1624

adrianschroeter commented 2 months ago

We should add a

Recommends: obs-scm-bridge

to osc that the bridge is installed by default independ of this.

mlschroe commented 2 months ago

The "commit modifications" argument does not fly in my opinion. If you have a "subdir" in the scm url there will be no .git directory and thus you cannot contribute anyway. It only makes sense in one specific use case.