Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1436E119E4 for ; Mon, 15 Sep 2014 12:32:49 +0000 (UTC) Received: (qmail 68462 invoked by uid 500); 15 Sep 2014 12:32:48 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 68410 invoked by uid 500); 15 Sep 2014 12:32:48 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 68394 invoked by uid 99); 15 Sep 2014 12:32:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2014 12:32:48 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of brane@wandisco.com designates 209.85.212.172 as permitted sender) Received: from [209.85.212.172] (HELO mail-wi0-f172.google.com) (209.85.212.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2014 12:32:43 +0000 Received: by mail-wi0-f172.google.com with SMTP id e4so4098050wiv.17 for ; Mon, 15 Sep 2014 05:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wandisco.com; s=gapps; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=PjpDHj5FTQbaMIGpqLnH8+eVZ9zNaQheOS/p7mr/jGE=; b=aJFdLV6N+ZYinvtZDy4XsuhS7sID9mQE+KqtsudVenHxADcfaDI+HlL+f6LnMBc64/ n3EIDuUV5peLtaQcVzXIBLH9tuFuQWrU31+PN/Ln/HNZnOL29qq4p+yaO6NOBY6JUWvT cPO37mbgHTBbE+WyV+OBAftT/7RYNpWkqbYBM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:subject:references:in-reply-to:content-type; bh=PjpDHj5FTQbaMIGpqLnH8+eVZ9zNaQheOS/p7mr/jGE=; b=SOBhOrricsQnhQnRzvyqkEo70+QnY2ZD2iMhq1qHG5jVPKtHsggb9BBhnULB2YmeX/ DHhllDy86VtsmqGbcavtGTBooLdGNNYnGkXV8idTXHJFaXEZYmwB9prx78usP+IWFI+9 IlFle2XqGj2s9XI5pcUjHE+vPB0ZMvNpeEae/fcN9AFyd48hr3QpzAuTjbyIYvmN+LTy 123aBCDJc0sszcGb4b7BHeIrPHCQSkXZgCmHtRYxAjVoXaRA2IdLzMi/RV8clStZ4FSN j00cOlBOYMWvnVG3ZIyYN63BWpE26zVY4gGeGr0KX1bcO8hHD8nzSQCVWtcKOYzvirew cn6A== X-Gm-Message-State: ALoCoQkl81W/7eDTPa7KvReMWySxoWAxN5y0SqsY5/q6odXZqoFqYnP33SU8vDP/kq6m8eu/Dj96 X-Received: by 10.194.24.101 with SMTP id t5mr32576515wjf.76.1410783962923; Mon, 15 Sep 2014 05:26:02 -0700 (PDT) Received: from zulu.local (cpe-46-164-25-121.dynamic.amis.net. [46.164.25.121]) by mx.google.com with ESMTPSA id mx19sm11521872wic.3.2014.09.15.05.26.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Sep 2014 05:26:02 -0700 (PDT) Received: from zulu.local (localhost [IPv6:::1]) by zulu.local (Postfix) with ESMTP id 284EBC78F993 for ; Mon, 15 Sep 2014 14:26:01 +0200 (CEST) Message-ID: <5416DAD8.7070602@wandisco.com> Date: Mon, 15 Sep 2014 14:26:00 +0200 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= Organization: WANdisco User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: dev@subversion.apache.org Subject: Re: [VOTE] merge the log-message-templates branch to trunk References: <20140910170607.GD9666@ted.stsp.name> <1410767917.10930.YahooMailNeo@web87701.mail.ir2.yahoo.com> <20140915083431.GN9666@ted.stsp.name> <1410773142.90170.YahooMailNeo@web87705.mail.ir2.yahoo.com> In-Reply-To: <1410773142.90170.YahooMailNeo@web87705.mail.ir2.yahoo.com> Content-Type: multipart/alternative; boundary="------------070207090303020205080304" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------070207090303020205080304 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15.09.2014 11:25, Julian Foad wrote: >> And perhaps we could introduce a template syntax to specify >> key-value pairs (e.g. "%KEYWORD:%") which are removed automatically >> if the value is left empty? [...] > UPGRADE PATHS > > Once we release this, the 'svn:log-template' property will exist in people's repositories for all time, and for all clients (although only clients that query it will see it). > > We will want to upgrade the functionality. One of the obvious upgrades is we will want to insert run-time substitutions in the text. I recommend we anticipate this now by defining a minimal syntax for substitutions. For example, we may want to use forms like '$foo' and '${foo bar}'. Allow me to very strongly disagree with this idea. :) For a simple reason: the kind of substitutions we may potentially want to support are merely a matter of speculation right now. Here's what I think is missing from the template implementation. We should define three syntactic elements for the svn:log-template property value: * Comment syntax! It's amazing how often we forget about that. By "comment" I don't mean something that's shown in the log message editor, but something that causes parts of the property value to be ignored /before/ it's sent to an editor. If we predict that templates may someday contain non-trivial markup, the author of the template has to be able to explain, with comments, what the markup does. o Implies an API for stripping comments from the property value * Template format indicator. This can essentially be just a comment-like processing directive * Comment syntax! Yes, again. :) The second kind of comment, which is shown to the user but not included in the final log message. o Again, implies an API for stripping those from the log message and extracting them from the parsed template by GUI clients. Once we have these elements, the template format becomes arbitrarily extensible in a backward-compatible way. I propose the following: * Author comments are lines that begin with a hash (#). Example: # The user will not see this line. * The format indicator is a form of comment that must appear in the first line of the template, and contains the major and minor number of the Subversion release in which a particular template format is supported: #! format=1.9 This implies that if 1.10 supports the same template format as 1.9, then "#!format=1.10" would be valid and would imply the 1.9 template format. This will make it easy for admins to note the oldest still supported version of SVN. Incidentally, we just established /^#! *[:keyword:]/ as the pattern for any future processing directives. * User-visible comments are lines that begin and end with two dashes (--). Example: -- The user will see this, but it won't appear in svn:log. -- We've essentially already established this syntax with the "ignored" line, and I see it's also used on the branch. -- Brane --------------070207090303020205080304 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 15.09.2014 11:25, Julian Foad wrote:
And perhaps we could introduce a template syntax to specify
key-value pairs (e.g. "%KEYWORD:%") which are removed automatically
if the value is left empty?

[...]

UPGRADE PATHS

Once we release this, the 'svn:log-template' property will exist in people's repositories for all time, and for all clients (although only clients that query it will see it).

We will want to upgrade the functionality. One of the obvious upgrades is we will want to insert run-time substitutions in the text. I recommend we anticipate this now by defining a minimal syntax for substitutions. For example, we may want to use forms like '$foo' and '${foo bar}'.


Allow me to very strongly disagree with this idea. :) For a simple reason: the kind of substitutions we may potentially want to support are merely a matter of speculation right now.

