From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14278 invoked by alias); 24 Oct 2015 20:37:29 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36945 Received: (qmail 11553 invoked from network); 24 Oct 2015 20:37:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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= X-Sasl-enc: nH3Of6LeDZnP0juaoDh4AyDlZUwhc3Po3f+F94xj2+WK 1445718347 Date: Sat, 24 Oct 2015 20:25:45 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: [PATCH 2/2] vcs_info quilt: Pass patch subject lines to gen-applied-string Message-ID: <20151024202545.GC11372@tarsus.local2> References: <20151022123057.GG7173@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151022123057.GG7173@tarsus.local2> User-Agent: Mutt/1.5.21 (2010-09-15) 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