Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-3415

svn cmdline client should honor the ignore-on-commit changelist

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • ---
    • ---
    • cmdline client
    • None

    Description

      At least with the Subversion command line client, there is no easy way to prevent local mods on a file to 
      be committed (on 'svn commit') *while* still receiving the remote mods for that file (on 'svn update'). 
      This capability could be gained by supporting the special "ignore-on-commit" changelist as done by 
      TortoiseSVN.
      
      Background: The FAQ entry "I have a file in my project that every developer must change, but I don't 
      want those local mods to ever be committed. How can I make 'svn commit' ignore the file?" describes 
      more or less this problem for a local configuration file.
      
      The suggested solution is to only keep a template in the repository, and to maintain the actual file 
      manually or through a build script. However, this has a number of important downsides:
      - it is platform-specific and a hassle to set-up
      - on "svn up", remote mods only appear in the template; they are not automatically merged with the 
      local mods in the 'active' file
      - the solution affects every developer, it is not possible to have local changes for one developer as an 
      exception
      
      As a workaround for these problems, it is often easier if you _do_ have a versioned file, but you never 
      include it in the argument list when doing "svn commit" (so that the local mods are not committed). 
      This means that you always have to name files explicitly and there is a danger that you inadvertently 
      commit the local mods to the forbidden file with "svn commit -m Log".
      
      With changelists, Subversion gained the ability to apply operations to sets of files, without having to 
      name them explicitly for every operation. Unfortunately, the default operations (such as "svn commit" 
      without any options) seem to include all files regardless of changelist membership, and with the "--
      changelist" option, it is only possible to retain files when there are included in one or more 
      changelist(s), not when they are NOT included in a particular changelist. So this does not help for the 
      above problem.
      
      Nevertheless, TortoiseSVN elegantly employs the changelist feature to support the exclusion of files on 
      commit. The changelist named "ignore-on-commit" is considered special, and its members are 
      excluded by default from commit operations:
      
      [1] http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-commit.html#tsvn-dug-commit-
      ignore
      [2] http://tortoisesvn.tigris.org/tsvn_1.5_releasenotes.html#changelist-support
      
      The documentation reinforces the point that there is indeed a need for such a feature: "Sometimes you 
      have versioned files that change frequently but that you really don't want to commit. Sometimes this 
      indicates a flaw in your build process - why are those files versioned? should you be using template 
      files? But occasionally it is inevitable. A classic reason is that your IDE changes a timestamp in the 
      project file every time you build. The project file has to be versioned as it includes all the build settings, 
      but it doesn't need to be committed just because the timestamp changed."
      
      Given that TortoiseSVN already committed to this solution, I think it would be beneficial if the svn 
      command-line client honors the "ignore-on-commit" changelist in the same manner. Concretely:
      
      - "svn diff" and "svn commit" filter out the members of a changelist named "ignore-on-commit" unless 
      that changelist is included in a "--changelist" option
      - "svn stat" filters in the same manner, or lists the members under a separate heading
      - "svn up" does not consider the "ignore-on-commit" changelist in a special manner
      

      Original issue reported by brunodefraine

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              subversion-importer Subversion Importer
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: