4

It has been shown in this forum that gitk works with the native OS keys to copy/paste for example into the SHA1 ID line: see unable to copy and paste in gitk - macosx and How to copy text in gitk

My question is why doesn't this functionality appear in a menu item under Edit?

Is there some blockage to being able to do that?

See also this reference for a good overview of gitk in the answers:
Guide to understanding gitk?

Community
  • 1
  • 1
Traveler
  • 1,048
  • 14
  • 27

1 Answers1

2

Regarding copy/paste support between Tk and other Apps, this wiki page sums it up:

Q9. When I copy from a Tcl/Tk app on OS X, then quit that app, the text I copied doesn't appear in the system-wide paste buffer.
I need to switch focus to something else while the Tk app is still running for cross-app copy/paste to work as expected. I'm using Tcl/Tk 8.10 on Leopard, though I had the same problem with 8.7 on Tiger. Any way around this?

A9. SLB: I cannot answer specifically for OS X but a similar problem occurs on Windows.
I did investigate that and found that Windows provides two methods for storing information in the clipboard:

  • you can copy the textinto the clipboard or
  • you can store in the clipboard a reference to the application holding the text.

The latter is more efficient when the amount of text is very large but means the information is lost when the application terminates.
This is the only form of copy offered by Tk.
Resolving it would require a TIP to extend clipboard support in Tk.

So copy/paste between an app and a Tk app might not be easy right now...


Original answer:

Having work with gitk all day long today, I can see there is no "focus" even on the left-bottom panel of gitk, where diff of content are displayed.

I.e. clicking in that panel doesn't trigger anything for the other panels.

In other words, the gitk GUI doesn't monitor the mouse click/selection events in that panel, and only native clipboard capability applies in it.

It seems coherent that the 'Edit' menu don't reflect any copy/paste entry, since gitk don't monitor those selections events.
As it is, 'Edit' is only there to edit the preferences.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I agree that only the native OS keys work for copy/paste. But the question is still why can't it be aware? I notice that if I copy to the pasteboard before running gitk, the pasteboard gets cleared. This can be annoying if you have just located the precise SHA that you want to focus on and then have to go back to another app to find/copy it again so that you can paste it into gitk... – Traveler Mar 29 '11 at 06:38
  • @Traveler: I just found some documentation about the issue you are describing in your comment. I have updated my answer. – VonC Mar 29 '11 at 07:00
  • Thank you for that update. In the use case under consideration, the 'gitk' process is not terminated so the clipboard information is available. You can, in fact, perform copy/paste with ctrl-C ctrl-V from the keyboard. So again, why no menu item as is mostly standard? – Traveler Apr 10 '11 at 13:54
  • @Traveler: good question, and i don't have much beside the FAQ I mention in the answer. That may be why there are so many other Git GUI out there (GitX, Git Tower, ...) (http://stackoverflow.com/questions/83789/what-is-the-best-git-gui-on-osx or http://stackoverflow.com/questions/1516720/git-gui-client-for-linux or...) – VonC Apr 10 '11 at 13:58