[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Feature request: Longer "use --force to override" messages

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-03-10 20:47:46 CET

Vincent Starre wrote:
> Simple request here. Sometimes SVN says something like "cannot do this,
> file has local changes. (use --force to override this restriction)", but
> it doesnt do anything to explain the true implications of this. I am
> left wondering when, for example, I move a modified file, "Does this
> mean it will destroy my changes?"
>
> Anyone agree/disagree?

I agree. The right place to explain what "--force" does is in the help (not in
the error message). The help system has recently been modified to allow the
description of an option to be tailored to suit different subcommands.

See the thread "[Patch] subcommand-specific option descriptors" around
2006-02-15. In that thread, there was a list of meanings for "--force" for all
of the commands that use it, and it should be a simple matter to generate a
patch from that information. I attach my "main.patch" which is a work in
progress. It has some question marks where I'm not sure the explanation is
correct, and also I'm not entirely happy about having the effect of "--force"
mentioned only in the option descriptions section: I think in many cases it
would be best to mention it in the main help text for the command as well. My
patch in its current form also unintentionally adds some blank lines to help
output.

- Julian

* subversion/svn/main.c

Index: subversion/svn/main.c
===================================================================
--- subversion/svn/main.c (revision 18553)
+++ subversion/svn/main.c (working copy)
@@ -188,10 +188,12 @@ const svn_opt_subcommand_desc2_t svn_cl_
   { "add", svn_cl__add, {0}, N_
     ("Put files and directories under version control, scheduling\n"
      "them for addition to repository. They will be added in next commit.\n"
- "usage: add PATH...\n"),
+ "usage: add PATH...\n"
+ "\n"),
     {svn_cl__targets_opt, 'N', 'q', svn_cl__config_dir_opt,
      svn_cl__force_opt, svn_cl__no_ignore_opt, svn_cl__autoprops_opt,
- svn_cl__no_autoprops_opt} },
+ svn_cl__no_autoprops_opt},
+ {{svn_cl__force_opt, N_("recurse even into already-versioned folders (?)")}} },
 
   { "blame", svn_cl__blame, {"praise", "annotate", "ann"}, N_
     ("Output the content of specified files or\n"
@@ -268,7 +270,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
      " 2. Each item specified by a URL is deleted from the repository\n"
      " via an immediate commit.\n"),
     {svn_cl__force_opt, 'q', svn_cl__targets_opt,
- SVN_CL__LOG_MSG_OPTIONS, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt} },
+ SVN_CL__LOG_MSG_OPTIONS, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt},
+ {{svn_cl__force_opt, N_("remove even unversioned and modified items")}} },
 
   { "diff", svn_cl__diff, {"di"}, N_
     ("Display the differences between two paths.\n"
@@ -300,7 +303,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
      svn_cl__diff_cmd_opt, 'x', svn_cl__no_diff_deleted,
      svn_cl__notice_ancestry_opt, svn_cl__summarize,
      svn_cl__force_opt, SVN_CL__AUTH_OPTIONS,
- svn_cl__config_dir_opt} },
+ svn_cl__config_dir_opt},
+ {{svn_cl__force_opt, N_("show diff even if the file is believed to be \"binary\"")}} },
 
   { "export", svn_cl__export, {0}, N_
     ("Create an unversioned copy of a tree.\n"
@@ -320,10 +324,12 @@ const svn_opt_subcommand_desc2_t svn_cl_
      " not be copied.\n"
      "\n"
      " If specified, PEGREV determines in which revision the target is first\n"
- " looked up.\n"),
+ " looked up.\n"
+ "\n"),
     {'r', 'q', 'N', svn_cl__force_opt, SVN_CL__AUTH_OPTIONS,
      svn_cl__config_dir_opt, svn_cl__native_eol_opt,
- svn_cl__ignore_externals_opt} },
+ svn_cl__ignore_externals_opt},
+ {{svn_cl__force_opt, N_("overwrite existing files or directories (?)")}} },
 
   { "help", svn_cl__help, {"?", "h"}, N_
     ("Describe the usage of this program or its subcommands.\n"
@@ -382,13 +388,13 @@ const svn_opt_subcommand_desc2_t svn_cl_
     ("Lock working copy paths or URLs in the repository, so that\n"
      "no other user can commit changes to them.\n"
      "usage: lock TARGET...\n"
- "\n"
- " Use --force to steal the lock from another user or working copy.\n"),
+ "\n"),
     { svn_cl__targets_opt, 'm', 'F', svn_cl__force_log_opt,
       svn_cl__encoding_opt, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt,
       svn_cl__force_opt },
     {{'F', N_("read lock comment from file ARG")},
- {'m', N_("specify lock comment ARG")}} },
+ {'m', N_("specify lock comment ARG")},
+ {svn_cl__force_opt, N_("steal the lock from another user or working copy")}} },
 
   { "log", svn_cl__log, {0}, N_
     ("Show the log messages for a set of revision(s) and/or file(s).\n"
@@ -442,10 +448,12 @@ const svn_opt_subcommand_desc2_t svn_cl_
      " WCPATH is the working copy path that will receive the changes.\n"
      " If WCPATH is omitted, a default value of '.' is assumed, unless\n"
      " the sources have identical basenames that match a file within '.':\n"
- " in which case, the differences will be applied to that file.\n"),
+ " in which case, the differences will be applied to that file.\n"
+ "\n"),
     {'r', 'c', 'N', 'q', svn_cl__force_opt, svn_cl__dry_run_opt,
      svn_cl__merge_cmd_opt, svn_cl__ignore_ancestry_opt,
- SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt} },
+ SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt},
+ {{svn_cl__force_opt, N_("delete locally modified or unversioned files")}} },
 
   { "mkdir", svn_cl__mkdir, {0}, N_
     ("Create a new directory under version control.\n"
@@ -473,9 +481,11 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "\n"
      " SRC and DST can both be working copy (WC) paths or URLs:\n"
      " WC -> WC: move and schedule for addition (with history)\n"
- " URL -> URL: complete server-side rename.\n"),
+ " URL -> URL: complete server-side rename.\n"
+ "\n"),
     {'r', 'q', svn_cl__force_opt,
- SVN_CL__LOG_MSG_OPTIONS, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt} },
+ SVN_CL__LOG_MSG_OPTIONS, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt},
+ {{svn_cl__force_opt, N_("delete unversioned or modified items")}} },
 
   { "propdel", svn_cl__propdel, {"pdel", "pd"}, N_
     ("Remove a property from files, dirs, or revisions.\n"
@@ -495,10 +505,12 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "\n"
      " 1. Edits versioned props in working copy.\n"
      " 2. Edits unversioned remote prop on repos revision.\n"
- " TARGET only determines which repository to access.\n"),
+ " TARGET only determines which repository to access.\n"
+ "\n"),
     {'r', svn_cl__revprop_opt, SVN_CL__AUTH_OPTIONS,
      svn_cl__encoding_opt, svn_cl__editor_cmd_opt, svn_cl__force_opt,
- svn_cl__config_dir_opt} },
+ svn_cl__config_dir_opt},
+ {{svn_cl__force_opt, N_("skip some validity checking on the new value")}} },
 
   { "propget", svn_cl__propget, {"pget", "pg"}, N_
     ("Print the value of a property on files, dirs, or revisions.\n"
@@ -570,11 +582,13 @@ const svn_opt_subcommand_desc2_t svn_cl_
      " The svn:keywords, svn:executable, svn:eol-style, svn:mime-type and\n"
      " svn:needs-lock properties cannot be set on a directory. A non-recursive\n"
      " attempt will fail, and a recursive attempt will set the property\n"
- " only on the file children of the directory.\n"),
+ " only on the file children of the directory.\n"
+ "\n"),
     {'F', svn_cl__encoding_opt, 'q', 'r', svn_cl__targets_opt, 'R',
      svn_cl__revprop_opt, SVN_CL__AUTH_OPTIONS, svn_cl__force_opt,
      svn_cl__config_dir_opt},
- {{'F', N_("read propery value from file ARG")}} },
+ {{'F', N_("read propery value from file ARG")},
+ {svn_cl__force_opt, N_("skip some validity checking on the new value")}} },
 
   { "resolved", svn_cl__resolved, {0}, N_
     ("Remove 'conflicted' state on working copy files or directories.\n"
@@ -688,10 +702,10 @@ const svn_opt_subcommand_desc2_t svn_cl_
   { "unlock", svn_cl__unlock, {0}, N_
     ("Unlock working copy paths or URLs.\n"
      "usage: unlock TARGET...\n"
- "\n"
- " Use --force to break the lock.\n"),
+ "\n"),
     { svn_cl__targets_opt, SVN_CL__AUTH_OPTIONS,
- svn_cl__config_dir_opt, svn_cl__force_opt } },
+ svn_cl__config_dir_opt, svn_cl__force_opt },
+ {{svn_cl__force_opt, N_("break the lock held by another user")}} },
 
   { "update", svn_cl__update, {"up"}, N_
     ("Bring changes from the repository into the working copy.\n"

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 10 20:49:27 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.