scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more
https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
MIT License
2.82k stars 192 forks source link

update_scm_breeze giving a git protocol error #314

Closed AbdealiLoKo closed 2 years ago

AbdealiLoKo commented 2 years ago

I installed scm-breeze a few weeks ago. Recently raised the bug https://github.com/scmbreeze/scm_breeze/issues/313 which I see has been solved in master, So I thought - I need to upgrade to get it fixed for me.

I ran update_scm_breeze as was instructed in the README. And I get this error:

$ update_scm_breeze
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

I am using Windows 10 + Ubuntu 18.04 WSL2 I don't have issues with git in any of my other repos/projects - and I use git:// for all of them (I have a ed25519 SSH key setup)

Is there some special configuration update_scm_breeze needs ?

ghthor commented 2 years ago

If you look at the type for update_scm_breeze and read the source code for the function you'll see the steps that you need to take to update.

$ type update_scm_breeze 
update_scm_breeze is a function
update_scm_breeze () 
{ 
    currDir=$PWD;
    exec_scmb_expand_args builtin cd "$scmbDir";
    oldHEAD=$(git rev-parse HEAD 2> /dev/null);
    git pull origin master;
    source "$scmbDir/lib/scm_breeze.sh";
    _create_or_patch_scmbrc $oldHEAD;
    source "$scmbDir/scm_breeze.sh";
    exec_scmb_expand_args builtin cd "$currDir"
}

Do a quick check that the env variable is defined for scmbDir.

$ env | grep scmbDir
scmbDir=/home/ghthor/.scm_breeze
  1. cd "$scmbDir" to scm_breeze directory
  2. git pull origin master
  3. source "$scmbDir/lib/scm_breeze.sh"
  4. source "$scmbDir/scm_breeze.sh"

This step is unnecessary _create_or_patch_scmbrc $oldHEAD.

I am using Windows 10 + Ubuntu 18.04 WSL2 I don't have issues with git in any of my other repos/projects - and I use git:// for all of them (I have a ed25519 SSH key setup)

You should be using ssh:// or https:// with github repositories. See: https://github.blog/2021-09-01-improving-git-protocol-security-github/

If git pull origin master fails due to this error about unauthenticated git protocol usage you'll need to update git remote's URL.

$ cd "$scmbDir" && git remote set-url origin https://github.com/scmbreeze/scm_breeze
AbdealiLoKo commented 2 years ago

Seems like doing git remote set-url origin https://github.com/scmbreeze/scm_breeze worked.

Should the install instructions in the README be changed to: git clone https://github.com/scmbreeze/scm_breeze.git ~/.scm_breeze ?

Either way - it's working for me, thanks a lot !

ghthor commented 2 years ago

Yes, the README should be updated as it's using git:// good point.

ghthor commented 2 years ago

https://github.com/scmbreeze/scm_breeze/commit/62b73f7e78de9d73c72fc764bf28a025bdd9ec2d