dirk-thomas / vcstool

Vcstool is a command line tool designed to make working with multiple repositories easier
Apache License 2.0
410 stars 86 forks source link

validate fails with commit hash #271

Open FabienDanieau opened 6 months ago

FabienDanieau commented 6 months ago

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'
christophebedard commented 6 months ago

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
FabienDanieau commented 6 months ago

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?

christophebedard commented 6 months ago

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

MaxandreOgeret commented 3 weeks ago

This was solved in vcstool2, my fork of vcs.