RichiH/vcsh

When ssl validation fails vcsh assumes remote is empty

Closed this issue · 6 comments

Requirement to recreate: No ca-certificates are installed:
# vcsh clone https://github.com/RichiH/zshrc.git
Initialized empty shared Git repository in /root/.config/vcsh/repo.d/zshrc.git/
Switched to a new branch 'master'
vcsh: info: remote is empty, not merging anything.
You should add files to your new repository.

Seems like successful clone (of an empty repo), but
# vcsh pull
zshrc: fatal: unable to access 'https://github.com/RichiH/zshrc.git/': Problem with the SSL CA cert (path? access rights?)

shows the error.
IMHO VCS should throw that error on initial clone.

Hum, it failed and outputs this : vcsh: info: remote is empty, not merging anything..

The culprit is there : https://github.com/RichiH/vcsh/blob/master/vcsh#L156. I think we should probably check/handle/output some errors instead of throwing anything to /dev/null.

@RichiH What do you think ?

@momorientes What return code does git ls-remote https://github.com/RichiH/zshrc.git/ master give you in that case?

FWIW, with a non-existing URL, it returns 128

@vdemeester The cleanest solution is probably to run git ls-remote right after the pre-clone hook.

@RichiH it exits with 128

#git ls-remote https://github.com/RichiH/zshrc.git/ master
fatal: unable to access 'https://github.com/RichiH/zshrc.git/': Problem with the SSL CA cert (path?   access rights?)
#echo $?
128

@momorientes @vdemeester Did either of you test this?

Ugh. I just hit this two year-old issue on a fresh Ubuntu install. It must be the case that either:

  • The most recent stable release of vcsh (i.e., 1.20151229-1) exhibits this open issue, despite this issue having purportedly been resolved by bf2c843.
  • This issue has not actually been resolved by bf2c843.

If the former is the case, the real issue is that vcsh has failed to received a stable release for nearly two years. That's bad, but trivially resolved by releasing a new stable version. Would that be feasible, @RichiH? I suspect you're pressed for time and don't have terribly much to devote to vcsh anymore – but vcsh deserves better than this.

If the latter is the case, this issue has been unresolved for nearly two years. That's also bad, but less trivially resolved.

@leycec As per #161 (comment) , did you confirm that this fixes the issue?