Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 180F0200BAA for ; Thu, 13 Oct 2016 02:15:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 16B4A160AEE; Thu, 13 Oct 2016 00:15:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 36B81160ACA for ; Thu, 13 Oct 2016 02:15:57 +0200 (CEST) Received: (qmail 67318 invoked by uid 500); 13 Oct 2016 00:15:56 -0000 Mailing-List: contact users-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@subversion.apache.org Received: (qmail 67308 invoked by uid 99); 13 Oct 2016 00:15:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2016 00:15:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 5E7FB1A04B2 for ; Thu, 13 Oct 2016 00:15:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.121 X-Spam-Level: X-Spam-Status: No, score=-0.121 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=tibco.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id nHwBR1yaKrtv for ; Thu, 13 Oct 2016 00:15:53 +0000 (UTC) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 4315F5FB37 for ; Thu, 13 Oct 2016 00:15:52 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id qn10so32776083pac.2 for ; Wed, 12 Oct 2016 17:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tibco.com; s=tibcogoogle; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=u4JcMnmTgXKa2WaAr92mxa2t0SW0VydRwVmUf9ox+nM=; b=ev89FGicrXGrgwfo6Y21hXyygEAw7R5DFxvLe20nEc2dhXWzsAFgtvIZkUpMS+J85/ vpO5/1C9n6qdT9BozayRMmp3/BpPqbnEJufffV+DXPh7tvMpy8YjhDGsXSgp1RJpG5m9 QrLqXDxtXnN6zKkL7CV+TV2Xqr/qonisoMoIA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=u4JcMnmTgXKa2WaAr92mxa2t0SW0VydRwVmUf9ox+nM=; b=FD8o1DgJLbs6Uh1RYziSajnsF065BUErDB4S+sqmLmmSXrFzbbF4/LZq79iyiPGcNK 4Ost6z6Cd5fQMI3/51spXBqpxz1/ipDcvKap/Kr0bvJQTT4q00YV0CiO0tXBMKQ7mPZV Kzd1h9IkeYGHW0armEY+UX386XVkiFtrKrdMXgoxnwcwWaq+XukkdxxqbG4S92MDN9ep iQdAaxhSAvETYSfNDXAbvX75V9TBRXwrSP89eOx4lfvzisKAMedsWLpuFmGv7Q4saJ3F ik6Ax0j7wCTbedtk7iLSJ9gg9ultBSAfy0m9iECWgexpFxHyoZIK2jLqzgyBYDnZt+uV /pZQ== X-Gm-Message-State: AA6/9RkUz7g0TIX9ns19rT2AtDMHY2aQVq8KdHsJx16mZQO9elCz7Lr6Fy2Zgk4QaLZEfusU X-Received: by 10.66.160.72 with SMTP id xi8mr4778529pab.78.1476317750853; Wed, 12 Oct 2016 17:15:50 -0700 (PDT) Received: from EEJ-New-MacBook-Pro.local (173-228-110-18.dedicated.static.sonic.net. [173.228.110.18]) by smtp.googlemail.com with ESMTPSA id xn11sm14411009pac.38.2016.10.12.17.15.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Oct 2016 17:15:49 -0700 (PDT) Subject: Re: Cannot add files due to hierarchical RDC svn:auto-props when matching rules merge properties between text and binary file types To: Rob Hofer , users@subversion.apache.org References: Cc: Rob Hofer From: Eric Johnson Message-ID: <66adfc9d-8929-c5b5-c871-ba5d088ba1bd@tibco.com> Date: Wed, 12 Oct 2016 17:15:48 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit archived-at: Thu, 13 Oct 2016 00:15:58 -0000 Your constraints, as currently specified, seem to require actual logic.... Thoughts follow your email. On 10/12/16 1:44 PM, Rob Hofer wrote: > We have a rather common use case where we have an svn:auto-props rule > set globally (set on root of repository) to define source code files > as text based, but also have some files provided by 3rd parties which > compress or encrypt similar files with the same file extension (which > we have no control over), and hence we want to set an svn:auto-props > rule locally on those directories to make those files binary type. But > the hierarchical svn:auto-props rules add properties from multiple > definitions of the same match filter (*.v), and result is a > conflicting set of properties that block the add at the client > (eol-style with mime-type=octet-stream). > > For example, a binary and text based Verilog file (*.v): > %> file binary.v > binary.v: gzip compressed data, was "binary.v", from Unix, last > modified: Mon Feb 18 19:44:25 2013, max compression > %> file text.v > text.v: ASCII text > > The RDC auto-props for this directory shows these Verilog and VHDL > types (local directory expects binary types, global are source-code > text files). > %> svn propget svn:auto-props --show-inherited-props . > http://crsvn/gsadc - *.v = svn:eol-style=LF;svn:keywords=Id > Revision Date Author URL;svn:mime-type=text/x-verilog > . - *.v = svn:needs-lock;svn:mime-type=application/octet-stream > > Adding the files to SVN control fails, unless --no-auto-props is used > (undesirable work around): > %> svn add binary.v > svn: E200009: Can't set 'svn:eol-style': file '/module/lay/binary.v' > has binary mime type property > %> svn add --no-auto-props binary.v > A (bin) binary.v > %> svn add text.v > svn: E200009: Can't set 'svn:eol-style': file '/module/lay/text.v' has > binary mime type property > %> svn add --no-auto-props text.v > A text.v > > Subversion auto-detects the binary file and at least sets the > mime-type, but other properties are missing because --no-auto-props is > the only way to add the files without error. > %> svn proplist -v binary.v > Properties on 'binary.v': > svn:mime-type > application/octet-stream > %> svn proplist -v text.v > > %> svn --version > svn, version 1.9.4 (r1740329) > compiled May 18 2016, 12:05:49 on x86_64-unknown-linux-gnu > > (Incidentally, the commit will fail because our hook is checking these > svn:auto-props rules and the file must match the binary rules or the > text rule, based on the mime-type). So the only way today to add these > files to SVN is to use --no-auto-props on add, and go into the server > and disable the pre-commit hook during the commit, then put the > pre-commit hook back. Since a pre-commit hook is the only way to > enforce the use of auto-props correctly, disabling the hook is not an > optimal solution. Once added to SVN, the issue never comes up again > because the properties do not change, and the pre-commit hook checks > the modifications on future commits based upon the mime-type (binary > or text rules). The issue is only during the initial add to SVN due to > conflicting properties being applied to the file based on how the > svn:auto-props definitions are being interpreted. > > Proposed solution: > 1. Make lower level svn:auto-props rules completely override upstream > ones, rather than additively merging properties, for rules with same > exact match filter (local *.v redefines upstream *.v completely). > 2. Make SVN ignore properties such as eol-style and keywords when the > mime-type is a binary type rather than issue a fatal error to the > user/client (warning instead that some properties are being ignored). > 3. Provide a subtractive property rule to undo an upstream property. > E.g., svn:eol-style=none, or svn:keyword=none, such that a lower level > rule can unset a property defined upstream (and make > svn:eol-style=none behave same as if svn:eol-style was not applied at > all). > > Note: Before RDC svn:auto-props (pre 1.8), this use case required > having two entries in the ~/.subversion/config, with one always > commented out. When encountering one type or the other (text or > binary), user would have to uncomment/comment the proper auto-props > rule in their config file before the add, and then change their config > back for the normal case. This was very unwieldly and required careful > synchronization of all user runtime config files and hook scripts and > manual intervention by the user during adds. Hierarchical RDC > properties should eliminate this problem, but it falls a little short > because of how hierarchical RDC svn:auto-props rules merge mutually > exclusive properties together. I believe this is very similar to > multiple matches in the ~/.subversion/config runtime file, for example > a *.v rule and a *-rtl.v rule could collide, except now it is possible > to have the very same rule filter (*.v) defined in more than one > location in the subversion hierarchy. See proposed solution #1 as my > desired behavior from the SVN client. Only a few options I see: - different repositories for the binary files vs. the text format. - improved hook scripts to enforce your desired constraints based on the content of the incoming added file, rather than just the extension. You could also create a client side script / tool to check before a commit. Eric.