summaryrefslogtreecommitdiff
path: root/devel/gitg/files
diff options
context:
space:
mode:
authorKoop Mast <kwm@FreeBSD.org>2019-07-06 08:05:03 +0000
committerKoop Mast <kwm@FreeBSD.org>2019-07-06 08:05:03 +0000
commit1e0d15a3802d0e71fcda7ac172480c2fc8b23192 (patch)
treecb014a8f671feded63269330eab9de54c6f3964a /devel/gitg/files
parentUpdate libgit2-glib to 0.28.0.1. (diff)
Update gitg to 3.32.0.
* Add patches to fix segfaults at start when no repository is selected. Obtained from: gitg upstream git [1]
Diffstat (limited to 'devel/gitg/files')
-rw-r--r--devel/gitg/files/patch-libgitg_gitg-diff-view-commit-details.vala117
-rw-r--r--devel/gitg/files/patch-libgitg_gitg-diff-view.vala75
-rw-r--r--devel/gitg/files/patch-libgitg_gitg-repository-list-box.vala9
3 files changed, 197 insertions, 4 deletions
diff --git a/devel/gitg/files/patch-libgitg_gitg-diff-view-commit-details.vala b/devel/gitg/files/patch-libgitg_gitg-diff-view-commit-details.vala
new file mode 100644
index 000000000000..1b8e84d1b8bb
--- /dev/null
+++ b/devel/gitg/files/patch-libgitg_gitg-diff-view-commit-details.vala
@@ -0,0 +1,117 @@
+https://gitlab.gnome.org/GNOME/gitg/issues/213
+https://gitlab.gnome.org/GNOME/gitg/merge_requests/83
+
+--- libgitg/gitg-diff-view-commit-details.vala.orig 2019-05-23 11:02:37 UTC
++++ libgitg/gitg-diff-view-commit-details.vala
+@@ -281,65 +281,69 @@ class Gitg.DiffViewCommitDetails : Gtk.Grid
+
+ private string parse_ini_file(string subject_text)
+ {
+- string result = subject_text.dup();
+- GLib.KeyFile file = new GLib.KeyFile();
+-
+- try
++ string result = subject_text;
++ if (config_file!=null)
+ {
+- debug ("parsing %s", config_file);
+- if (file.load_from_file(config_file , GLib.KeyFileFlags.NONE))
++ try
+ {
+- foreach (string group in file.get_groups())
++ debug ("parsing %s", config_file);
++ GLib.KeyFile file = new GLib.KeyFile();
++ if (file.load_from_file(config_file , GLib.KeyFileFlags.NONE))
+ {
+- if (group.has_prefix("gitg.custom-link"))
++ result = subject_text.dup();
++ foreach (string group in file.get_groups())
+ {
+- string custom_link_regexp = file.get_string (group, "regexp");
+- string custom_link_replacement = file.get_string (group, "replacement");
+- debug ("found group: %s", custom_link_regexp);
+- bool custom_color = file.has_key (group, "color");
+- string color = null;
+- if (custom_color)
++ if (group.has_prefix("gitg.custom-link"))
+ {
+- string custom_link_color = file.get_string (group, "color");
+- color = custom_link_color;
+- }
++ string custom_link_regexp = file.get_string (group, "regexp");
++ string custom_link_replacement = file.get_string (group, "replacement");
++ debug ("found group: %s", custom_link_regexp);
++ bool custom_color = file.has_key (group, "color");
++ string color = null;
++ if (custom_color)
++ {
++ string custom_link_color = file.get_string (group, "color");
++ color = custom_link_color;
++ }
+
+- var custom_regex = new Regex (custom_link_regexp);
+- try
+- {
+- GLib.MatchInfo matchInfo;
++ var custom_regex = new Regex (custom_link_regexp);
++ try
++ {
++ GLib.MatchInfo matchInfo;
+
+- custom_regex.match (subject_text, 0, out matchInfo);
++ custom_regex.match (subject_text, 0, out matchInfo);
+
+- while (matchInfo.matches ())
+- {
+- string text = matchInfo.fetch(0);
+- string link = text.dup();
+- debug ("found: %s", link);
+- if (custom_link_replacement != null)
++ while (matchInfo.matches ())
+ {
+- link = custom_regex.replace(link, text.length, 0, custom_link_replacement);
+- }
+- if (color != null) {
+- result = result.replace(text, "<a href=\"%s\" title=\"%s\" style=\"color:%s\">%s</a>".printf(link, link, color, text));
+- } else {
+- result = result.replace(text, "<a href=\"%s\" title=\"%s\">%s</a>".printf(link, link, text));
+- }
++ string text = matchInfo.fetch(0);
++ string link = text.dup();
++ debug ("found: %s", link);
++ if (custom_link_replacement != null)
++ {
++ link = custom_regex.replace(link, text.length, 0, custom_link_replacement);
++ }
++ if (color != null) {
++ result = result.replace(text, "<a href=\"%s\" title=\"%s\" style=\"color:%s\">%s</a>".printf(link, link, color, text));
++ } else {
++ result = result.replace(text, "<a href=\"%s\" title=\"%s\">%s</a>".printf(link, link, text));
++ }
+
+- matchInfo.next();
++ matchInfo.next();
++ }
+ }
++ catch(Error e)
++ {
++ }
+ }
+- catch(Error e)
+- {
+- }
+ }
+ }
++ } catch (Error e)
++ {
++ warning ("Cannot read %s %s", config_file, e.message);
+ }
+- } catch (Error e)
+- {
+- warning ("Cannot read %s %s", config_file, e.message);
+ }
+ return result;
++
+ }
+
+ private void update_avatar()
diff --git a/devel/gitg/files/patch-libgitg_gitg-diff-view.vala b/devel/gitg/files/patch-libgitg_gitg-diff-view.vala
new file mode 100644
index 000000000000..9d31308a3fe8
--- /dev/null
+++ b/devel/gitg/files/patch-libgitg_gitg-diff-view.vala
@@ -0,0 +1,75 @@
+https://gitlab.gnome.org/GNOME/gitg/issues/213
+https://gitlab.gnome.org/GNOME/gitg/merge_requests/83
+
+--- libgitg/gitg-diff-view.vala.orig 2019-05-23 11:02:37 UTC
++++ libgitg/gitg-diff-view.vala
+@@ -131,8 +131,11 @@ public class Gitg.DiffView : Gtk.Grid
+ get { return d_repository; }
+ set {
+ d_repository = value;
+- config_file = "%s/.git/config".printf(d_repository.get_workdir().get_path());
+- d_commit_details.config_file = config_file;
++ if (d_repository!=null)
++ {
++ config_file = "%s/.git/config".printf(d_repository.get_workdir().get_path());
++ d_commit_details.config_file = config_file;
++ }
+ }
+ }
+ public bool new_is_workdir { get; set; }
+@@ -593,34 +596,37 @@ public class Gitg.DiffView : Gtk.Grid
+
+ private void read_ini_file(Gtk.TextBuffer buffer)
+ {
+- GLib.KeyFile file = new GLib.KeyFile();
+-
+- try
++ if (config_file != null)
+ {
+- if (file.load_from_file(config_file , GLib.KeyFileFlags.NONE))
++ try
+ {
+- foreach (string group in file.get_groups())
++ GLib.KeyFile file = new GLib.KeyFile();
++ if (file.load_from_file(config_file , GLib.KeyFileFlags.NONE))
+ {
+- if (group.has_prefix("gitg.custom-link"))
++ foreach (string group in file.get_groups())
+ {
+- string custom_link_regexp = file.get_string (group, "regexp");
+- string custom_link_replacement = file.get_string (group, "replacement");
+- bool custom_color = file.has_key (group, "color");
+- Gdk.RGBA color = d_color_link;
+- if (custom_color)
++ if (group.has_prefix("gitg.custom-link"))
+ {
+- string custom_link_color = file.get_string (group, "color");
+- color = Gdk.RGBA();
+- color.parse(custom_link_color);
++ string custom_link_regexp = file.get_string (group, "regexp");
++ string custom_link_replacement = file.get_string (group, "replacement");
++ bool custom_color = file.has_key (group, "color");
++ Gdk.RGBA color = d_color_link;
++ if (custom_color)
++ {
++ string custom_link_color = file.get_string (group, "color");
++ color = Gdk.RGBA();
++ color.parse(custom_link_color);
++ }
++ apply_link_tags(buffer, new Regex (custom_link_regexp), custom_link_replacement, color, custom_color, true);
+ }
+- apply_link_tags(buffer, new Regex (custom_link_regexp), custom_link_replacement, color, custom_color, true);
+ }
+ }
++ } catch (Error e)
++ {
++ warning ("Cannot read %s: %s", config_file, e.message);
+ }
+- } catch (Error e)
+- {
+- warning ("Cannot read %s: %s", config_file, e.message);
+ }
++
+ }
+
+ private void auto_change_expanded(bool expanded)
diff --git a/devel/gitg/files/patch-libgitg_gitg-repository-list-box.vala b/devel/gitg/files/patch-libgitg_gitg-repository-list-box.vala
index 40ecbbe18922..ac08636bcf31 100644
--- a/devel/gitg/files/patch-libgitg_gitg-repository-list-box.vala
+++ b/devel/gitg/files/patch-libgitg_gitg-repository-list-box.vala
@@ -1,7 +1,8 @@
-# gitg crash on exit if built with -fstack-protector-all
-# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234607
-# https://gitlab.gnome.org/GNOME/gitg/issues/171
---- libgitg/gitg-repository-list-box.vala
+https://gitlab.gnome.org/GNOME/gitg/issues/213
+https://gitlab.gnome.org/GNOME/gitg/merge_requests/83
+
+
+--- libgitg/gitg-repository-list-box.vala.orig 2019-05-23 11:02:37 UTC
+++ libgitg/gitg-repository-list-box.vala
@@ -407,9 +407,12 @@ namespace Gitg
return ((Row)b).time.compare(((Row)a).time);