rmuslimov / browse-at-remote

Browse target page on github/bitbucket from emacs buffers
232 stars 53 forks source link

Break `git remote` output at line boundaries. #83

Closed jimblandy closed 1 year ago

jimblandy commented 3 years ago

The prior version of this function uses (s-split "\\W+" remotes) to turn the output from git remote into a list of remote names, but "\W+" matches any run of characters that is not a word constituent, including '-', so remote names containing hyphens get broken into two strings. git remote prints one remote name per line, so breaking on lines makes more sense.

For example (strictly hypothetically), suppose we have:

$ git remote
gfx-rs
jimblandy
kvark
$

In the prior code, this produces the list:

("gfx" "rs" "jimblandy" "kvark")

and things don't end well. Breaking on lines produces:

("gfx-rs" "jimblandy" "kvark")
rmuslimov commented 1 year ago

Thanks for fixing @jimblandy !