summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0773ae0)
raw | patch | inline | side by side (parent: 0773ae0)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 7 Oct 2008 10:28:01 +0000 (12:28 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 7 Oct 2008 10:28:01 +0000 (12:28 +0200) |
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index 85faaf2833c7af0c1e07e638c7c439a8826d9dea..dd1cc170d6739a20f980ebdb29078d27b770316c 100644 (file)
--- a/NEWS
+++ b/NEWS
Improvements:
- Checkout files with unstaged changes. Bound to '!' by default.
- - Main: use --topo-order also when rev-list arguments are given on the
+ - Main view: use --topo-order also when rev-list arguments are given on the
command line.
+ - Log view: support for refreshing.
Bug fixes:
- - Status: use ls-files' --exclude-standard so user specific ignore
+ - Status view: use ls-files' --exclude-standard so user specific ignore
rules are effective. The option was added in git version 1.5.4.
tig-0.12
index b896b92f1f48ec6808a48473552c5a54e3898c06..25a6d76027fa6621c3ea88ce21cb9b7d826a07b0 100644 (file)
--- a/tig.c
+++ b/tig.c
static void set_nonblocking_input(bool loading);
static size_t utf8_length(const char *string, int *width, size_t max_width, int *trimmed, bool reserve);
static bool prompt_yesno(const char *prompt);
+static int load_refs(void);
#define ABS(x) ((x) >= 0 ? (x) : -(x))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
void (*select)(struct view *view, struct line *line);
};
-static struct view_ops pager_ops;
-static struct view_ops main_ops;
-static struct view_ops tree_ops;
-static struct view_ops blob_ops;
static struct view_ops blame_ops;
+static struct view_ops blob_ops;
static struct view_ops help_ops;
-static struct view_ops status_ops;
+static struct view_ops log_ops;
+static struct view_ops main_ops;
+static struct view_ops pager_ops;
static struct view_ops stage_ops;
+static struct view_ops status_ops;
+static struct view_ops tree_ops;
#define VIEW_STR(name, cmd, env, ref, ops, map, git) \
{ name, cmd, #env, ref, ops, map, git }
static struct view views[] = {
VIEW_(MAIN, "main", &main_ops, TRUE, ref_head),
VIEW_(DIFF, "diff", &pager_ops, TRUE, ref_commit),
- VIEW_(LOG, "log", &pager_ops, TRUE, ref_head),
+ VIEW_(LOG, "log", &log_ops, TRUE, ref_head),
VIEW_(TREE, "tree", &tree_ops, TRUE, ref_commit),
VIEW_(BLOB, "blob", &blob_ops, TRUE, ref_blob),
VIEW_(BLAME, "blame", &blame_ops, TRUE, ref_commit),
/* FIXME: When all views can refresh always do this. */
if (view == VIEW(REQ_VIEW_STATUS) ||
view == VIEW(REQ_VIEW_MAIN) ||
+ view == VIEW(REQ_VIEW_LOG) ||
view == VIEW(REQ_VIEW_STAGE))
request = REQ_REFRESH;
else
pager_select,
};
+static enum request
+log_request(struct view *view, enum request request, struct line *line)
+{
+ switch (request) {
+ case REQ_REFRESH:
+ load_refs();
+ open_view(view, REQ_VIEW_LOG, OPEN_REFRESH);
+ return REQ_NONE;
+ default:
+ return pager_request(view, request, line);
+ }
+}
+
+static struct view_ops log_ops = {
+ "line",
+ NULL,
+ pager_read,
+ pager_draw,
+ log_request,
+ pager_grep,
+ pager_select,
+};
+
/*
* Help backend
* Main view backend
*/
-static int load_refs(void);
-
static bool
main_draw(struct view *view, struct line *line, unsigned int lineno)
{