Skip to content

Fix detection of git submodules#49

Open
djhoese wants to merge 1 commit into
sphinx-contrib:mainfrom
djhoese:bugfix-git-submodule
Open

Fix detection of git submodules#49
djhoese wants to merge 1 commit into
sphinx-contrib:mainfrom
djhoese:bugfix-git-submodule

Conversation

@djhoese

@djhoese djhoese commented Sep 22, 2020

Copy link
Copy Markdown

Closes #48

This uses the "--show-superproject-working-tree" flag in the get_toplevel_path call to git to add an additional line of output if the current directory is a git submodule of another project (a super project). When provided along with the --show-toplevel flag and when in a git submodule you will get two lines of output. One for the git submodule root and one for the super project root (note: order of the flags in the command determine the order of the lines in the output). If it isn't a git submodule then there will only ever be one line of output.

@djhoese

djhoese commented Sep 22, 2020

Copy link
Copy Markdown
Author

So I'm trying to make this work for my own project and it turns out this won't work when we get to the ref filtering as the file_exists function uses git cat-file which doesn't seem to work properly with git submodules.

@djhoese

djhoese commented Sep 22, 2020

Copy link
Copy Markdown
Author

Ok even if I hack that to work (modifying file_exists) it still fails because the copy_tree function uses git_archive which doesn't support git submodules. Wow, I didn't think this was going to be this hard.

@BurningEnlightenment

This comment was marked as outdated.

@BurningEnlightenment BurningEnlightenment marked this as a duplicate and then as not a duplicate of #17 Oct 6, 2024
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.

Working with git submodules

2 participants