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:
The prior version of this function uses
(s-split "\\W+" remotes)
to turn the output fromgit 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:
In the prior code, this produces the list:
and things don't end well. Breaking on lines produces: