You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ne...@apache.org on 2011/08/25 01:36:33 UTC

svn commit: r1161318 - /subversion/trunk/notes/hold

Author: neels
Date: Wed Aug 24 23:36:33 2011
New Revision: 1161318

URL: http://svn.apache.org/viewvc?rev=1161318&view=rev
Log:
* notes/hold: (2/2) ...and this is what I made of it.

Modified:
    subversion/trunk/notes/hold

Modified: subversion/trunk/notes/hold
URL: http://svn.apache.org/viewvc/subversion/trunk/notes/hold?rev=1161318&r1=1161317&r2=1161318&view=diff
==============================================================================
--- subversion/trunk/notes/hold (original)
+++ subversion/trunk/notes/hold Wed Aug 24 23:36:33 2011
@@ -5,9 +5,9 @@ This text describes plans and concerns a
 automatically omits paths from commits that have this property set. WIP.
 $Date$
 
-When there are multiple options, I made my preferred solution the a) option,
-and the less preferred one the b) option. This is just my personal opinion.
-Actually, at the time of writing, this whole file is ;)
+This whole file is just my personal opinion, with some additions by other
+people. The whole feature is under heavy discussion at the time of writing,
+and it is doubtful if it will ever be implemented in this way.
 
 
 USE CASES
@@ -16,24 +16,29 @@ USE CASES
 Do not commit modifications on selected files, which do have to be versioned,
 because...
 
-(UC1) IDE CONFIG FILE, LOCAL
-  File 'foo' is modified with every click made in my IDE: it updates a time
-  stamp. I want 'foo' to be skipped on commits unless I explicitly ask svn
-  to commit it. (Instead of having to take explicit care on every commit to
-  omit the file.)
-
-(UC2) IDE CONFIG FILE, GLOBAL
-  Building on [1].  Since all other developers use the same IDE, I want to
-  tell all other working copies to hold back 'foo' as well, if they all
-  agree to that.
+(UC1) DO NOT COMMIT MODIFICATIONS, LOCAL
+  File 'foo' has to be modified to be able to work with my checkout.
+  E.g. with every click made in my IDE, it updates a time stamp;
+  or, the file is a config template which needs local configuration.
+  I want 'foo' to be skipped on commits unless I explicitly ask svn to commit
+  it. (Instead of having to take explicit care on every commit to omit the
+  file.)
+
+(UC2) DO NOT COMMIT MODIFICATIONS, GLOBAL
+  Building on [UC1]. All developers face the same issue and want to skip 'foo'
+  during commit. I want every new checkout to behave such that 'foo' is
+  omitted from commit, without further local config necessary.
+  (All developers must agree before we set up such a global hold, so it should
+  be optional to have a global hold or just a local hold as [UC1].)
 
-(UC3) IDE CONFIG FILE, GLOBAL AND SECRET
-  Building on [2].  Every user must locally add their passwords and PIN
+(UC3) DO NOT COMMIT MODIFICATIONS, SECRET AND GLOBAL
+  Building on [UC2].  Every user must locally add their passwords and PIN
   numbers to file 'foo'.  By default, every working copy should exclude
   'foo' from commits.  We don't want any user's mods of 'foo' to even go
   over the wire.  (This last point rules out hooks.)
 
-(UC4) - Eclipse directory, from issue #3028.
+(UC4) Eclipse directory, from issue #3028.
+  (Not supported by this proposal, see [6])
   "We have a complete Eclipse instance in our svn repository and we want
   to ignore every change in its directory and below. Because Eclipse
   more or less at random creates and deletes file from its own directory
@@ -61,47 +66,26 @@ DETAILS
     The property is called "svn:hold".
 
 (5) VALUE
-(5a) BOOLEAN
-     A file is held-back iff it has an svn:hold property, with whichever
-     value, even empty. A fixed set of subcommands heeds svn:hold.
-     ### JAF: As specified under SUBCOMMANDS, below.
- OR
-(5b) LIST OF STRINGS
-     The value of 'svn:hold' determines which subcommands hold the file:
-     - commit: holding back upon commit is *always* implied.
-     - diff:   Omit local mods of held-back files from diff.
-     - status: Entirely omit the file from 'svn status' output.
-     - copy:   The file should only be copied without the local modifications.
-     - merge:  Don't merge onto the file.
-     - update: Don't update the file, and, in consequence, don't commit it.
-     - ...?
-
+    A file is held-back iff it has an svn:hold property, with whichever
+    value, even empty. A fixed set of subcommands heeds svn:hold,
+    as discussed under SUBCOMMANDS, below.
 
 (6) NODE KINDS
 Only files should be held-back. 'svn:hold' should not act recursively (for
 performance and implementation complexity reasons?), and actually, 'svn:hold'
 should not be allowed to be set on directories. If an entire subtree should be
