{"thread":{"id":"20784","subject":"[PATCH] UI consistency: allow --force for where -f means force","startedAt":"2009-08-29T09:05:00Z","lastAt":"2009-08-29T09:05:00Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"122084","messageId":"4A98EF3C.3010100@lsrfire.ath.cx","threadId":"20784","inReplyTo":null,"subject":"[PATCH] UI consistency: allow --force for where -f means force","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2009-08-29T09:05:00Z","receivedAt":"2009-08-29T09:05:00Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"git branch, checkout, clean, mv and tag all have an option -f to override\ncertain checks.  This patch makes them accept the long option --force as\na synonym.\n\nWhile we're at it, document that checkout support --quiet as synonym for\nits short option -q.\n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n Documentation/git-branch.txt   |    1 +\n Documentation/git-checkout.txt |    2 ++\n Documentation/git-clean.txt    |    1 +\n Documentation/git-mv.txt       |    1 +\n Documentation/git-tag.txt      |    1 +\n builtin-branch.c               |    2 +-\n builtin-checkout.c             |    2 +-\n builtin-clean.c                |    2 +-\n builtin-mv.c                   |    2 +-\n builtin-tag.c                  |    2 +-\n 10 files changed, 11 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex 9998887..aad71dc 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -76,6 +76,7 @@ OPTIONS\n \tbased sha1 expressions such as \"<branchname>@\\{yesterday}\".\n \n -f::\n+--force::\n \tReset <branchname> to <startpoint> if <branchname> exists\n \talready. Without `-f` 'git-branch' refuses to change an existing branch.\n \ndiff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\nindex ad4b31e..b1314b5 100644\n--- a/Documentation/git-checkout.txt\n+++ b/Documentation/git-checkout.txt\n@@ -45,9 +45,11 @@ file can be discarded to recreate the original conflicted merge result.\n OPTIONS\n -------\n -q::\n+--quiet::\n \tQuiet, suppress feedback messages.\n \n -f::\n+--force::\n \tWhen switching branches, proceed even if the index or the\n \tworking tree differs from HEAD.  This is used to throw away\n \tlocal changes.\ndiff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt\nindex ae8938b..9d291bd 100644\n--- a/Documentation/git-clean.txt\n+++ b/Documentation/git-clean.txt\n@@ -32,6 +32,7 @@ OPTIONS\n \tif you really want to remove such a directory.\n \n -f::\n+--force::\n \tIf the git configuration specifies clean.requireForce as true,\n \t'git-clean' will refuse to run unless given -f or -n.\n \ndiff --git a/Documentation/git-mv.txt b/Documentation/git-mv.txt\nindex 9c56602..bdcb585 100644\n--- a/Documentation/git-mv.txt\n+++ b/Documentation/git-mv.txt\n@@ -28,6 +28,7 @@ committed.\n OPTIONS\n -------\n -f::\n+--force::\n \tForce renaming or moving of a file even if the target exists\n -k::\n         Skip move or rename actions which would lead to an error\ndiff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt\nindex 5113eae..299b04f 100644\n--- a/Documentation/git-tag.txt\n+++ b/Documentation/git-tag.txt\n@@ -51,6 +51,7 @@ OPTIONS\n \tMake a GPG-signed tag, using the given key\n \n -f::\n+--force::\n \tReplace an existing tag with the given name (instead of failing)\n \n -d::\ndiff --git a/builtin-branch.c b/builtin-branch.c\nindex 1a03d5f..9f57992 100644\n--- a/builtin-branch.c\n+++ b/builtin-branch.c\n@@ -586,7 +586,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tOPT_BIT('m', NULL, &rename, \"move/rename a branch and its reflog\", 1),\n \t\tOPT_BIT('M', NULL, &rename, \"move/rename a branch, even if target exists\", 2),\n \t\tOPT_BOOLEAN('l', NULL, &reflog, \"create the branch's reflog\"),\n-\t\tOPT_BOOLEAN('f', NULL, &force_create, \"force creation (when already exists)\"),\n+\t\tOPT_BOOLEAN('f', \"force\", &force_create, \"force creation (when already exists)\"),\n \t\t{\n \t\t\tOPTION_CALLBACK, 0, \"no-merged\", &merge_filter_ref,\n \t\t\t\"commit\", \"print only not merged branches\",\ndiff --git a/builtin-checkout.c b/builtin-checkout.c\nindex c6d6ac9..36e2116 100644\n--- a/builtin-checkout.c\n+++ b/builtin-checkout.c\n@@ -584,7 +584,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)\n \t\t\t    2),\n \t\tOPT_SET_INT('3', \"theirs\", &opts.writeout_stage, \"stage\",\n \t\t\t    3),\n-\t\tOPT_BOOLEAN('f', NULL, &opts.force, \"force\"),\n+\t\tOPT_BOOLEAN('f', \"force\", &opts.force, \"force\"),\n \t\tOPT_BOOLEAN('m', \"merge\", &opts.merge, \"merge\"),\n \t\tOPT_STRING(0, \"conflict\", &conflict_style, \"style\",\n \t\t\t   \"conflict style (merge or diff3)\"),\ndiff --git a/builtin-clean.c b/builtin-clean.c\nindex 05c763c..28cdcd0 100644\n--- a/builtin-clean.c\n+++ b/builtin-clean.c\n@@ -41,7 +41,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \tstruct option options[] = {\n \t\tOPT__QUIET(&quiet),\n \t\tOPT__DRY_RUN(&show_only),\n-\t\tOPT_BOOLEAN('f', NULL, &force, \"force\"),\n+\t\tOPT_BOOLEAN('f', \"force\", &force, \"force\"),\n \t\tOPT_BOOLEAN('d', NULL, &remove_directories,\n \t\t\t\t\"remove whole directories\"),\n \t\tOPT_BOOLEAN('x', NULL, &ignored, \"remove ignored files, too\"),\ndiff --git a/builtin-mv.c b/builtin-mv.c\nindex b592c36..1b20028 100644\n--- a/builtin-mv.c\n+++ b/builtin-mv.c\n@@ -53,7 +53,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \tint verbose = 0, show_only = 0, force = 0, ignore_errors = 0;\n \tstruct option builtin_mv_options[] = {\n \t\tOPT__DRY_RUN(&show_only),\n-\t\tOPT_BOOLEAN('f', NULL, &force, \"force move/rename even if target exists\"),\n+\t\tOPT_BOOLEAN('f', \"force\", &force, \"force move/rename even if target exists\"),\n \t\tOPT_BOOLEAN('k', NULL, &ignore_errors, \"skip move/rename errors\"),\n \t\tOPT_END(),\n \t};\ndiff --git a/builtin-tag.c b/builtin-tag.c\nindex a51a6d1..c479018 100644\n--- a/builtin-tag.c\n+++ b/builtin-tag.c\n@@ -390,7 +390,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \t\tOPT_BOOLEAN('s', NULL, &sign, \"annotated and GPG-signed tag\"),\n \t\tOPT_STRING('u', NULL, &keyid, \"key-id\",\n \t\t\t\t\t\"use another key to sign the tag\"),\n-\t\tOPT_BOOLEAN('f', NULL, &force, \"replace the tag if exists\"),\n+\t\tOPT_BOOLEAN('f', \"force\", &force, \"replace the tag if exists\"),\n \n \t\tOPT_GROUP(\"Tag listing options\"),\n \t\t{\n-- \n1.6.4.1\n"}]}