vcstool icon indicating copy to clipboard operation
vcstool copied to clipboard

validate fails with commit hash

Open FabienDanieau opened this issue 11 months ago • 4 comments

With the example file repos.test :

repositories:
  vcs:
    type: git
    url: https://github.com/dirk-thomas/vcstool.git
    version: daf389377310f7f31b2171f51a79af82c31bf3e2

The validate command fails

$ vcs validate --input repos.test
=== vcs (git) ===
Invocation of command 'validate' on client 'git' failed: UnboundLocalError: cannot access local variable 'version_type' where it is not associated with a value (/usr/lib/python3/dist-packages/vcstool/clients/git.py:744)

While a clone works just fine

$ vcs import --input repos.test test/
=== test/vcs (git) ===
Clonage dans '.'...
Note : basculement sur 'daf389377310f7f31b2171f51a79af82c31bf3e2'.

Note that the validate works with tags if the commit hash is changed by 0.3.0

$ vcs validate --input repos.test
=== vcs (git) ===
Found git repository 'https://github.com/dirk-thomas/vcstool.git' with tag '0.3.0'

FabienDanieau avatar Feb 29 '24 21:02 FabienDanieau

#239 might fix this. Can you try it out? You should be able to install the version from that PR like this:

pip3 install git+https://github.com/furushchev/vcstool@fix-validate-git-hash

christophebedard avatar Feb 29 '24 22:02 christophebedard

#239 might fix this. Can you try it out? You should be able to install the version from that PR like this:

pip3 install git+https://github.com/furushchev/vcstool@fix-validate-git-hash

Yes it works thank you. Any plan to merge this soon?

FabienDanieau avatar Mar 01 '24 09:03 FabienDanieau

I don't know. vcstool is in no/low maintenance mode (see #242), so I don't know when that will get merged.

christophebedard avatar Mar 01 '24 18:03 christophebedard

This was solved in vcstool2, my fork of vcs.

MaxandreOgeret avatar Aug 25 '24 12:08 MaxandreOgeret