-put on hold, users can do 'svn propset -R'. Such a recursive propset should
-not error out on the first dir encountered, but instead print a warning that
-svn:hold was only added to the files, ignoring the dirs.
-  ### JAF: So this rules out use case [UC4].
-  ### JAF: A recursive propset should warn or not warn in exactly the same
-      way as a recursive propset of any other file-only property, whatever
-      that way is, if those are already self-consistent, unless there is a
-      good reason to do otherwise.
+put on hold, users can do 'svn propset -R'.
 
 (7) LOCAL HOLD
 The svn:hold property already acts when it is added locally. This provides a
 way to hold back files in only the local working copy, no other users nor the
-repository is affected. See [2].
-
-    ### JAF: Specifically, a file is held back iff the 'svn:hold' property
-      as described in [5] is set on the working version in the WC,
-      regardless whether it's set on the WC base version. One consequence is
-      that a file scheduled for delete is no longer held back from commit.
+repository is affected. See [UC2].
 
-    ### JAF: It seems the principle is that the hold applies only to text
-        and property modifications, not to tree changes.
+Specifically, a file is held back iff the 'svn:hold' property as described in
+[5] is set on the working version in the WC, regardless whether it's set on
+the WC base version. One consequence is that a file scheduled for delete is no
+longer held back from commit, while a locally added file with a locally added
+svn:hold prop *is* held back from commit.
 
 (8) GLOBAL HOLD
 There must be a --do-not-hold option to 'svn commit'. This allows committing
@@ -113,110 +97,94 @@ could mean "ignore the held-back files" 
 or even "commit everything except the svn:hold propadd". --do-not-hold and
 --disable-hold are the only ones I found that aren't ambiguous like that.
 
-### JAF: Alternatively we could say that files are not held back if they are
-    explicitly named targets to the 'commit' (or other) command.  That has
-    the advantages of consistency with the way svn:ignore and depth behave,
-    and of avoiding another command-line option.  It does not provide an
-    easy way to specify all the files in a subtree, but the feature is not
-    suited to ignoring a whole subtree [UC4] so this is not really a
-    disadvantage.
+One consequence of a global hold is that the 'svn:hold' prop will propagate to
+other branches as the propget gets merged into them along with the other text
+edits.
+
+An alternative to adding the --do-not-hold option would be to not hold back
+files if they are explicitly named targets to the 'commit' (or other) command.
+That has the advantages of consistency with the way svn:ignore and depth
+behave, and of avoiding another command-line option.  It does not provide an
+easy way to specify all the files in a subtree -- a disadvantage when users
+have used a recursive propset to set many files on hold.
 
 
 SUBCOMMANDS
-So far, no real point has been made to justify ignoring file mods on any other
-command except 'commit'. I am adding some as I type:
+This discusses how svn:hold may affect other subcommands so that it rounds off
+the user experience with that feature and avoids pitfalls arising from it.
+
+  (10) DIFF: The currently prevailing opinion is that a local diff should not
+  be affected by svn:hold. Nevertheless, some use 'svn diff' to look at
+  exactly those changes that will get committed; for these users, there should
+  be a local configuration option that makes 'svn diff' not show local
+  modifications on held-back files. (Note, when 'svn diff -rN' displays the
+  differences between a revision and the working state, the output should show
+  all diffs with BASE, ignoring only the local changes. As a general rule, if
+  'svn:hold' is set on a file, 'svn diff' should act exactly as if the file
+  was not locally modified.)
 
-  (10) DIFF: if local modifications don't get committed, then there's no need
-  to read about them in a diff of local mods. (Held-back files should *not*
-  omit already-committed modifications.)
-
-  ### JAF: What do you mean by 'omit already-committed modifications'? Do
-      you mean a repos-repos or repos-WC diff should always show all
-      differences, or do you mean a repos-WC diff should always diff to
-      the WC base rather than the working version, or something else?
-
-  ### JAF: So, what's the exact behavioural spec? A repos-repos diff shall
-      show all changes as usual. Unless overridden, a WC-WC diff shall omit
-      local mods on a held-back file. Unless overridden, a repos-WC diff
-      shall omit local mods on a held-back file, by diffing against the base
-      version even if the working version is requested. Diff shall display
-      an added/deleted/replaced file in the usual way, including any
-      modifications against the copy-from source, regardless of the
-      held-back status.
 
   (11) COPY:
-    (12) WC-TO-URL: Copying locally added secrets [3] to a URL is fatal. Any
-    WC-to-URL copy of held-back files should
-      (12a) exclude local mods, or
-            ### JAF: No, don't silently ignore local mods: they might be
-                intentional and important. The behaviour of copies is well
-                established: if you request -rBASE as the source, you copy
-                the base, else you copy the working version. Instead: [12b].
-      (12b) just bail if there are local mods, unless they get a --do-not-hold
-            option. (probably easier to do, until [12a] gets implemented)
+    (12) WC-TO-URL: Copying locally added secrets [UC3] to a URL is fatal. Any
+    WC-to-URL copy of held-back files that have local mods should warn the
+    user and refuse to work unless --do-not-hold (or --do-hold) are passed
+    explicitly.
 
     (13) WC-TO-WC: A WC copy or move will also copy the svn:hold property, and
