Softwire Blog


Copying SHA-1 hashes from gitk to the clipboard


7 August 2014, by

I don’t know if anyone else has this problem, but gitk with cygwin gives me the following headache all the time: I can’t copy more than one SHA-1 hash from it to the clipboard.

The problem

Say you want to diff between two commits, or cherry pick a range or something. Find the first commit, select the hash (like other cygwin/unix tools, selecting is enough to copy, so there’s no need to mash ctrl-c), paste it into the command line or wherever you want it.

Why won’t it copy?

So far so good. You needed two commits to diff between, so you select the other commit, select the SHA1 hash, paste it… and it pasted the first one. Even though you copied a new hash. The clipboard hasn’t updated, no matter how much you frantically click on the commit, the hash, select all or part of the text.

(more…)