aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLiam Beguin <liambeguin@gmail.com>2017-12-05 12:52:34 -0500
committerJunio C Hamano <gitster@pobox.com>2017-12-05 10:20:51 -0800
commitd8ae6c84da52a210e84b3734bb93c575638236d3 (patch)
tree1754874ac9b537a7a5f542e82b43b67d6d160583 /builtin
parent0cce4a2756eb2c66544615e5ccd74671afb33256 (diff)
downloadgit-d8ae6c84da52a210e84b3734bb93c575638236d3.tar.gz
git-d8ae6c84da52a210e84b3734bb93c575638236d3.tar.xz
rebase -i: learn to abbreviate command names
`git rebase -i` already know how to interpret single-letter command names. Teach it to generate the todo list with these same abbreviated names. Based-on-patch-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Liam Beguin <liambeguin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rebase--helper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/rebase--helper.c b/builtin/rebase--helper.c
index 4229ea0dc..7daee544b 100644
--- a/builtin/rebase--helper.c
+++ b/builtin/rebase--helper.c
@@ -13,6 +13,7 @@ int cmd_rebase__helper(int argc, const char **argv, const char *prefix)
{
struct replay_opts opts = REPLAY_OPTS_INIT;
unsigned flags = 0, keep_empty = 0;
+ int abbreviate_commands = 0;
enum {
CONTINUE = 1, ABORT, MAKE_SCRIPT, SHORTEN_OIDS, EXPAND_OIDS,
CHECK_TODO_LIST, SKIP_UNNECESSARY_PICKS, REARRANGE_SQUASH,
@@ -43,6 +44,7 @@ int cmd_rebase__helper(int argc, const char **argv, const char *prefix)
};
git_config(git_default_config, NULL);
+ git_config_get_bool("rebase.abbreviatecommands", &abbreviate_commands);
opts.action = REPLAY_INTERACTIVE_REBASE;
opts.allow_ff = 1;
@@ -52,6 +54,7 @@ int cmd_rebase__helper(int argc, const char **argv, const char *prefix)
builtin_rebase_helper_usage, PARSE_OPT_KEEP_ARGV0);
flags |= keep_empty ? TODO_LIST_KEEP_EMPTY : 0;
+ flags |= abbreviate_commands ? TODO_LIST_ABBREVIATE_CMDS : 0;
flags |= command == SHORTEN_OIDS ? TODO_LIST_SHORTEN_IDS : 0;
if (command == CONTINUE && argc == 1)