Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] vcs_info: examples: use sed's q1 with +vi-git-untracked



Daniel Hahler wrote:
> 
> This short-circuits the git command if there is any match.
> 
> Especially with `git ls-files` this is faster, although the additional

Unfortunately, the exit code after q is a GNU sed extension so this now
breaks on non-Linux systems.

Portable alternatives that come to mind include: piping to head -1 and using
$pipestatus, using sed q and testing for output, using awk. There's
probably something better than those, however.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author