Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 2/2] vcs_info quilt: Pass patch subject lines to gen-applied-string
- X-seq: zsh-workers 36945
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH 2/2] vcs_info quilt: Pass patch subject lines to gen-applied-string
- Date: Sat, 24 Oct 2015 20:25:45 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=QN5Q1flmVi5GBPC0 HvSRI5bfx3Q=; b=l/zq3a64lY48CeXf8/x6IXGmlXb7hLLnX6CEzjjk57XXIg11 wwRJLPdiI/uFKqgLAICWz6866l0LPaEY0+I+vzXUHEt9OQXDo35ClaVjakzqEV6R tSCWXBazDHmG+EHjWkjjk88kljT1jPPw42ja0RDBpYBESmrrFzodjNePcOA=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=QN5Q1flmVi5GBPC 0HvSRI5bfx3Q=; b=R1g7N+eWpV5kDVOQNjjWPeTHW71KBGLdKiYKjVZtRqGpuEK B0vTT66qArHX4zQA2VTzOZznLbJ1y3F0yQICUGjDFJuRWCgsZt+PYBjQ42MWRC5+ Jmyuid8bvJS5QGDhSLj42hRiGPM4a5oqd4jmSGQZ+rNC4IYrBLLwNDYa9Z0w=
- In-reply-to: <20151022123057.GG7173@tarsus.local2>
- 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: <20151022123057.GG7173@tarsus.local2>
Daniel Shahaf wrote on Thu, Oct 22, 2015 at 12:30:57 +0000:
> The format used is '${patchname} ${subject}', which is analogous to the
> git backend.
> ---
> This seems to work with both Debian and Fedora source packages. In
> Debian the first line sometimes starts with "Description:" (DEP-3 format
> patches); perhaps that prefix should be removed, but for now I've erred
> on the side of conservatism and left the first line unmunged.
I've updated the patch to fix a few problems:
- Fix filtering of (---|Index:) — the condition was always false
- Don't leak error to terminal if the patch file doesn't exist
(eg after 'quilt new')
- Add "?" as subject if the patch has none
Interdiff:
diff -u b/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt
--- b/Functions/VCS_Info/VCS_INFO_quilt
+++ b/Functions/VCS_Info/VCS_INFO_quilt
@@ -149,14 +149,28 @@
() {
local i line
for ((i=1; i<=$#applied; i++)); do
- read -r line < "$patches/$applied[$i]" &&
- [[ line != (#b)(---|Index:) ]] &&
+ if [[ -f "$patches/$applied[$i]" ]] &&
+ read -r line < "$patches/$applied[$i]" &&
+ [[ $line != (#b)(---|Index:)* ]] &&
+ true
+ ;
+ then
applied[$i]+=" $line"
+ else
+ applied[$i]+=" ?"
+ fi
done
for ((i=1; i<=$#unapplied; i++)); do
- read -r line < "$patches/$unapplied[$i]" &&
- [[ line != (#b)(---|Index:) ]] &&
+ if [[ -f "$patches/$unapplied[$i]" ]] &&
+ read -r line < "$patches/$unapplied[$i]" &&
+ [[ $line != (#b)(---|Index:)* ]] &&
+ true
+ ;
+ then
unapplied[$i]+=" $line"
+ else
+ unapplied[$i]+=" ?"
+ fi
done
}
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author