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

Unable to find filename with git blame error #14

Closed
dcaunt opened this issue Apr 15, 2014 · 8 comments
Closed

Unable to find filename with git blame error #14

dcaunt opened this issue Apr 15, 2014 · 8 comments

Comments

@dcaunt
Copy link

dcaunt commented Apr 15, 2014

I'm seeing the error Unable to find filename with git blame when trying to Open either a commit or file on GitHub. I tried for a couple of projects, one on a corporate GitHub and one on github.com.

In the system console, I can see logs showing my GIT remotes (shows remotes correctly) and GIT blame (blank). Xcode's blame and comparison source control features are working fine.

@larsxschneider
Copy link
Owner

Can you post a redacted version of your remotes and the output of git status?
Thanks!

@dcaunt
Copy link
Author

dcaunt commented Apr 15, 2014

Below is my setup for Mantle, as this is public:

$ git remote -v
origin https://github.com/MantleFramework/Mantle.git (fetch)
origin https://github.com/MantleFramework/Mantle.git (push)

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

Console output from Xcode:

15/04/2014 14:34:32.348 Xcode[4464]: GIT remotes: (
"origin\thttps://github.com/MantleFramework/Mantle.git (fetch)",
"origin\thttps://github.com/MantleFramework/Mantle.git (push)",
""
)
15/04/2014 14:34:32.450 Xcode[4464]: GIT blame:

@larsxschneider
Copy link
Owner

I wasn't able to reproduce the error.

Can you go to your Mantle directory and run the following on the command?

git --no-pager blame -L11,11 -l -s -n -f -p /[YOUR-PATH]/Mantle/Mantle/Mantle.h

What is the output? Is your Git located at /usr/bin/git? What is your Git/Xcode/OSX version?

Thanks!

@dcaunt
Copy link
Author

dcaunt commented Apr 17, 2014

My git is a symlink to Homebrew's git:

/usr/local/bin/git -> ../Cellar/git/1.9.1/bin/git

Git version is 1.9.1:

$ git --version
git version 1.9.1

Xcode Version 5.1.1 (5B1008).
OS X Mavericks 10.9.2 Build 13C64

blame output:

$ git --no-pager blame -L11,11 -l -s -n -f -p ~/Projects/Mantle/Mantle/Mantle.h
f175aa35efa9c0da42b724039f6140a6c6690726 9 11 1
author Justin Spahr-Summers
author-mail redacted
author-time 1357512637
author-tz -0800
committer Justin Spahr-Summers
committer-mail redacted
committer-time 1357512637
committer-tz -0800
summary Use framework-style imports in Mantle.h
previous aedc4242930b69f174d5b40ece7083ece7bb2ad5 Mantle/Mantle.h
filename Mantle/Mantle.h
#import <Mantle/MTLModel.h>

@larsxschneider
Copy link
Owner

I tried a number of things but I was not able to reproduce the error. However, I made a change to capture git errors a little better. Can you checkout the new error-report branch and compile/run this branch on your local machine? Then we should know what goes wrong on your end.

https://github.com/larsxschneider/ShowInGitHub/tree/error-report

@dcaunt
Copy link
Author

dcaunt commented Apr 24, 2014

Thanks, this is interesting:

Call:
git --no-pager blame -L0,0 -l -s --show-number --show-name --porcelain >/Users/dcaunt/Projects/ShowInGitHub/Source/Classes/SIGPlugin.m

Output:

Version:
git version 1.7.10.2 (Apple Git-33)

xcrun shows a different version again:

$ xcrun git --version
git version 1.8.5.2 (Apple Git-48)

Looks like there is definitely a problem in my setup.

@dcaunt
Copy link
Author

dcaunt commented Apr 24, 2014

So I took a look at the plugin source and you're calling /usr/bin/git which is quite outdated. My git config contains a value which isn't valid in Git 1.7 (push.default = simple) and this causes the command to error. By changing my config, the plugin works as expected.

Perhaps the plugin would be more stable if it used xcrun git to run the git binary included in Xcode's app bundle rather than relying on the system git.

@larsxschneider
Copy link
Owner

Thanks for the xcrun hint! I didn't know about this one. I will test the new version tomorrow and merge afterwards.

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

No branches or pull requests

2 participants