summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b1744cb)
raw | patch | inline | side by side (parent: b1744cb)
author | Dominik Vogt <dvogt@ffm.tc.iot.dtag.de> | |
Thu, 20 Mar 2008 10:23:26 +0000 (11:23 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 20 Mar 2008 12:34:30 +0000 (13:34 +0100) |
Signed-off-by: Dominik Vogt <dvogt@ffm.tc.iot.dtag.de>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
manual.txt | patch | blob | history | |
tig.c | patch | blob | history | |
tigrc.5.txt | patch | blob | history |
diff --git a/manual.txt b/manual.txt
index ca015613e9eb3a5f6bf26ea83944ae9f7cccd5af..fd466dbef64394189cae4fe2ef717d9bc43d377f 100644 (file)
--- a/manual.txt
+++ b/manual.txt
the revision log.
v Show version.
'.' Toggle line numbers on/off.
+D Toggle date display on/off.
+A Toggle author display on/off.
g Toggle revision graph visualization on/off.
+F Toggle reference display on/off (tag and branch names).
':' Open prompt. This allows you to specify what git command \
to run. Example `:log -p`
u Update status of file. In the status view, this allows you to add an \
index 73aa9913c7a3a248975565850ac6ec1a0512f262..6cfe40e36b334ef6fdcddf3e76e48243da13c4d7 100644 (file)
--- a/tig.c
+++ b/tig.c
REQ_(SHOW_VERSION, "Show version information"), \
REQ_(STOP_LOADING, "Stop all loading views"), \
REQ_(TOGGLE_LINENO, "Toggle line numbers"), \
+ REQ_(TOGGLE_DATE, "Toggle date display"), \
+ REQ_(TOGGLE_AUTHOR, "Toggle author display"), \
REQ_(TOGGLE_REV_GRAPH, "Toggle revision graph visualization"), \
+ REQ_(TOGGLE_REFS, "Toggle reference display (tags/branches)"), \
REQ_(STATUS_UPDATE, "Update file status"), \
REQ_(STATUS_MERGE, "Merge file using external tool"), \
REQ_(TREE_PARENT, "Switch to parent directory in tree view"), \
" -h, --help Show help message and exit\n";
/* Option and state variables. */
+static bool opt_date = TRUE;
+static bool opt_author = TRUE;
static bool opt_line_number = FALSE;
static bool opt_rev_graph = FALSE;
+static bool opt_show_refs = TRUE;
static int opt_num_interval = NUMBER_INTERVAL;
static int opt_tab_size = TABSIZE;
static enum request opt_request = REQ_VIEW_MAIN;
{ 'v', REQ_SHOW_VERSION },
{ 'r', REQ_SCREEN_REDRAW },
{ '.', REQ_TOGGLE_LINENO },
+ { 'D', REQ_TOGGLE_DATE },
+ { 'A', REQ_TOGGLE_AUTHOR },
{ 'g', REQ_TOGGLE_REV_GRAPH },
+ { 'F', REQ_TOGGLE_REFS },
{ ':', REQ_PROMPT },
{ 'u', REQ_STATUS_UPDATE },
{ 'M', REQ_STATUS_MERGE },
redraw_display();
break;
+ case REQ_TOGGLE_DATE:
+ opt_date = !opt_date;
+ redraw_display();
+ break;
+
+ case REQ_TOGGLE_AUTHOR:
+ opt_author = !opt_author;
+ redraw_display();
+ break;
+
case REQ_TOGGLE_REV_GRAPH:
opt_rev_graph = !opt_rev_graph;
redraw_display();
break;
+ case REQ_TOGGLE_REFS:
+ opt_show_refs = !opt_show_refs;
+ redraw_display();
+ break;
+
case REQ_PROMPT:
/* Always reload^Wrerun commands from the prompt. */
open_view(view, opt_request, OPEN_RELOAD);
@@ -4175,7 +4199,7 @@ main_draw(struct view *view, struct line *line, unsigned int lineno, bool select
tilde_attr = get_line_attr(LINE_MAIN_DELIM);
}
- {
+ if (opt_date) {
int n;
timelen = strftime(buf, sizeof(buf), DATE_FORMAT, &commit->time);
@@ -4193,7 +4217,7 @@ main_draw(struct view *view, struct line *line, unsigned int lineno, bool select
if (type != LINE_CURSOR)
wattrset(view->win, get_line_attr(LINE_MAIN_AUTHOR));
- {
+ if (opt_author) {
int max_len;
max_len = view->width - col;
@@ -4230,7 +4254,7 @@ main_draw(struct view *view, struct line *line, unsigned int lineno, bool select
wmove(view->win, lineno, col);
- if (commit->refs) {
+ if (opt_show_refs && commit->refs) {
size_t i = 0;
do {
diff --git a/tigrc.5.txt b/tigrc.5.txt
index f7d7bed5c20a94702ba4f662fdb0e54ccb9ca76b..c974efcdd6c2d12c7c60a230dfd648793ff777f0 100644 (file)
--- a/tigrc.5.txt
+++ b/tigrc.5.txt
show-version Show version information
stop-loading Stop all loading views
toggle-lineno Toggle line numbers
+toggle-date Toggle date display
+toggle-author Toggle author display
toggle-rev-graph Toggle revision graph visualization
+toggle-refs Toggle reference display
status-update Update file status
status-merge Resolve unmerged file
tree-parent Switch to parent directory in tree view