git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: git@vger.kernel.org, Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Subject: [tig PATCH] Predefined external command: git commit
Date: Sat, 21 Feb 2009 01:28:41 +0100	[thread overview]
Message-ID: <1235176121-17483-1-git-send-email-giuseppe.bilotta@gmail.com> (raw)

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>
---

It might make sense to map 'A' to 'git commit --amend', too, even though
that key is currently taken by author display toggle.

 manual.txt |    9 +++++----
 tig.c      |    2 ++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/manual.txt b/manual.txt
index 74fa3f8..104989f 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 9349f69..c22f271 100644
--- a/tig.c
+++ b/tig.c
@@ -1365,6 +1365,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;
@@ -1373,6 +1374,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;
-- 
1.6.2.rc1.258.g1d592.dirty

             reply	other threads:[~2009-02-21  0:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-21  0:28 Giuseppe Bilotta [this message]
2009-02-21 16:19 ` [tig PATCH] Predefined external command: git commit Jonas Fonseca
2009-02-21 17:19   ` Giuseppe Bilotta
2009-02-21 17:51     ` Jonas Fonseca
2009-02-21 18:52       ` Giuseppe Bilotta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1235176121-17483-1-git-send-email-giuseppe.bilotta@gmail.com \
    --to=giuseppe.bilotta@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).