spr icon indicating copy to clipboard operation
spr copied to clipboard

`git-spr --version` etc., working outside of

Open ggoretkin-bdai opened this issue 2 years ago • 2 comments

Not in a git repo:

/tmp$ git-spr --version
git error: fatal: not a git repository (or any of the parent directories): .git

In a git repo without .spr.yml

/tmp/testrepo$ git init
Initialized empty Git repository in /tmp/testrepo/.git/
/tmp/testrepo$ git-spr --version
rake: config file /tmp/testrepo/.spr.yml not found
unable to auto configure repository owner - must be set manually in .spr.yml

ggoretkin-bdai avatar Jun 12 '23 20:06 ggoretkin-bdai

I hit the same bug. And for me it seems to be because username contains '-' As the GitHub states when you create new account

Username may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen.

https://github.com/ejoffe/spr/blob/master/config/config_parser/remote_source.go#L48 regex is

repoFormat := `(?P<githubHost>[a-z0-9._\-]+)(/|:)(?P<repoOwner>\w+)/(?P<repoName>[\w-]+)`

and it has only \w -> word characters (== [0-9A-Za-z_]) for the repoOwner

visma-alexander-maslov avatar Feb 06 '24 14:02 visma-alexander-maslov

#393 seems address this

visma-alexander-maslov avatar Mar 13 '24 06:03 visma-alexander-maslov