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

using gitinfo2 within a git submodule #26

Open
anbe42 opened this issue Jul 5, 2017 · 1 comment
Open

using gitinfo2 within a git submodule #26

anbe42 opened this issue Jul 5, 2017 · 1 comment

Comments

@anbe42
Copy link

anbe42 commented Jul 5, 2017

Hi,

gitinfo2 does not work if the repo is a git submodule, because the .git directory is located elsewhere (in the parent repo), referenced in a .git file as e.g. gitdir: ../.git/modules/my.submodule

For the hook script it is easy to find the correct GIT_DIR: git rev-parse --git-dir

For the style it is more complicated to do this ... I only implemented a proof-of-concept solution that works for building within the root of the submodule, it does no search through the parent directories. The tex part could surely be improved :-)
I haven't even thought about how this should work for nested submodules.
My preliminary patch is attached.

Andreas

PS: Another hint: The no-op command I use for updating gitHeadInfo.gin (especially refreshing dirty state) is git checkout (it does not change the repo, even if something is staged/uncommitted, but it runs the hooks)), integrated somewhere in my Makefile based build system.

0001-preliminary-support-for-usage-within-a-git-submodule-patch.txt

@josephwright
Copy link

This repository is no longer active: please re-report issues at https://github.com/josephwright/gitinfo2/issues

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