Code

Predefined external command: git commit
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 21 Feb 2009 00:28:41 +0000 (01:28 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Sat, 21 Feb 2009 12:10:22 +0000 (13:10 +0100)
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 <giuseppe.bilotta@gmail.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
manual.txt
tig.c

index 74fa3f812d1439c0b0533b0713d109e6da02aa47..74dda06a58475a372a851757d0dc61990f6067bc 100644 (file)
@@ -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 a968d51bb7b464f65c0a2cabb38cd0fb70173b00..9dba5e9f6c3377b726422d78d0940b843ffa8af2 100644 (file)
--- 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;