41

I understand this is an xcode warning/error, however, it happens when I try to run gitk --all from the command line.

YuFei-Zhus-MacBook-Pro:test phil88530$ gitk --all
2012-08-02 21:14:49.246 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.252 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.293 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.295 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.474 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.476 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:50.731 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:50.734 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
YuFei-Zhus-MacBook-Pro:test phil88530$ 

I just replaced a new disk and did a fresh install of osx and updated to mountain lion, installed x11 and xcode. Any suggestions why this happens?

HeatfanJohn
  • 7,143
  • 2
  • 35
  • 41
phil88530
  • 1,499
  • 3
  • 19
  • 27
  • 5
    I'm seeing the same bug after upgrading to Mountain Lion (and installing XQuartz X11). Didn't occur with Lion using Apple's X11. – andy Aug 05 '12 at 19:38
  • Same problem here on a fresh install of ML. – Alec Aug 08 '12 at 19:47
  • Same problem here after upgrading to Mountain Lion and installing XQuartz. – Julio Aug 13 '12 at 15:18
  • same problem after upgrading to SSD and Mountain Lion. I sent an email to git bug report mailing list. – konyak Jan 14 '13 at 04:40

7 Answers7

25
$ alias gitk='gitk 2>/dev/null'

I have same problem here. This is quick tip until someone answers this solution.

  • 1
    For those of us who put the alias into `~/.bash_profile` or similar, but don't want to log out-of/back-into the shell: run `$ . ~/.bash_profile` to activate – Olaf Aug 23 '12 at 11:54
  • Is `. ~/.bash_profile` better than `$ source ~/.bash_profile`? – Dan Crews Sep 05 '12 at 00:57
  • 20
    *Note: This Just Hides the Error Messages** The alias justs redirects gitk's stderr output (file device 2) to /dev/null, thereby masking all errors generated by gitk forever. Probably not a big deal, but if you are using this you should be aware of what it's doing. – SteveS Sep 12 '12 at 19:00
  • this doesn't sound like a good long term answer. has anyone reported this to the gitk maintainers? another option would be to use [git cola](http://git-cola.github.com/) instead, it has similar functionality under `git dag`. though I'd still like to see this fixed – Matt Nov 01 '12 at 16:32
  • You should edit your post to clarify what your quick tip does. – MechEthan Mar 29 '13 at 21:25
8

If you are MacPorts user upgrade tcl/tk to 8.6.0:

$ sudo port install tcl tk
Tair
  • 3,779
  • 2
  • 20
  • 33
7

I got this error just now and find a solution to solve it.

I was trying to invoke the function getResourceValue:forKey:error: in my project and my os version is 10.7.5.

I init a new NSURL object by using + URLWithString: and the problem occurred before, after I replace it with + fileURLWithPath:, it's ok now.

The difference value between the two objects with different functions is /Volumes/Data/a file://localhost/Volumes/Data/a/

Apple has statemented that about NSURL class below:

Handling Object Creation Failure The NSURL class fails to create a new NSURL object if the path being passed is not well-formed; the path must comply with RFC 2396. Examples of cases that will not succeed are strings containing space characters and high-bit characters. Should creating an NSURL object fail, the creation methods return nil, which you must be prepared to handle. If you are creating NSURL objects using file system paths, you should use fileURLWithPath: or initFileURLWithPath:, which handle the subtle differences between URL paths and file system paths. If you wish to be tolerant of malformed path strings, you’ll need to use functions provided by the Core Foundation framework to clean up the strings.

Itachi
  • 5,777
  • 2
  • 37
  • 69
7

Running gitk with a new version of tcl-tk seems to solve this problem (tested with Mac OS X 10.8.4). If you have Homebrew installed, the following should work:

  1. From the command line, run: brew install tcl-tk
  2. Then add the following to your .bashrc or .bash_profile: alias gitk='"$(brew --prefix tcl-tk)/bin/wish" "$(which gitk)"'

After restarting your terminal, you should be able to run gitk normally without seeing any "CFURLCopyResourcePropertyForKey" errors.

mon4goos
  • 1,569
  • 13
  • 24
  • 3
    You might have to run `brew tap homebrew/dupes` before `brew install tcl-tk`, if you already havn't done so. – champagniac Sep 20 '13 at 15:56
  • This breaks the preferences section of gitk, including the colors and also it blurs somehow the text glyphs in the lower left section. – Niloct Dec 05 '13 at 15:25
3

On Mountain Lion 10.8.2, I fixed this issue installing/upgrading tcl and tk – as tair mentioned.

brew install tcl
brew install tk

The UI of gitk will likely change, but you can tweak that in ~/.gitk.

Alric
  • 1,388
  • 1
  • 9
  • 5
  • 1
    This answer actually solves the problem, rather than suppress the error. – Kache Mar 28 '13 at 17:58
  • It also changes hotkeys, and cmd-tab functionality, keyboard repeat speed (which can be fixed). I ended up reverting =\ – Kache Mar 28 '13 at 23:08
  • @Kache can you give more details on hotkey and kbd-speed problems, please, so I try to reproduce these with Macports. Also can't get the cmd-tab issue -- isn't it reserved by OSX? – Tair Mar 31 '13 at 17:44
  • @tair Before, gitk is opened as "Wish". After, it's opened as "X11". The default keyboard repeat speed for X11 was painfully slow, so solution: http://superuser.com/questions/414237/key-repeat-x11-xterm-urxvt. The cmd-tab issue may be related to me using Witch on Mac. Wish was cmd-tabable as normal. X11's window 'goes to sleep'/'is hidden' after it loses focus and is de-prioritized down the Witch cmd-tab list, and Witch needs to "Activate" or "Relaunch" the window. I'm not sure how to explain it better concisely. – Kache Apr 01 '13 at 23:29
  • @Kache The only issue I have is what you call cmd-tab -- and I had it even before Tcl/Tk update, and yes, it's annoying :( – Tair Apr 02 '13 at 04:29
  • @Kache for cmd-tab functionality, please vote here: http://thread.gmane.org/gmane.comp.version-control.git/220724/focus=220728 – Tair Apr 10 '13 at 19:39
  • @Kache my patch was accepted! Now gitk window always appears in front. – Tair Jun 23 '13 at 16:32
1

This blog post solved my issue for this:

http://blog.jasonsemko.com/post/51668282398/easy-fix-for-cfurlcopyresourcepropertyforkey-failed

The long and short of it is gitk isn't parsing the version string of git that comes with Xcode correctly, and is puking on the extra details.

So to fix, you can install a git with a clean version number.

brew install git

You may need to make sure brew's version of git gets called by changing the order directories gets searched in your PATH (e.g., I had to load /usr/bin/local before /usr/bin). Alternatively, you can alias git to the absolute path installed by brew.

dule
  • 17,798
  • 4
  • 39
  • 38
  • Using a homebrew git seems a much better solution than using a homebrew Tcl/Tk with Apple's git. (Or just hiding the errors.) Upvoted. – Rich Aug 03 '15 at 09:13
0

alias gk='gitk --all 2> /dev/null &' (I am on mac)

I have it in the ~/.bash_login file, and it solves it :D

you can also put it the .bashrc file

phil88530
  • 1,499
  • 3
  • 19
  • 27