Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] vcs_info patch2subject: Support `svn log -r N --diff` output.
- X-seq: zsh-workers 41565
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] vcs_info patch2subject: Support `svn log -r N --diff` output.
- Date: Thu, 17 Aug 2017 17:26:39 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=i0uuU8 Ty3oVpkCYzoJSS4zTSxBHRMgnvgfSSH/RJfes=; b=QJQJIW26hIlCRR7qv9nvcW LZPlFcF/Kby6qBHBje1oUDlfFRj5SedymoLlz0l7BknHaPDGaw8/GxPw1OQ2qYPj IJW3kkXtZfsmJ+3iIurfxTYDb4zi2+llJb4arQ38vVzL5ESUL0p6WuXFgLqmAZa9 V0bVadRAEkeiiZ/bKc7iVW8FAY2EUhP6kk/9R2oiZMp/MEWuw/bs02aMjJm0ubVQ adoL44MsjOzWe3URXo1KwqVwpC/0B8smx+I7yWtbIpSk9rh/kQ3spv/IC31i7W/e I4ARlB1wGaZZsIPIpnZYNNO41bDp74xrjbMAe90fHplU/Cfttej9yuQS3T/uEItQ ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=i0uuU8 Ty3oVpkCYzoJSS4zTSxBHRMgnvgfSSH/RJfes=; b=eLPR88sozFsFeoDbxadGfZ 1ZMMd4oZ7WrgDjlGiDxtzsOejCuSXvW0lTsmYIVKClMe3Z8SPP3PWNP5uFdE2BOR 8/3Zd3rv7x116cL7C38olbFFksK9n/lhDKx/gdWhEfY1JCxC0FvSOztOAMWdmtLN JgkVf3yT9N/py9tTjb1QOjL7wkncPewJZtAXYq9hBQS1Mka0jYrcTYoD/yqNKvRB yxvW20GsLy1SRXGIt8WYc5R5LRLUTGG/Gbml9f75yRb2Oyct8p3nie7geyxKidGX 0/gkbTJxgXsKFzgKIIKxlLxysAy+kXiCNY8r0gXtqpLrPfupBsKX6vN2XyJl28Dw ==
- 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
---
This is used by the Debian libserf-1-1 package.
Functions/VCS_Info/VCS_INFO_patch2subject | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/Functions/VCS_Info/VCS_INFO_patch2subject b/Functions/VCS_Info/VCS_INFO_patch2subject
index e222e8382..a48c16b04 100644
--- a/Functions/VCS_Info/VCS_INFO_patch2subject
+++ b/Functions/VCS_Info/VCS_INFO_patch2subject
@@ -6,14 +6,18 @@
integer -r LIMIT=10
local -a lines
local needle
+ readonly svn_log_pattern='^r[0-9]* [|] .*'
if [[ -f "$1" ]]; then
# Extract the first LIMIT lines, or up to the first empty line or the start of the unidiffs,
# whichever comes first.
while (( i++ < LIMIT )); do
IFS= read -r "lines[$i]"
- if [[ -z ${lines[$i]} ]] || [[ ${lines[$i]} == (#b)(---|Index:)* ]]; then
+ if [[ -z ${lines[$i]} ]] || [[ ${lines[$i]} == (#b)(---[^-]|Index:)* ]]; then
lines[$i]=()
- break
+ # For 'svn log -r N --diff' output, read the first paragraph too.
+ if ! [[ $lines[i-1] =~ $svn_log_pattern ]]; then
+ break
+ fi
fi
done < "$1"
@@ -51,6 +55,9 @@
fi
} < "$1"
REPLY=$needle
+ elif [[ $lines[2] =~ $svn_log_pattern ]]; then
+ REPLY=$lines[4]
+ if (( ${+lines[5]} )); then REPLY+='...'; fi
elif (( ${+lines[1]} )); then
# The first line of the file is not part of the diff.
REPLY=${lines[1]}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author