Here's what I think is missing from the template implementation. We should define three syntactic elements for the svn:log-template property value:
  • Comment syntax! It's amazing how often we forget about that.
    By "comment" I don't mean something that's shown in the log message editor, but something that causes parts of the property value to be ignored before it's sent to an editor. If we predict that templates may someday contain non-trivial markup, the author of the template has to be able to explain, with comments, what the markup does.
    • Implies an API for stripping comments from the property value
  • Template format indicator. This can essentially be just a comment-like processing directive
  • Comment syntax! Yes, again. :) The second kind of comment, which is shown to the user but not included in the final log message.
    • Again, implies an API for stripping those from the log message and extracting them from the parsed template by GUI clients.

Once we have these elements, the template format becomes arbitrarily extensible in a backward-compatible way.


I propose the following:

  • Author comments are lines that begin with a hash (#). Example:

    # The user will not see this line.

  • The format indicator is a form of comment that must appear in the first line of the template, and contains the major and minor number of the Subversion release in which a particular template format is supported:

    #! format=1.9

    This implies that if 1.10 supports the same template format as 1.9, then "#!format=1.10" would be valid and would imply the 1.9 template format. This will make it easy for admins to note the oldest still supported version of SVN.

    Incidentally, we just established /^#! *[:keyword:]/ as the pattern for any future processing directives.

  • User-visible comments are lines that begin and end with two dashes (--). Example:

    -- The user will see this, but it won't appear in svn:log. --

    We've essentially already established this syntax with the "ignored" line, and I see it's also used on the branch.

-- Brane

--------------070207090303020205080304--