browse-at-remote icon indicating copy to clipboard operation
browse-at-remote copied to clipboard

Break `git remote` output at line boundaries.

Open jimblandy opened this issue 3 years ago • 0 comments

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")

jimblandy avatar Jun 22 '21 21:06 jimblandy