From da8b99da8f4dc5512c23154ec6c0aa7d3c313555 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 21 Feb 2009 01:28:41 +0100 Subject: [PATCH] Predefined external command: git commit Status view allows management of the stage area, and the user is likely to issue a commit as soon as (s)he's satisfied with the result. Mapping 'git commit' to the 'C' key in status view makes this straightforward and allows a very streamlined workflow from within git. Signed-off-by: Giuseppe Bilotta Signed-off-by: Jonas Fonseca --- manual.txt | 9 +++++---- tig.c | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/manual.txt b/manual.txt index 74fa3f8..74dda06 100644 --- a/manual.txt +++ b/manual.txt @@ -449,11 +449,12 @@ a script or program. They are bound to keys and use information from the current browsing state, such as the current commit ID. Tig comes with the following built-in external commands: -`-------`-------------------------------------------------------------------- -Key Action +`-------`-------`------------------------------------------------------------ +Keymap Key Action ----------------------------------------------------------------------------- -C git cherry-pick %(commit) -G git gc +main C git cherry-pick %(commit) +status C git commit +generic G git gc ----------------------------------------------------------------------------- [[refspec]] diff --git a/tig.c b/tig.c index a968d51..9dba5e9 100644 --- a/tig.c +++ b/tig.c @@ -1369,6 +1369,7 @@ static void add_builtin_run_requests(void) { const char *cherry_pick[] = { "git", "cherry-pick", "%(commit)", NULL }; + const char *commit[] = { "git", "commit", NULL }; const char *gc[] = { "git", "gc", NULL }; struct { enum keymap keymap; @@ -1377,6 +1378,7 @@ add_builtin_run_requests(void) const char **argv; } reqs[] = { { KEYMAP_MAIN, 'C', ARRAY_SIZE(cherry_pick) - 1, cherry_pick }, + { KEYMAP_STATUS, 'C', ARRAY_SIZE(commit) - 1, commit }, { KEYMAP_GENERIC, 'G', ARRAY_SIZE(gc) - 1, gc }, }; int i; -- 2.30.2