From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14108 invoked from network); 29 Jan 2022 16:16:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Jan 2022 16:16:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1643472970; b=hqhKZVTs3C4wQfHlXIYy8sIDQvchnUhfwBMeFyV5urdstbURg5NcWEWyQYPhebnKbvmLyMZH64 XElaAXtXF3Upq/lBPgaJyZwDJmCbQ8DsrL1aSdaNaLWxDl7WMuWjsfXX7H4PByceaghg44nYOA Y5XAKt2B15yBARxvD9yHw4S/4+uQf+v3gtfJRcr9ZGsaadav+Cj/JwJtf3eV6WS1j8hVVtCj4e Zg7dwKWRcOZLWTEyMzLku0GlL55URa0XjQb3JcTe90KvIHzMCvEImbXnpRRVSfsmjK3HfMXri6 ipTwwW51S8Py9d9n74lLNPl6VP+9LvTMhdHywf9ecifOSA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1643472970; bh=vP7wBnKRZ2KTjj3BumgWkd1e+vZJOJJBne/le4T6KzI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:DKIM-Signature:DKIM-Signature: DKIM-Signature; b=FFUay7ydI5XxSbsDbecDUii/VfytoDxcbTDXpK+XHY/z43+LfnZUQcXIvyzpcvaqn7HgGzOA/s OG/UgGFB7+BMeojmYskmsnf37IzOPa7Spw/pWS4zmWGPAhyKCNhqiO2KoYsS1BBBurs8GxntXV PwYI3b6OnG5QK/maL+08TOkNBqXxLrrz7ALMKaaVGaqncFrdzhbgaBUEygRS+CUljlJx5umrWv Fl+N0zdWWGo2aqdI6aSMwa9nA0g/tT+tYQGxWIAOpALN3/u3DbGcTJBg2HdU2hXXk1GmJHKSy0 NYk9vZt9sDsM3p1U1yZqkDWAe9X+7JiKr5+O3aElqBjNDg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=hYihR3SXg4m1yte3VUaKKcr9P5aknv2kMVIZVnsTabg=; b=kvVS9zvf5z4hh85pHpFEwDT7/A MQxoaVZiv3OcJHtju8QKiNRLklRa6JU98ZCNfwQ5J+PQ2yHUEdd57lSo6kR8aqIMhNxfoJ+SAD+Yt GD5ZWo3Fno5M/SCDiNoEQ1X9sb2DyQuA4hV0r4L4NGP3VzyHwuku9qmuwMHmV9zm1xlfH591a79p9 djoLGYuxaCg19Z37A3G05q17tyj3Dc/dcqqJcsiZg4zzcH79oJhH9v2J6Fq0fwtEEG0XukY1KIxUj UaTKKANOMmJKFR1mHAa4EqJo/uDRg3/B7UYHafR0+px76E4vxLg4j6iL9STLoEh9+FqgkiZ5DuWFL 1jDS1vgw==; Received: from authenticated user by zero.zsh.org with local id 1nDqOX-0004qe-0b; Sat, 29 Jan 2022 16:16:09 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58215) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nDqNx-0004XW-7F; Sat, 29 Jan 2022 16:15:34 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CBC415C0102; Sat, 29 Jan 2022 11:15:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 29 Jan 2022 11:15:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; bh=hYi hR3SXg4m1yte3VUaKKcr9P5aknv2kMVIZVnsTabg=; b=IDGn6i/TjMGqYuYyx/w S1dvxqprLRNyoXstLF/+g6kgzsmyfKv44sk/K3xZvZRGM9FSdR4IJRPLbJkfYyHQ 6tBAad8fVBeYLxFhQRal+3vCTi565SAbZGM736xcouUCjvJbK6mDV4bkHTlrijKd o+32tzoTMh4O6xl8AGLNFOTFt0Lqoq+CMcflbtgMGyduRnYklq1Qb4VNsdls+NKY ptxYu6XYv863JB/8/AQ/Y9nxmQoKfBL1i4NzCUXR8e64uXI28gK1dv06vgvt5Dgm u+ErFUQbP2EgwfwWIqwsQIwp9bkxxO73KaTPffcrLEEsABYGwDFjO7adh+arRGbD RQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=hYihR3 SXg4m1yte3VUaKKcr9P5aknv2kMVIZVnsTabg=; b=U6e1n5Al98Qynq5y0RsG5L UMWr6g5QasKgsylS09tPA2s4n3hgZZDF/1Ae0h9XbtdPBMSSQrm7jc3df9zn4BX8 RFjTGKhi6VQuP0whSGU7gc6p1RflV9N5JrsP4oLyRZLNzFV1bIi7Asj0bCKmCylP 10orpYExRU8rJELWNh+Q1Anb0aXcskP97UoBew7yMvQE76b6+vJoOtz2cFKIifeT ZiguRMCtX272+loabVKNH/Ilf3U7L9yea5a+tcK60fgA5Ytn0UZrSjcCrjaTMHs6 Bxe2xojr675ra0MAnJIo4Eu8IUGmCZHqrdv7uzB7NndLw5jknCVnemf25T2gwwbQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrfeejgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkedttd ertddtnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggrnhhivghl rdhshhgrhhgrfhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeetgffggfefueejgffgje ejjeelueejvefhveegledvgeeigeevuefgffejfeelteenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrg hfrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 29 Jan 2022 11:15:31 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4JmKDd44PYz4h1; Sat, 29 Jan 2022 16:15:29 +0000 (UTC) From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH 3/3] vcs_info hg mq: Extract patch subjects Date: Sat, 29 Jan 2022 16:15:27 +0000 Message-Id: <20220129161527.17303-3-danielsh@tarpaulin.shahaf.local2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220129161527.17303-1-danielsh@tarpaulin.shahaf.local2> References: <20220129161527.17303-1-danielsh@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Seq: 49726 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Use a NUL separator just in case someone's hg mq patch names include literal spaces. That means gen-applied-string hooks have to split their arguments one way in the hg mq case and another way in every other case. --- Doc/Zsh/contrib.yo | 18 +++++++++++----- .../VCS_Info/Backends/VCS_INFO_get_data_hg | 21 +++++++++++++++++++ README | 7 +++++++ 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 2cda891ec..c68fe33ef 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1656,12 +1656,20 @@ The arguments to this hook describe applied patches in the opposite order, which means that the first argument is the top-most patch and so forth. -When the patches' log messages can be extracted, those are embedded -within each argument after a space, so each argument is of the form +Each argument contains both a patch name and, if possible, the first line of +that patch's log message or description. A literal `tt(?)' is substituted +when the log message or description is empty or unable to be determined. + +In the tt(mq) backend, patch names may contain spaces, and each argument +is of the form `var(patch name)tt($'\0')var(first line of the log message)', +using a literal NUL as a separator. + +In the other backends, each argument is of the form `var(patch-name) var(first line of the log message)', where var(patch-name) -contains no whitespace. The tt(mq) backend passes arguments of -the form `var(patch name)', with possible embedded spaces, but without -extracting the patch's log message. +contains no whitespace. Typically, one would use +tt(${argv[1]#* }) and tt(${argv[1]%% *}) to separate the var(patch-name) and +var(first line of the log message) parts. (See the file +tt(Misc/vcs_info-examples) in the source distribution for a complete example.) When setting tt(ret) to non-zero, the string in tt(${hook_com[applied-string]}) will be diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg index d789d662a..cfaa3fe5e 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg @@ -211,6 +211,27 @@ if zstyle -T ":vcs_info:${vcs}:${usercontext}:${rrn}" get-mq \ done < ${mqseriesfile} fi + () { + local -a tmp + local i + + tmp=() + for i in "${mqpatches[@]}" ; do + VCS_INFO_patch2subject "${patchdir}/$i" + [[ $REPLY == '# HG changeset patch' ]] && unset REPLY + tmp+=( "$i"$'\0'"${REPLY="?"}" ) + done + mqpatches=( "${tmp[@]}" ) + + tmp=() + for i in "${mqunapplied[@]}" ; do + VCS_INFO_patch2subject "${patchdir}/$i" + [[ $REPLY == '# HG changeset patch' ]] && unset REPLY + tmp+=( "$i"$'\0'"${REPLY="?"}" ) + done + mqunapplied=( "${tmp[@]}" ) + } + if VCS_INFO_hook 'gen-mqguards-string' "${mqguards[@]}"; then guards_string=${(j:,:)mqguards} # TODO: %-escape extra_zformats[g:...] value diff --git a/README b/README index 3ef8afcd1..25a61a4b8 100644 --- a/README +++ b/README @@ -102,6 +102,13 @@ consistent with most other sh implementations. getopts now calculates OPTIND in a similar manner to other shells when the POSIX_BUILTINS option is enabled. +vcs_info hg: Arguments to the gen-applied-string and gen-unapplied-string hooks +now contain not only the patch's name but also the first line of the patch's +log message. The two parts are separated by a NUL byte. +. +This only affects you if you have defined custom vcs_info hook functions (see +the output of 'zstyle -L ":vcs_info:*" hooks' and 'which -m -- "+vi*"' [sic]). + Incompatibilities between 5.7.1 and 5.8 ---------------------------------------