-    thus isn't that dangerous for [3]. But when a WC-to-WC copy of a subtree
+    thus isn't that dangerous for [UC3]. But when a WC-to-WC copy of a subtree
     that has a held-back file inside is finally committed, the BASE node of
     the held-back file should indeed be added. Omitting the held-back file
     completely would imply a delete within the added tree. So a commit
-    should take care to add files that are held-back, but skip all local
-    modifications.
-    ### JAF: No, don't silently ignore local mods: they might be intentional
-        and important. Instead:
-        (13b) Error out if the commit includes a held-back copied file with
-              local mods and does not specify the do-not-hold option.
-
-    (14a) Committing BASE nodes for added held-back files should be limited to
-          copied/moved files, i.e. where the BASE is nonempty. Simply-added
-          held-back files should not be added to the repos at all.
-     OR
-    (14b) If a held-back file is simply-added (not copied/moved), just add an
-          empty file with no props except svn:hold to the repository.
-    ### JAF: No, don't silently omit the file or commit an empty file.
-        That's stepping outside the territory that this feature should be
-        involved in. Instead:
-        (14c) Error out if the commit includes a held-back added file and does
-              not specify the do-not-hold option.
+    noticing this situation should again warn the user and refuse to work
+    unless --do-not-hold (or --do-hold) are passed explicitly.
 
   (15) STATUS:
   (15a) 'svn status' should show mods on held-back files iff they are
         modified, with an added status indicator like 'H'.
-        ### JAF: (And show added/deleted/replaced held-back files as usual.)
+        (And show added/deleted/replaced held-back files as usual.)
    OR
   (15b) 'svn status' should omit held-back files even if modified,
         unless --show-hold is supplied.
-        ### JAF: (And show added/deleted/replaced held-back files as usual.)
+        (And show added/deleted/replaced held-back files as usual.)
 
-  (16) UPDATE: Holding off updates from a file could be desirable, but I can't
-  think of any real situation that needs this. If holding back updates is ever
-  implemented, it should definitely be optional, as in [5b]. See also [19]!
-
-  ### JAF: No known use case => no special behaviour except [19]; enough said.
-      So: Update shall issue a warning if it removes the held-back status
-      from a file. In all other respects, update shall act as usual: for
-      example, if update deletes a held-back file with local mods, it shall
-      raise a tree conflict in the usual way.
-
-  (17) MERGE: Holding off merges from single files is pure madness. Alas, the
-  whole topic of svn:hold is a nightmare in merge land. Users have to take
-  great care to do The Right Thing: If you merge committed modifications on a
-  locally held-back file, the merge result for it will not be committed --
-  even if there had not been any local modifications on the held-back file.
-  'svn merge' should issue a warning that it has merged files that (now) have
-  the 'svn:hold' property in the local working copy, and that, for basic
-  sanity, --do-not-hold should be supplied at commit time. See also [19]!
-
-  ### JAF: So: Merge shall issue a warning if it modifies, adds, deletes or
-      replaces a held-back file (one that is/was held back before and/or
-      after the merge). Merge shall issue a warning if it changes the
-      held-back status of a file that has local mods.
+  (16) UPDATE: Update shall issue a warning if it removes the held-back status
+      from a file that currently has local modifications. In all other
+      respects, update shall act as usual.  For example, if update deletes a
+      held-back file with local mods, it shall raise a tree conflict in the
+      usual way.  See also [19]!
+
+  (17) MERGE:
+    (171) 'merge' should merge modifications to held-back files exactly the
+    way it does to other files. If a change on a held-back file has been
+    committed, it is considered an intentional change. So this change should
+    definitely be merged to the local file.
+
+    (172) like update, 'merge' might issue a warning if it removes the
+    held-back status from a file that had local modifications prior to the
+    merge. Finding local mods before a merge is uncommon, considering
+    that the merger follows common practice of merging only into unmodified
+    working copies. However, it can happen when multiple merges need to be
+    applied to the same working copy; the warning is useless in such a case,
+    as if there have only been merges, only intentional changes account for
+    the local modifications. The proposed warning is for the specific case
+    where the user merges into a WC that had private changes to held-back
+    files which should not be committed. (This point is very debatable.) 
+
+    (173) Say a 'merge' brings in an intentional change on a held-back file,
+    and assuming there were no local mods before the 'merge'. The next commit
+    should definitely not skip these changes -- they are part of the merge and
+    make up an intentional change. Forgetting to commit a modified held-back
+    file after a merge is almost certainly an error. So when merge brings in a
+    change on a held-back file, it should probably set a flag on the file that
+    persists up to the next successful commit, which causes the commit to
+    complain and abort the entire commit unless the user explicitly passes
+    --do-not-hold.  This gives a safety point for the user to remember to
+    remove any private data that might still be lying around in (also other)
+    held-back files.
 
   (18) SWITCH: Switch should go ahead as always. All it does is pull other
   BASE nodes in under the local mods, so there is no danger of anything
-  leaking around. But see [19]!
-
-  ### JAF: Switch is very similar to update, so see [16].
+  leaking around. Switch is very similar to update. See [16], [19]
 
   (19) UPSTREAM REMOVES 'svn:hold': Users must be warned when update, switch
   or merge remove the 'svn:hold' property from a file that had local mods.