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

Allow symlinks in gh-pages #37

Closed
timwsuqld opened this issue Apr 20, 2015 · 3 comments
Closed

Allow symlinks in gh-pages #37

timwsuqld opened this issue Apr 20, 2015 · 3 comments

Comments

@timwsuqld
Copy link

For a strange use case, we have a gh-pages directory that requires a symlink. The symlink is fine in the build directory, but never comes across when using gh-pages.

In my quick read of the code, I can't see anything obvious that would allow us to bring symlinks across. It would be great if this could be supported

@davisp
Copy link
Collaborator

davisp commented Dec 16, 2016

os.walk doesn't follow symlinks by default. If you want to add a PR to make that an option I'd be willing to add that.

@davisp
Copy link
Collaborator

davisp commented Dec 18, 2016

I had to reorganize some other things and this became an easy add so ghp-import now supports passing -l on the command line to follow symlinks out of your docs directory.

@davisp davisp closed this as completed Dec 18, 2016
dhimmel added a commit to dhimmel/code-96 that referenced this issue Feb 3, 2018
ghp-import did not push symlinks within directory. However, the
versioned directory setup requires symlinks to operate as intended.

Refs c-w/ghp-import#37
dhimmel added a commit to dhimmel/code-96 that referenced this issue Feb 3, 2018
ghp-import did not push symlinks within directory. However, the
versioned directory setup requires symlinks to operate as intended.

Refs c-w/ghp-import#37
dhimmel added a commit to dhimmel/code-96 that referenced this issue Feb 3, 2018
This build is based on
7dbb1a6.

This commit was created by the following Travis CI build and job:
https://travis-ci.org/dhimmel/code-96/builds/337056625
https://travis-ci.org/dhimmel/code-96/jobs/337056626

[ci skip]

The full commit message that triggered this build is copied below:

pickme: ghp-import restore --follow-links

ghp-import did not push symlinks within directory. However, the
versioned directory setup requires symlinks to operate as intended.

Refs c-w/ghp-import#37
dhimmel added a commit to dhimmel/code-96 that referenced this issue Feb 3, 2018
This build is based on
7dbb1a6.

This commit was created by the following Travis CI build and job:
https://travis-ci.org/dhimmel/code-96/builds/337056625
https://travis-ci.org/dhimmel/code-96/jobs/337056626

[ci skip]

The full commit message that triggered this build is copied below:

pickme: ghp-import restore --follow-links

ghp-import did not push symlinks within directory. However, the
versioned directory setup requires symlinks to operate as intended.

Refs c-w/ghp-import#37
@dhimmel
Copy link
Contributor

dhimmel commented Feb 3, 2018

I had to reorganize some other things and this became an easy add

For reference, the commit was cb1dd9a.

ghp-import now supports passing -l on the command line to follow symlinks out of your docs directory.

This is not a great description of the current behavior of --follow-links. Neither is the help message:

https://github.com/davisp/ghp-import/blob/0e2045e750569f67cbcd96e7e53dbfc865df747e/ghp_import.py#L215

Or the README mention:

The -l option will cause the import to follow symlinks for users that have odd configurations that include symlinking outside of their documentation directory.

Here is where --follow-links has an effect in the code:

https://github.com/davisp/ghp-import/blob/0e2045e750569f67cbcd96e7e53dbfc865df747e/ghp_import.py#L174-L179

Specifically, it is passed through to os.walk, whose documentation states:

By default, walk() will not walk down into symbolic links that resolve to directories. Set followlinks to True to visit directories pointed to by symlinks, on systems that support them.
Note: Be aware that setting followlinks to True can lead to infinite recursion if a link points to a parent directory of itself. walk() does not keep track of the directories it visited already.

So from reading this, I believe the behavior of ghp-import without --follow-links is to follow symlinks for files but not directories. With --follow-links, the behavior is follow symlinks for files and directories.

I'm going to open another issue regarding symlinks, but wanted to understand the current behavior first, hence posting to this issue.

dhimmel added a commit to dhimmel/manubot-rootstock that referenced this issue Feb 12, 2018
ghp-import did not push symlinks within directory. However, the
versioned directory setup requires symlinks to operate as intended.

Refs c-w/ghp-import#37
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

3 participants