Skip to content

Fix git execution with wrong working directory#16

Merged
akiomik merged 4 commits intoakiomik:masterfrom
Droggelbecher:master
Oct 23, 2013
Merged

Fix git execution with wrong working directory#16
akiomik merged 4 commits intoakiomik:masterfrom
Droggelbecher:master

Conversation

@Droggelbecher
Copy link
Contributor

Seems I fixed the problem related to opening files with methods like "gf", please review (eg. I bet the chdir can be done more elegantly in vimscript) and apply if you like :)

justinmk and others added 2 commits March 24, 2013 22:12
This fixes a problem where wrong gutter markers would appear after navigating
to another place with e.g. 'gf'.
@Droggelbecher
Copy link
Contributor Author

Here the former more detailed description of the problem:

Lets say I have a code repository like this:

/home/droggl/code
/home/droggl/code/.git
/home/droggl/code/a/a.h
/home/droggl/code/b/b.h

Assume a.h and b.h are both checked in and all working trees are clean.

Now lets say, I chdir into /home/droggl/code/a and edit a.h (git-gutter-vim behaving exactly as I like so far). Now say somewhere in a.h there is a
#include "../b/b.h". If i navigate to that filename and type "gf" (tell vim to open that file), then git-gutter-vim will show all lines as new (they aren't though, b.h is already checked in!).
This also gets repaired when i let vim chdir to /home/droggl/code/b/b.h and re-edit the file (:e).

What vim actually opened with the gf according to its status line is: "~/droggl/code/a/../b/b.h".
As somebody who hasnt got the slightest idea about vim scripting I can only assume, git-gutter-vim does not handle that form correctly?

@akiomik
Copy link
Owner

akiomik commented Oct 23, 2013

Sorry to reply late. Thanks!

akiomik added a commit that referenced this pull request Oct 23, 2013
Fix git execution with wrong working directory
@akiomik akiomik merged commit b41b8b4 into akiomik:master Oct 23, 2013
@akiomik akiomik mentioned this pull request Oct 23, 2013
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.

3 participants