See for example: https://git-scm.com/docs/git-cherry
git cherry is quite helpful when trying to findout if merges between
branches are complete, when there were cherry-picks in addition to
merges.
Previously, elements already existing in the path variable would keep their position when the path was being constructed from the config files. This caused issues given that $PATH typically already contains "/usr/bin:/bin" when fish initializes within a macOS terminal app. In this case, these would keep their position at the front of the $PATH, even though the system path_helper configs explicitly place them _after_ other paths, like "/usr/local/bin". This would render binaries in "/usr/local/bin" as effectively "invisible" if they also happen to live in "/usr/bin" as well. This is not the intended
This change makes the __fish_macos_set_env config function emulate the macOS standard path_helper behavior more faithfully, with:
1. The path list being constructed *from scratch* based on the paths specified in the config files
2. Any distinct entries in the exist path environment variable being appended to this list
3. And then this list being used to *replace* the existing path environment variable
The result, for a vanilla fish shell on macOS, is that the $PATH is now set to:
/usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin
Where previously it was set to:
/usr/bin /bin /usr/local/bin /usr/sbin /sbin
This new $PATH exactly matches the order of paths specified in `/etc/paths`.
$__fish_git_prompt_use_informative_chars will use the informative
chars without requiring informative mode (which is really frickin'
slow!).
See #5726.
[ci skip]
This previously effectively checked `string split ' '`s return status,
which was false if it didn't split anything. And while that should be
true if getent fails (because it should produce no output), it's also
true if it doesn't print a line with multiple aliases. Which should be
fairly typical.
Instead we use our new-found $pipestatus to check what getent returns,
in the assumption that it'll fail if it doesn't support hosts.
Follow up to 8f7a47547e.
[ci skip]
`getent hosts` is expensive-ish - ~50ms, so we don't want to run it
twice just to figure out it works.
Apparently this works everywhere but CYGWIN and possibly older
OpenBSD, but we don't want to explicitly blacklist those.
[ci skip]
Instead of requiring a flag to enable newline trimming, invert it so the
flag (now `--no-trim-newlines`) disables newline trimming. This way our
default behavior matches that of sh's `"$(cmd)"`.
Also change newline trimming to trim all newlines instead of just one,
again to match sh's behavior.
The `string collect` subcommand behaves quite similarly in practice to
`string split0 -m 0` in that it doesn't split its output, but it also
takes an optional `--trim-newline` flag to trim a single trailing
newline off of the output.
See issue #159.
If you changed $__fish_git_prompt_show_informative_status, it
triggered a variable handler, which erased the chars, but neglected to
unset $___fish_git_prompt_init, so we just kept chugging along with
empty characters.
What's the hardest thing in CS again? Cache something something?
[ci skip]
This way we use our core file completion code, which is much more
flexible than we can easily achieve directly in script (which would
require e.g. an `expand` builtin, and case-insensitive globs).
Fixes#5896.