Code

patches: Added bts757692-topo-order. jessie tig-2.0.2-2
authorSebastian Harl <sh@tokkee.org>
Sat, 22 Nov 2014 12:03:47 +0000 (13:03 +0100)
committerSebastian Harl <sh@tokkee.org>
Sat, 22 Nov 2014 12:04:35 +0000 (13:04 +0100)
Upstream patch fixing a display regression.
Thanks to Simon Paillard for reporting this and Jonas Fonseca for a quick
handling of the bug.
Closes: #757692
debian/changelog
debian/patches/bts757692-topo-order [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]

index 69027dcd794da648e85b00cdc0fee4fa996710c0..e73d766a8f4752836d4cd6354ccb2af72d5346ff 100644 (file)
@@ -1,3 +1,12 @@
+tig (2.0.2-2) unstable; urgency=medium
+
+  * debian/patches:
+    - Added bts757692-topo-order: upstream patch fixing a display regression;
+      thanks to Simon Paillard for reporting this and Jonas Fonseca for a
+      quick handling of the bug (Closes: #757692).
+
+ -- Sebastian Harl <tokkee@debian.org>  Sat, 22 Nov 2014 12:56:28 +0100
+
 tig (2.0.2-1) unstable; urgency=medium
 
   [ Sebastian Harl ]
diff --git a/debian/patches/bts757692-topo-order b/debian/patches/bts757692-topo-order
new file mode 100644 (file)
index 0000000..53b86e0
--- /dev/null
@@ -0,0 +1,104 @@
+Description: Force --topo-order when graph is enabled and no commit order is set
+ This is what `git log --graph` does to ensure that parent commits comes
+ before child commits.
+Author: Jonas Fonseca <jonas.fonseca@gmail.com>
+Origin: upstream
+Bug: https://github.com/jonas/tig/issues/238
+Applied-Upstream: https://github.com/jonas/tig/commit/adb362b
+--- a/doc/tigrc.5.adoc
++++ b/doc/tigrc.5.adoc
+@@ -234,6 +234,8 @@
+       Commit ordering using the default (chronological reverse) order,
+       topological order, date order or reverse order. The default order is
+       used when the option is set to false, and topo order when set to true.
++      Note that topological order is automatically used in the main view when
++      the commit graph is enabled and the commit order is set to the default.
+ 'ignore-case' (bool)::
+--- a/include/tig/options.h
++++ b/include/tig/options.h
+@@ -167,6 +167,7 @@
+ const char *ignore_space_arg();
+ const char *commit_order_arg();
++const char *commit_order_arg_with_graph(bool with_graph);
+ const char *diff_context_arg();
+ const char *show_notes_arg();
+--- a/src/main.c
++++ b/src/main.c
+@@ -181,33 +181,43 @@
+       return with_reflog;
+ }
++main_with_graph(struct view *view, enum open_flags flags)
++{
++      struct view_column *column = get_view_column(view, VIEW_COLUMN_COMMIT_TITLE);
++
++      if (open_in_pager_mode(flags))
++              return FALSE;
++
++      return column && column->opt.commit_title.graph &&
++             opt_commit_order != COMMIT_ORDER_REVERSE;
++}
++
+ static bool
+ main_open(struct view *view, enum open_flags flags)
+ {
++      bool with_graph = main_with_graph(view, flags);
+       const char *pretty_custom_argv[] = {
+-              GIT_MAIN_LOG_CUSTOM(encoding_arg, commit_order_arg(), "%(cmdlineargs)", "%(revargs)", "%(fileargs)")
++              GIT_MAIN_LOG_CUSTOM(encoding_arg, commit_order_arg_with_graph(with_graph),
++                      "%(cmdlineargs)", "%(revargs)", "%(fileargs)")
+       };
+       const char *pretty_raw_argv[] = {
+-              GIT_MAIN_LOG_RAW(encoding_arg, commit_order_arg(), "%(cmdlineargs)", "%(revargs)", "%(fileargs)")
++              GIT_MAIN_LOG_RAW(encoding_arg, commit_order_arg_with_graph(with_graph),
++                      "%(cmdlineargs)", "%(revargs)", "%(fileargs)")
+       };
+       struct main_state *state = view->private;
+       const char **main_argv = pretty_custom_argv;
+-      struct view_column *column;
+       enum watch_trigger changes_triggers = WATCH_NONE;
+       if (opt_show_changes && repo.is_inside_work_tree)
+               changes_triggers |= WATCH_INDEX;
+-      column = get_view_column(view, VIEW_COLUMN_COMMIT_TITLE);
+-      state->with_graph = column && column->opt.commit_title.graph &&
+-                          opt_commit_order != COMMIT_ORDER_REVERSE;
++      state->with_graph = with_graph;
+       if (opt_rev_argv && main_check_argv(view, opt_rev_argv))
+               main_argv = pretty_raw_argv;
+       if (open_in_pager_mode(flags)) {
+               changes_triggers = WATCH_NONE;
+-              state->with_graph = FALSE;
+       }
+       /* This calls reset_view() so must be before adding changes commits. */
+--- a/src/options.c
++++ b/src/options.c
+@@ -128,6 +128,20 @@
+       return commit_order_arg_map[opt_commit_order].name;
+ }
++const char *
++commit_order_arg_with_graph(bool with_graph)
++{
++      enum commit_order commit_order = opt_commit_order;
++
++      if (with_graph &&
++          commit_order != COMMIT_ORDER_TOPO &&
++          commit_order != COMMIT_ORDER_DATE &&
++          commit_order != COMMIT_ORDER_AUTHOR_DATE)
++              commit_order = COMMIT_ORDER_TOPO;
++
++      return commit_order_arg_map[commit_order].name;
++}
++
+ /* Use --show-notes to support Git >= 1.7.6 */
+ #define NOTES_ARG     "--show-notes"
+ #define NOTES_EQ_ARG  NOTES_ARG "="
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..47fd381
--- /dev/null
@@ -0,0 +1 @@
+bts757692-topo-order