Avoid infinite loop in __gs_relative_path when $(PWD) contains a symlink... #42

Merged
merged 1 commit into from Jul 13, 2012

Conversation

Projects
None yet
2 participants
@alhad
Contributor

alhad commented Jul 13, 2012

[Resending pull request - I had closed my previous request because I thought "readlink -f" would fall over when given a non-symlinked path, but it handles it just fine]

When $(PWD) has a symlinked directory, in function __gs_relative_path, the comparison becomes between an absolute path and symlinked directory, resulting in the while loop never terminating, and "gs" for example getting stuck forever. The patch first resolves $(PWD) to an absolute path.

For example I have a ~/work directory that maps to the base of all my sources, and I typically do |cd ~/work| to go there.

@ndbroadbent

This comment has been minimized.

Show comment
Hide comment
@ndbroadbent

ndbroadbent Jul 13, 2012

Member

OK, this looks fine to me. I might merge it, and then re-indent your new lines :)

Member

ndbroadbent commented Jul 13, 2012

OK, this looks fine to me. I might merge it, and then re-indent your new lines :)

ndbroadbent added a commit that referenced this pull request Jul 13, 2012

Merge pull request #42 from alhad/gs_relative_path_fix
Avoid infinite loop in __gs_relative_path when $(PWD) contains a symlink...

@ndbroadbent ndbroadbent merged commit 94b2b9b into scmbreeze:master Jul 13, 2012

@ndbroadbent

This comment has been minimized.

Show comment
Hide comment
@ndbroadbent

ndbroadbent Jul 13, 2012

Member

ah, you were using tabs, no problem :)

Thanks for helping out with this! But I see that you were working on the bash fallback - there is a Ruby version that is a lot faster. All you need to do is install Ruby.

Member

ndbroadbent commented Jul 13, 2012

ah, you were using tabs, no problem :)

Thanks for helping out with this! But I see that you were working on the bash fallback - there is a Ruby version that is a lot faster. All you need to do is install Ruby.

@alhad

This comment has been minimized.

Show comment
Hide comment
@alhad

alhad Jul 14, 2012

Contributor

Yeah, sorry about the tabs :)

I did notice that it was not picking up Ruby, must be something wrong with my Ruby install. Need to look into it.

Also, thanks in general for scm_breeze! I almost can't imagine using git without it.

Contributor

alhad commented Jul 14, 2012

Yeah, sorry about the tabs :)

I did notice that it was not picking up Ruby, must be something wrong with my Ruby install. Need to look into it.

Also, thanks in general for scm_breeze! I almost can't imagine using git without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment