Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New plugin] Git Change Bar #189

Merged
merged 24 commits into from
Feb 18, 2015
Merged

[New plugin] Git Change Bar #189

merged 24 commits into from
Feb 18, 2015

Conversation

b4n
Copy link
Member

@b4n b4n commented Feb 16, 2015

New plugin highlighting uncommitted changes to files tracked with Git. It is very similar in features to GEdit's Git plugin.

Features:

  • Highlighting of added/changed/removed lines in the sidebar;
  • Hovering the sidebar on a changed or removed group of lines shows a popup with the old version;
  • Monitoring of the Git repository to keep in sync upon commit/checkout -b (optional).

Closes #187.

pv
Yes, I'm showing off with a pretty picture.

b4n added 20 commits September 30, 2014 23:18
This allows to automatically update the diff bar when e.g. changes are
committed.
If the file encoding is different than the buffer encoding (as Geany
will always have the buffer in UTF-8 but for encoding None) we need to
convert it to get proper binary representation and then proper diff.
Apparently what was introduced as a defensive check catches an actual
legitimate case, so transform it to a normal check.
This fixes ref monitoring after switching branches.  While in most
cases it doesn't matter because either the file has not changed or it
has to be reloaded from disk anyway, it happens when the user uses
`checkout -b`, as this will change the ref HEAD points to without
touching the tree or index.
While monitoring provides best user experience by keeping the diff in
sync with the actual repository status throughout commits and branch
switch, some people want to avoid this kind of implicit behavior, so
add a setting to allow disabling it.
While the initial goal of this plugin was bigger, only the changebar
feature is currently ready, and useful enough to be released on its
own.
@frlan
Copy link
Member

frlan commented Feb 16, 2015

Can you please add an entry to MAINTAINERS? :)

@b4n
Copy link
Member Author

b4n commented Feb 16, 2015

Can you please add an entry to MAINTAINERS? :)

Damn, I thought about it earlier today and then forgot :/ Fixed, thanks :)

@lycianwolf
Copy link

Hi, I've got some Problems when I run make:
[...]
gcb-plugin.c:553:15: error: unknown type name 'git_diff_hunk'
const git_diff_hunk *hunk,
^
[...]

I've got libgit2-dev Version 0.19.0-2 on Xubuntu 13.10

@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

Hi, I've got some Problems when I run make:
[…]
I've got libgit2-dev Version 0.19.0-2 on Xubuntu 13.10

Damn. Apparently libgit2 changes API quite often, and don't document these very well (I have 0.21.3 here FTR). Anyway, this one should be easy to fix, could you try this patch please?

diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c
index 38e7bae..1dbce0e 100644
--- a/git-changebar/src/gcb-plugin.c
+++ b/git-changebar/src/gcb-plugin.c
@@ -36,6 +36,9 @@
 # define git_libgit2_init     git_threads_init
 # define git_libgit2_shutdown git_threads_shutdown
 #endif
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 20
+# define git_diff_hunk git_diff_range
+#endif


 GeanyPlugin      *geany_plugin;

If it's all it takes I'll commit it, otherwise I'd like to see the additional issues and fix them at the same time. I'll try to build myself against 0.18 or 0.19 but it might not be immediate cause I'd have to set the environment up, so don't hesitate to tell me how it's going :)

[edit]: typo in the patch, s/MINOR/MAJOR/

@lycianwolf
Copy link

It runs through now. But there were some warnings/notes:

  CC       git_changebar_la-gcb-plugin.lo
gcb-plugin.c: In function 'on_sci_query_tooltip':
gcb-plugin.c:703:7: warning: passing argument 3 of 'diff_blob_to_doc' from incompatible pointer type [enabled by default]
       diff_blob_to_doc (G_file_blob, doc, tooltip_diff_hunk_cb, &thd);
       ^
gcb-plugin.c:519:1: note: expected 'git_diff_hunk_cb' but argument is of type 'int (*)(const struct git_diff_delta *, const struct git_diff_range *, void *)'
 diff_blob_to_doc (const git_blob   *old_blob,
 ^
gcb-plugin.c: In function 'update_diff':
gcb-plugin.c:728:5: warning: passing argument 3 of 'diff_blob_to_doc' from incompatible pointer type [enabled by default]
     diff_blob_to_doc (blob, doc, diff_hunk_cb, sci);
     ^
gcb-plugin.c:519:1: note: expected 'git_diff_hunk_cb' but argument is of type 'int (*)(const struct git_diff_delta *, const struct git_diff_range *, void *)'
 diff_blob_to_doc (const git_blob   *old_blob,
 ^

Also Geany crashed after I opened a file in one of my git repos.

edt:

Backtrace:

#0  scintilla_send_message (sci=<optimized out>, iMessage=2043, wParam=24, lParam=2) at gtk/ScintillaGTK.cxx:3106
        psci = 0xfffffffffffffff8
#1  0x00007fffec398b72 in diff_hunk_cb (delta=<optimized out>, hunk=0x7fffffffd9b0, data=0x7fffffffd650) at gcb-plugin.c:566
        line = 25
        marker = <optimized out>
        sci = 0x7fffffffd650
#2  0x00007fffec13ac4e in ?? () from /usr/lib/x86_64-linux-gnu/libgit2.so.0
No symbol table info available.
#3  0x00007fffec173e99 in ?? () from /usr/lib/x86_64-linux-gnu/libgit2.so.0
No symbol table info available.
#4  0x00007fffec170c3b in ?? () from /usr/lib/x86_64-linux-gnu/libgit2.so.0
No symbol table info available.
#5  0x00007fffec17207d in ?? () from /usr/lib/x86_64-linux-gnu/libgit2.so.0
No symbol table info available.
#6  0x00007fffec13ad3f in ?? () from /usr/lib/x86_64-linux-gnu/libgit2.so.0
No symbol table info available.
#7  0x00007fffec13165c in ?? () from /usr/lib/x86_64-linux-gnu/libgit2.so.0
No symbol table info available.
#8  0x00007fffec13196b in ?? () from /usr/lib/x86_64-linux-gnu/libgit2.so.0
No symbol table info available.
#9  0x00007fffec132634 in git_diff_blob_to_buffer () from /usr/lib/x86_64-linux-gnu/libgit2.so.0
No symbol table info available.
#10 0x00007fffec39978e in diff_blob_to_doc (old_blob=0x7fffcc0113c0, hunk_cb=hunk_cb@entry=0x7fffec398b00 <diff_hunk_cb>, payload=0xeee680, doc=<optimized out>, doc=<optimized out>) at gcb-plugin.c:544
        sci = <optimized out>
        opts = {version = 1, flags = 2, context_lines = 0, interhunk_lines = 0, old_prefix = 0x0, new_prefix = 0x0, pathspec = {strings = 0x0, count = 0}, max_size = 0, notify_cb = 0x0, notify_payload = 0x0}
        buf = 0xdc5950 "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n#\r\n#  main.py\r\n#  \r\n#  Copyright 2013\r\n#  \r\n#  This program is free software; you can redistribute it and/or modify\r\n#  it "...
        len = 6949
        free_buf = 0
        ret = <optimized out>
#11 0x00007fffec399913 in update_diff (path=path@entry=0xeb2210 "/home/*/*/bh.py", blob=<optimized out>, data=data@entry=0x2) at gcb-plugin.c:728
        sci = <optimized out>
        doc = <optimized out>
#12 0x00007fffec399b0a in get_cached_blob_async (callback=0x7fffec399830 <update_diff>, user_data=0x2, force=0, path=0xeb2210 "/home/*/*/bh.py") at gcb-plugin.c:356
No locals.
#13 do_update_diff_idle (doc_id=2, force=0) at gcb-plugin.c:741
        doc = <optimized out>
#14 0x00007ffff60f9f13 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#15 0x00007ffff60f93b6 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#16 0x00007ffff60f9708 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#17 0x00007ffff60f9b0a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#18 0x00007ffff78c9277 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
No symbol table info available.
#19 0x0000000000452486 in main (argc=1, argv=0x7fffffffe0e8) at main.c:1236
        doc = 0xdc3e30
        locale = 0xdc3e30 "\001"

@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

Boy. They also changed the signature for git_diff_hunk_cb. This one will be more painful to fix, and starts to get me wondering if it is so clever to support older versions…
Anyway, I'll try to see how I could fix this.

@frlan
Copy link
Member

frlan commented Feb 17, 2015

Debian stable is lagging libgit2 from what I have seen. Jessie will have 0.21. Also most common current distribution are having 0.21 aboard, maybe support 0.20+ is quiet ok.

@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

OK, give this a try:

diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c
index 38e7bae..0cb20a2 100644
--- a/git-changebar/src/gcb-plugin.c
+++ b/git-changebar/src/gcb-plugin.c
@@ -36,6 +36,9 @@
 # define git_libgit2_init     git_threads_init
 # define git_libgit2_shutdown git_threads_shutdown
 #endif
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 20
+# define git_diff_hunk git_diff_range
+#endif


 GeanyPlugin      *geany_plugin;
@@ -569,6 +572,18 @@ diff_hunk_cb (const git_diff_delta *delta,

   return 0;
 }
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 20
+static int
+diff_hunk_cb_wrapper (const git_diff_delta *delta,
+                      const git_diff_hunk  *hunk,
+                      const char           *header,
+                      size_t                header_len,
+                      void                 *data)
+{
+  return diff_hunk_cb (delta, hunk, data);
+}
+# define diff_hunk_cb diff_hunk_cb_wrapper
+#endif

 static GtkWidget *
 get_widget_for_blob_range (GeanyDocument   *doc,
@@ -663,6 +678,18 @@ tooltip_diff_hunk_cb (const git_diff_delta *delta,

   return thd->found;
 }
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 20
+static int
+tooltip_diff_hunk_cb_wrapper (const git_diff_delta *delta,
+                              const git_diff_hunk  *hunk,
+                              const char           *header,
+                              size_t                header_len,
+                              void                 *data)
+{
+  return tooltip_diff_hunk_cb (delta, hunk, data);
+}
+# define tooltip_diff_hunk_cb tooltip_diff_hunk_cb_wrapper
+#endif

 static gboolean
 on_sci_query_tooltip (GtkWidget  *widget,

@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

Debian stable is lagging libgit2 from what I have seen. Jessie will have 0.21. Also most common current distribution are having 0.21 aboard, maybe support 0.20+ is quiet ok.

I might consider it then, because it seems to get real painful to support 0.19.

@lycianwolf
Copy link

Good News, works now^^ Nice job.

@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

@lycianwolf no more warnings either?

@lycianwolf
Copy link

No. Not one.

libgit2 < 0.20 had incompatible API for diff callbacks, so it requires
some wrapping.
@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

Great. Here you go, I added 332639f
Thanks for testing and reporting!

@lycianwolf
Copy link

Oh. Found another Problem. When I mousover a strip it just shows the first characters of my script
or the first lines,
No matter which one I take.

I my case for example:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#

bug_git

bug_git2

@frlan
Copy link
Member

frlan commented Feb 17, 2015

I can reproduce @lycianwolf mouse over issue

@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

Hum. Which ligit2 version @frlan?
I'll try and reproduce it, but for now I have no clue, unless the meaning of the content of the structures returned by libgit2 changed overtime :/

@frlan
Copy link
Member

frlan commented Feb 17, 2015

It's 0.21.3 from Jessie.

@aeberspaecher
Copy link

Everything is fine with libgit2 0.19.0 in Xubuntu 14.04.

@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

It's 0.21.3 from Jessie.

Jessie has 0.21.1, 0.21.3 is only in unstable :)

This said, I tried on Debian unstable (libgit2 0.21.3), with and without a composite window manager, and both on GTK2 and GTK3, and all was fine.
I also tried under Xubuntu 14.04 in a VM (libgit2 0.19.0, composite WM, GTK2) and all was fine too.

I'm sorry, but I have no idea why you don't get the correct tooltip… could you maybe add a debug message at the start of get_widget_for_blob_range() to see on which line it is actually called?

  g_debug ("%s(%p, %p, %d, %d)", G_STRFUNC, (gpointer) doc, (gpointer) blob,
                                 line_start, n_lines);

Actually the only thing I can imagine that would explain what I see in your capture would be if the scintilla_send_message(sci, SCI_SETFIRSTVISIBLELINE, line_start, 0) call didn't work or didn't happen. And I can't see any reason why not, especially why it'd work for me and not for you.

Just as a matter of curiosity as I doubt it has anything to do with it, which Geany revision do you have? This plugins requires revision geany/geany@0a58f50 or newer for the tooltip to work properly with GTK2, but it's pretty old now (Dec 2, 2014) so I would imagine you have it.


@aeberspaecher thanks! I was starting to feel like I was crazy or something, now I know at least I'm not the only one for which it does work :p

@frlan
Copy link
Member

frlan commented Feb 17, 2015

According to version of libgit you seems to be right. I really have some unstable inside my sources and no pinning for libgit. However, I've added the debug message and I'm getting

(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 612, 1)
(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 612, 1)
(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 612, 1)
(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 612, 1)
(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 612, 1)
(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 612, 1)
(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 619, 1)
(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 619, 1)
(geany:1995): GitChangeBar-DEBUG: get_widget_for_blob_range(0x126e860, 0x7fd924006a50, 619, 1)

Also for gcb-plugin.c I don't get an output at all inside that overlay. I hope screenshot shows it. Mouse is at line 604
geany_git-changebar

running Gtk2 with Xfce. Geany is current master.

b4n added 2 commits February 17, 2015 23:38
Enable extra scrolling after the file's end so that even the last line
can be displayed on top of the view at any size.
@b4n
Copy link
Member Author

b4n commented Feb 17, 2015

Okay guys! It was a bug with tooltips near the end of the original (as committed) file. Fixed in 913cf5d Thanks a lot @lycianwolf and @frlan for discovering this and for the help on IRC to narrow it down!

Also as a bonus, now the zoom level of the editor is respected in the tooltip -- thanks to @frlan's capture that made me realize I didn't respect it before :)

@lycianwolf
Copy link

Now it really works^^ Thanks @b4n

frlan added a commit that referenced this pull request Feb 18, 2015
[New plugin] Git Change Bar
@frlan frlan merged commit 669f097 into geany:master Feb 18, 2015
@techee
Copy link
Member

techee commented Feb 19, 2015

Suggested (minor) feature: it would be really nice to have keybindings for going to the next/previous hunk in the file.

Suggested (bigger) feature: not sure if it's not out of scope of the plugin but it would be also nice to see all the modified files (e.g. in a new sidebar tab). Clicking the file in the sidebar would jump to the first change hunk in the file and together with the above-mentioned keybindings, one could easily review all the changes for the commit.

Finally one really minor visual problem - when you press and hold enter, the change gets drawn only after you release it. I haven't checked the code but it might be just an issue of setting higher priority for some idle function (and if not, don't worry, it really doesn't matter).

And thanks, thanks, thanks @b4n !!! I kept a hacky port of changebar from CodeBlocks which was part of scintilla itself and finally dropped it because there were too many changes in scintilla and it was getting hard to maintain. Proper changebar implementation was on my todo list and having it diffed against git is even better!

@frlan
Copy link
Member

frlan commented Feb 19, 2015

Am 19.02.2015 um 11:51 schrieb Jiří Techet:

Suggested (bigger) feature: not sure if it's not out of scope of the
plugin but it would be also nice to see all the modified files (e.g. in
a new sidebar tab). Clicking the file in the sidebar would jump to the
first change hunk in the file and together with the above-mentioned
keybindings, one could easily review all the changes for the commit.

IIRC is this partly avaialble via gitbrowser[1]

[1] https://github.com/unwind/gitbrowser

@techee
Copy link
Member

techee commented Feb 19, 2015

Ah, good, I'll try it (and this functionality probably really doesn't belong to git-changebar because it doesn't know anything about project and which opened files belong to which project).

Is there any list of out-of-geany-plugins plugins?

@codebrainz
Copy link
Member

@techee, not that I know of, but you can find the best C/C++ code auto-formatter available here: http://codebrainz.github.io/code-format/ :)

@b4n
Copy link
Member Author

b4n commented Feb 20, 2015

Suggested (minor) feature: it would be really nice to have keybindings for going to the next/previous hunk in the file.

Sounds interesting, I'll look into that :)

Suggested (bigger) feature: not sure if it's not out of scope of the plugin but it would be also nice to see all the modified files (e.g. in a new sidebar tab). Clicking the file in the sidebar would jump to the first change hunk in the file and together with the above-mentioned keybindings, one could easily review all the changes for the commit.

Well, at first I wanted to make a mostly full-featured Git plugin, with log history browsing [1], branch management [1], file list, blame display in the the sidebar [2], commit management, staging/unstaging of chunks by clicking on the changebar and whatnot, but I postponed that for several reason -- the most important one being that doing that isn't so trivial so takes some time :)

[1] I started a plugin (https://github.com/b4n/geany-git-ui) some time ago that implemented some of those, but while it has some nice features it's not yet really useful or ready enough for me to really release it (not to mention I have plenty uncommitted changes I let around and I now am scared of committing because I don't see what is what so well anymore :-'). However, feel free to try it out and use it and improve it and guilt me up into working on it and whatnot if you feel like it ;)

BTW, when I started this plugin, I didn't know about libgit2 (I'm not even sure it existed at the time), and so I wrote some kind of custom GObject git library, which interacts with the Git command-line tool. While it has some advantages (like everything Git can do (non-interactively) can be done with limited efforts), it's obviously not very optimal.

[2] This one I wanted to include in git-changebar, but I couldn't seem to get anything sensible out of libgit2 for modified buffers. I didn't spend days on it either, but it really felt like a libgit2 bug, so I let it go. This bump, and the fact that it'd be only seldom useful for me (it'd be at time, but not in a day-to-day basis) didn't help ^^

Finally one really minor visual problem - when you press and hold enter, the change gets drawn only after you release it. I haven't checked the code but it might be just an issue of setting higher priority for some idle function (and if not, don't worry, it really doesn't matter).

This actually is a feature :D
To avoid any possible blocking during typing, and excessive computation time, I do a basic delaying: whenever a change is made, I delay the update for another 100ms. So yeah, if you keep typing rapidly (one change per 100ms) the changebar won't update.

I could lower the delay, or make it configurable if it's useful. Or maybe it could be removed altogether when I have a cached blob, I didn't test how long it takes to actually refresh the changebar alone.
I didn't see a problem myself with how it is now, because I don't generally type faster than the delay, or when I do I don't care much about the changebar, but if it's a problem I can look into it.

@techee
Copy link
Member

techee commented Feb 20, 2015

Suggested (minor) feature: it would be really nice to have keybindings for
going to the next/previous hunk in the file.

Sounds interesting, I'll look into that :)

Great, thanks!

Suggested (bigger) feature: not sure if it's not out of scope of the
plugin but it would be also nice to see all the modified files (e.g. in a
new sidebar tab). Clicking the file in the sidebar would jump to the first
change hunk in the file and together with the above-mentioned keybindings,
one could easily review all the changes for the commit.

Well, at first I wanted to make a mostly full-featured Git plugin, with
log history browsing [1], branch management [1], file list, blame display
in the the sidebar [2], commit management, staging/unstaging of chunks by
clicking on the changebar and whatnot, but I postponed that for several
reason -- the most important one being that doing that isn't so trivial so
takes some time :)

[1] I started a plugin (https://github.com/b4n/geany-git-ui) some time
ago that implemented some of those, but while it has some nice features
it's not yet really useful or ready enough for me to really release it (not
to mention I have plenty uncommitted changes I let around and I now am
scared of committing because I don't see what is what so well anymore :-').
However, feel free to try it out and use it and improve it and guilt me up
into working on it and whatnot if you feel like it ;)

BTW, when I started this plugin, I didn't know about libgit2 (I'm not even
sure it existed at the time), and so I wrote some kind of custom GObject
git library, which interacts with the Git command-line tool. While it has
some advantages (like everything Git can do (non-interactively) can be
done with limited efforts), it's obviously not very optimal.

[2] This one I wanted to include in git-changebar, but I couldn't seem to
get anything sensible out of libgit2 for modified buffers. I didn't spend
days on it either, but it really felt like a libgit2 bug, so I let it go.
This bump, and the fact that it'd be only seldom useful for me (it'd be at
time, but not in a day-to-day basis) didn't help ^^

Fully understood. I actually don't think there should be a full-blown git
client in Geany (gitk, git gui & cmdline work nice for me), it's a
duplicate of functionality of other applications, which unnecessary IMO.

Finally one really minor visual problem - when you press and hold enter,
the change gets drawn only after you release it. I haven't checked the code
but it might be just an issue of setting higher priority for some idle
function (and if not, don't worry, it really doesn't matter).

This actually is a feature :D

That's the answer I needed, now I'm happy with it :-).

Maybe one more idea - would it be possible to copy/paste text from the
tooltip with the old state? This would require that the tooltip stays
visible for some time until you place mouse on top of it and keep it open
while the mouse is there (I haven't checked how exactly the tooltip works -
I assume there's a mini-scintilla inside so it might be possible to copy
from there). Or maybe a simpler to implement variant - have the possibility
to undo the whole hunk or selected lines in the editor.

By the way, apart from a minor problem with libgit2 configuration on OS X

libgit2/libgit2#2918

everything works there and while I don't plan to bundle plugins with extra
dependencies, this one I just want so it will definitely be part of the
bundle.

And once again, thanks for Christmas in February :-).

@techee
Copy link
Member

techee commented Feb 20, 2015

@techee https://github.com/techee, not that I know of, but you can find
the best C/C++ code auto-formatter available here:
http://codebrainz.github.io/code-format/ :)

The "most advanced operating system" says you should put AM_PROG_AR to
configure.ac of "the best C/C++ code auto-formatter available" :-)

automake: warnings are treated as errors
/Users/jhbuild/gtk/inst/share/automake-1.14/am/ltlibrary.am: warning: '
codeformat.la': linking libtool libraries using a non-POSIX
/Users/jhbuild/gtk/inst/share/automake-1.14/am/ltlibrary.am: archiver
requires 'AM_PROG_AR' in 'configure.ac'
Makefile.am:10: while processing Libtool library 'codeformat.la'
Makefile.am: installing 'build-aux/depcomp'
autoreconf: automake failed with exit status: 1

Then it compiles fine (unfortunately OS X doesn't have clang-format
installed and I'm a little scared to install another copy of clang on my
system so I haven't really tried).

@b4n
Copy link
Member Author

b4n commented Mar 1, 2015

Maybe one more idea - would it be possible to copy/paste text from the tooltip with the old state? This would require that the tooltip stays visible for some time until you place mouse on top of it and keep it open while the mouse is there (I haven't checked how exactly the tooltip works - I assume there's a mini-scintilla inside so it might be possible to copy from there).

It might be hard to allow interaction with the tooltip, because it's almost fully managed by GTK itself -- I only provide the contents. (but yes, it's a Scintilla instance)
I however could add ability to copy the old value of course, e.g. by right-clicking on the hunk I guess.

Or maybe a simpler to implement variant - have the possibility to undo the whole hunk or selected lines in the editor.

Undoing a hunk like that look more useful to me indeed, and should be reasonably easy to implement. I'll also try to give this a shot :)

@techee
Copy link
Member

techee commented Mar 1, 2015

Or maybe a simpler to implement variant - have the possibility to undo
the whole hunk or selected lines in the editor.

Undoing a hunk like that look more useful to me indeed, and should be
reasonably easy to implement. I'll also try to give this a shot :)

This would be completely sufficient - I often run in the situation where I
change several things in a file and one of the changes isn't quite OK and
I'd like to revert it. Currently I do a long Ctrl+Z, copy the original
code, do a long Ctrl+Y and replace the code. This is quite an adrenalin
sport because I must be extremely careful that I don't press some key by
accident after Ctrl+Z, otherwise I wouldn't be able to do Ctrl+Y again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GeanyVCS: highlight new/modified/deleted lines like in GEdit
6 participants