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
- X-seq: zsh-workers 34835
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] vcs_info: examples: use sed's q1 with +vi-git-untracked
- Date: Thu, 02 Apr 2015 17:42:12 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1427989334; bh=86ly24SMiO+eJl1eC0/oorTM6Nx75xSFUXzAwyfdcBY=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=p1sodbruIVkxi1as6+Gd5oKVE5g1CW3QuYM84rdj8BLmQfu4zC9pOQuYNb9VDVmWIawdLp2IHvNW6cyheSARTaoRhIKlHBQfLqFF/gZUmwu0+1yfyAfqDzLS58FgF2KEIJ/gBmKuXSqUWu4u0Yq9DuyGB1LXER2c4vRUHzdSnGG+u39xE16AgOftrEdgmPYkNsLe3QnkDufI75J8chfzYRBZe4lpFXGmXh9fSmmGALT/vK4uEya2VqcZIwcU/peOFZfqSPlBxFB/NnnJ0k6cJ58se2dq/yoc+zrFvDLhvdY+xDANDeSxgr5r4w2keV6Uv+QD9qeplOE+J1wPASU8RA==
- In-reply-to: <1427980898-13096-1-git-send-email-genml+zsh-workers@thequod.de>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1427980898-13096-1-git-send-email-genml+zsh-workers@thequod.de>
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