use git rev-parse --git-dir instead of just .git/ #16

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
4 participants

barak commented Dec 14, 2015

Sometimes git submodules have a redirection pointer in their .git instead of a directory.
This code (which should probably be refactored, migrated into a gitDir function, sanity checked, etc) addresses that issue.
See bug https://bugs.debian.org/674015

Barak A. Pearlmutter added some commits Dec 14, 2015

the git directory is not always .git
follow up the heirarchy and across redirections using
 git rev-parse --git-dir
Contributor

marquiz commented Dec 16, 2015

I've had part of this .git directory problem fixed for ages. I'd suggest using my patches as a base. I cherry-picked two of them to my feature/fixes branch:
https://github.com/marquiz/git-buildpackage-rpm/tree/feature/fixes

I'm not able to create a pull request from as my repo is not a "Github fork" of git-buildpackage but the commits I'm talking about are:
marquiz/git-buildpackage-rpm@6f3fe2d
marquiz/git-buildpackage-rpm@0daebe4

Those should fix the "buildpackage" case. Pq would need to be fixed in a similar way, i.e. by using GitRepository.git_dir as the basedir.

nacc commented Oct 28, 2016

+1 for @marquiz suggestion, as it also, I think, would fix a use-case I have with having GIT_DIR and GIT_WORK_TREE set in the environment. What is the status of this PR (or of @marquiz's patches?)

Owner

agx commented Jan 20, 2017

@nacc fixed now. If you have issues with GIT_WORK_TREE still please provide steps to reproduce so we can turn it into a testcase. We have one for @barak 's submodule case here:

https://github.com/agx/git-buildpackage/blob/master/tests/component/deb/test_import_orig.py#L303

Thanks @marquiz for the patches. I've modified the first one since we don't want gbp to use subdirs just yet.

@agx agx closed this Jan 20, 2017

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