summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e177b41)
raw | patch | inline | side by side (parent: e177b41)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 27 Nov 2009 12:41:38 +0000 (07:41 -0500) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 27 Nov 2009 12:41:38 +0000 (07:41 -0500) |
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index 7efc4028efb5dd3d3ae2df3819c647985672928f..23445504a2b8a48a21cc2c8e15c01a932fb81550 100644 (file)
--- a/NEWS
+++ b/NEWS
Improvements:
- - Status view: update the file variable when a line is selected so %(file) works as
- expected.
+ - Status view: update the file variable when a line is selected so
+ %(file) works as expected.
+ - Branch view: add entry to browse all branches (uses git-log's --all
+ flag).
tig-0.15
--------
index e2ae80dfb703e3f55057cf5719d58e8ae100a32b..86c82db53ed679a284c8b385cd566f963036cea5 100644 (file)
--- a/tig.c
+++ b/tig.c
const struct ref *ref; /* Name and commit ID information. */
};
+static const struct ref branch_all;
+
static const enum sort_field branch_sort_fields[] = {
ORDERBY_NAME, ORDERBY_DATE, ORDERBY_AUTHOR
};
if (opt_author && draw_author(view, branch->author))
return TRUE;
- draw_text(view, type, branch->ref->name, TRUE);
+ draw_text(view, type, branch->ref == &branch_all ? "All branches" : branch->ref->name, TRUE);
return TRUE;
}
static enum request
branch_request(struct view *view, enum request request, struct line *line)
{
+ struct branch *branch = line->data;
+
switch (request) {
case REQ_REFRESH:
load_refs();
return REQ_NONE;
case REQ_ENTER:
- open_view(view, REQ_VIEW_MAIN, OPEN_SPLIT);
+ if (branch->ref == &branch_all) {
+ const char *all_branches_argv[] = {
+ "git", "log", "--no-color", "--pretty=raw", "--parents",
+ "--topo-order", "--all", NULL
+ };
+ struct view *main_view = VIEW(REQ_VIEW_MAIN);
+
+ if (!prepare_update(main_view, all_branches_argv, NULL, FORMAT_NONE)) {
+ report("Failed to load view of all branches");
+ return REQ_NONE;
+ }
+ open_view(view, REQ_VIEW_MAIN, OPEN_PREPARED | OPEN_SPLIT);
+ } else {
+ open_view(view, REQ_VIEW_MAIN, OPEN_SPLIT);
+ }
return REQ_NONE;
default:
}
setup_update(view, view->id);
+ branch_open_visitor(view, &branch_all);
foreach_ref(branch_open_visitor, view);
view->p_restore = TRUE;