summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-28 00:46:04 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-28 01:34:15 -0300
commit413f1b37bdee7219299c0c87493e4503703605e2 (patch)
treecf6a40e767e35cc25fa613aadefd102b9c26a35d /gui
parent84150d6e16b9ca9892edacafaedbf8dfc4e84002 (diff)
downloadeeshow-413f1b37bdee7219299c0c87493e4503703605e2.tar.gz
eeshow-413f1b37bdee7219299c0c87493e4503703605e2.tar.bz2
eeshow-413f1b37bdee7219299c0c87493e4503703605e2.zip
file/git-hist.c, gui/: support multiple heads; update GUI accordingly
While we try to iterate HEAD first, this won't result in HEAD coming out on top if there is another branch that is ahead of HEAD. While we could try some heuristics to avoid this, it'll be better to just sort the whole list first by (partial) git history order and then by date. That way, the result will never be too far from what a human user will expect to see.
Diffstat (limited to 'gui')
-rw-r--r--gui/gui.c6
-rw-r--r--gui/sheet.c2
2 files changed, 3 insertions, 5 deletions
diff --git a/gui/gui.c b/gui/gui.c
index 9c43ddf..d986f20 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -392,8 +392,7 @@ static void get_revisions(struct gui *gui, const struct file_names *fn,
};
if (gui->vcs_history)
- hist_iterate(gui->vcs_history, vcs_head(gui->vcs_history),
- add_hist, &add_hist_ctx);
+ hist_iterate(gui->vcs_history, add_hist, &add_hist_ctx);
else
add_hist(&add_hist_ctx, NULL);
}
@@ -421,8 +420,7 @@ static void get_history(struct gui *gui, const char *sch_name, int limit)
if (limit)
gui->hist_size = limit > 0 ? limit : -limit;
else
- hist_iterate(gui->vcs_history, vcs_head(gui->vcs_history),
- count_history, gui);
+ hist_iterate(gui->vcs_history, count_history, gui);
}
diff --git a/gui/sheet.c b/gui/sheet.c
index b1cb67c..2c2624f 100644
--- a/gui/sheet.c
+++ b/gui/sheet.c
@@ -364,7 +364,7 @@ void go_to_sheet(struct gui *gui, struct gui_sheet *sheet)
gui->curr_sheet = sheet;
if (gui->old_hist)
render_delta(gui);
- if (gui->vcs_history && vcs_head(gui->vcs_history))
+ if (gui->vcs_history && !vcs_is_empty(gui->vcs_history))
do_revision_overlays(gui);
do_sheet_overlays(gui);
zoom_to_extents(gui);