From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 91c9f08d for ; Sat, 21 Dec 2019 21:05:05 +0000 (UTC) Received: (qmail 14964 invoked by alias); 21 Dec 2019 15:59:14 -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: List-Unsubscribe: X-Seq: 45114 Received: (qmail 29291 invoked by uid 1010); 21 Dec 2019 15:59:14 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25663. spamassassin: 3.4.2. Clear:RC:0(66.111.4.25):SA:0(-1.9/5.0):. Processed in 2.785607 secs); 21 Dec 2019 15:59:14 -0000 X-Envelope-From: danielsh@apache.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: softfail (ns1.primenet.com.au: transitioning SPF record at amazonses.com does not designate 66.111.4.25 as permitted sender) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdduhedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhestddtredtre dttdenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurghnihgvlhhshhesrghp rggthhgvrdhorhhgqeenucfkphepjeelrddukedtrdehjedrudduleenucfrrghrrghmpe hmrghilhhfrhhomhepuggrnhhivghlshhhsegrphgrtghhvgdrohhrghenucevlhhushht vghrufhiiigvpedt X-ME-Proxy: From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH 3/5] vcs_info quilt: Improve support for svn-style patch headers. Date: Sat, 21 Dec 2019 15:58:26 +0000 Message-Id: <20191221155828.25950-3-danielsh@apache.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191221155828.25950-1-danielsh@apache.org> References: <20191221155828.25950-1-danielsh@apache.org> Additional lines between the |-separated header line and the actual log message, as generated by 'svn log -v' and 'svn log -g', are now supported. This change affects you if you have quilt patches with 'svn log'-style information in their headers, regardless of whether you use quilt standalone, quilt over svn, or quilt over some other VCS. --- Functions/VCS_Info/VCS_INFO_patch2subject | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Functions/VCS_Info/VCS_INFO_patch2subject b/Functions/VCS_Info/VCS_INFO_patch2subject index a48c16b04..a467edcdb 100644 --- a/Functions/VCS_Info/VCS_INFO_patch2subject +++ b/Functions/VCS_Info/VCS_INFO_patch2subject @@ -14,10 +14,7 @@ IFS= read -r "lines[$i]" if [[ -z ${lines[$i]} ]] || [[ ${lines[$i]} == (#b)(---[^-]|Index:)* ]]; then lines[$i]=() - # For 'svn log -r N --diff' output, read the first paragraph too. - if ! [[ $lines[i-1] =~ $svn_log_pattern ]]; then - break - fi + break fi done < "$1" @@ -55,9 +52,18 @@ fi } < "$1" REPLY=$needle - elif [[ $lines[2] =~ $svn_log_pattern ]]; then - REPLY=$lines[4] - if (( ${+lines[5]} )); then REPLY+='...'; fi + elif [[ $lines[1] =~ $svn_log_pattern ]] || [[ $lines[2] =~ $svn_log_pattern ]]; then + # Read up to the next blank line, and the first two lines after it. + integer multiline=0 + { + while read -r needle; [[ -n $needle ]]; do done + # Read the first line of the second paragraph, which is the first + # line of the log message. + read -r needle + read -r && [[ -n $REPLY ]] && multiline=1 + } < "$1" + REPLY=$needle + if (( multiline )); then REPLY+='...'; fi elif (( ${+lines[1]} )); then # The first line of the file is not part of the diff. REPLY=${lines[1]}