Recently a discussion started on the mailing list, which short option
shall be best for a long option. (-f being always --force and therefore
should not be reassigned another meaning in one particular command)
See http://www.mail-archive.com/git@vger.kernel.org/msg38456.html
For discussions as these we need a script to easily generate an
overview of all available one letter options, and their long option
equivalents.
As the list of options was not retrieved fully automated,
there might be minor errors or missing items.
Signed-off-by: Stefan Beller
---
Documentation/generateShortOptions.py | 460 ++
1 file changed, 460 insertions(+)
create mode 100644 Documentation/generateShortOptions.py
diff --git a/Documentation/generateShortOptions.py
b/Documentation/generateShortOptions.py
new file mode 100644
index 000..1d326f9
--- /dev/null
+++ b/Documentation/generateShortOptions.py
@@ -0,0 +1,460 @@
+#!/usr/bin/python
+# This script generates a table, which should help you getting a
+# better overview of the existing long and short options of the
+# various git commands. This script actually is only suited for
+# generating the table itself, as the collection of the options of
+# the git commands needs to be done manually.
+# For the majority of commands, which are written in C, a small patch
+# such as the following helps to extract the relevant cases for this
+# script. However you still need to go through the shell commands
+# manually.
+# diff --git a/parse-options.c b/parse-options.c
+# index 62e9b1c..b356ca9 100644
+# --- a/parse-options.c
+# +++ b/parse-options.c
+# @@ -500,6 +500,12 @@ int parse_options(int argc, const char **argv, const
char *prefix,
+# {
+# struct parse_opt_ctx_t ctx;
+#
+# +for (; options->type != OPTION_END; options++) {
+# +if (options->long_name && options->short_name)
+# +printf("%s, %c, %s\n", argv[0], options->short_name,
options->long_name);
+# +}
+# +exit(1);
+# +
+# parse_options_start(&ctx, argc, argv, prefix, options, flags);
+# switch (parse_options_step(&ctx, options, usagestr)) {
+# case PARSE_OPT_HELP:
+# --
+
+
+# Command, short option, long option
+cmd_results="""add, n, dry-run
+add, v, verbose
+add, i, interactive
+add, p, patch
+add, e, edit
+add, f, force
+add, u, update
+add, N, intent-to-add
+add, A, all
+
+am, i, interactive
+am, 3, 3way
+am, q, quiet
+am, s, signoff
+am, u, utf8
+am, k, keep
+
+annotate, p, porcelain
+
+apply, 3, 3way
+apply, R, reverse
+apply, v, verbose
+
+archive, o, output
+
+blame, p, porcelain
+blame, f, show-name
+blame, n, show-number
+blame, e, show-email
+
+branch, v, verbose
+branch, q, quiet
+branch, t, track
+branch, u, set-upstream-to
+branch, r, remotes
+branch, a, all
+branch, d, delete
+branch, m, move
+branch, l, create-reflog
+branch, f, force
+
+check-attr, a, all
+
+check-ignore, q, quiet
+check-ignore, v, verbose
+check-ignore, n, non-matching
+
+checkout, q, quiet
+checkout, t, track
+checkout, 2, ours
+checkout, 3, theirs
+checkout, f, force
+checkout, m, merge
+checkout, p, patch
+
+checkout-index, a, all
+checkout-index, f, force
+checkout-index, q, quiet
+checkout-index, n, no-create
+checkout-index, u, index
+
+cherry, v, verbose
+
+cherry-pick, n, no-commit
+cherry-pick, e, edit
+cherry-pick, s, signoff
+cherry-pick, m, mainline
+cherry-pick, X, strategy-option
+
+clean, q, quiet
+clean, n, dry-run
+clean, f, force
+clean, i, interactive
+clean, e, exclude
+
+clone, v, verbose
+clone, q, quiet
+clone, n, no-checkout
+clone, l, local
+clone, s, shared
+clone, o, origin
+clone, b, branch
+clone, u, upload-pack
+clone, c, config
+
+commit, q, quiet
+commit, v, verbose
+commit, F, file
+commit, m, message
+commit, c, reedit-message
+commit, C, reuse-message
+commit, s, signoff
+commit, t, template
+commit, e, edit
+commit, S, gpg-sign
+commit, a, all
+commit, i, include
+commit, p, patch
+commit, o, only
+commit, n, no-verify
+commit, z, null
+commit, u, untracked-files
+
+config, f, file
+config, l, list
+config, e, edit
+config, z, null
+
+count-objects, v, verbose
+count-objects, H, human-readable
+
+diff, u, patch
+diff, p, patch
+diff, U, unified
+diff, B, break-rewrites
+diff, M, find-renames
+diff, C, find-copies
+diff, D, irreversible-delete
+diff, a, text
+diff, b, ignore-space-change
+diff, w, ignore-all-space
+diff, W, function-context
+
+diff-files, u, patch
+diff-files, p, patch
+diff-files, U, unified
+diff-files, B, break-rewrites
+diff-files, M, find-renames
+diff-files, C, find-copies
+diff-files, D, irreversible-delete
+diff-files, a, text
+diff-files, b, ignore-space-change
+diff-files, w, ignore-all-space
+diff-files, W, function-context
+diff-files, c, cc
+# diff-index and diff-tree similar, to be done
+
+fetch, v, verbose
+fetch, q, quiet
+fetch, a, append
+fetch, f, force
+fetch, m, multiple
+fetch, t,