Force using a relative path in .git files to stabilize package fingerprints #105

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@yudai

Up to Git version 1.7.9, the value of gitdir in the .git file of submodules is an absolute path. This makes the fingerprint of some packages unstable. The fingerprint of packages which have submodules in their src files(e.g. dea_next, daylimit in cf-release) depend on the location where the release repository is cloned. bosh create release generates a new version of the packages even when the source files of them have no changes.

This commit adds a method to rewrite the value of gitdir from a absolute path to a relative path before calculating fingerprints. Since Git 1.7.10 uses relative paths for gitdir by default, this change is compatible with the newer Git versions.

This PR is just a proposal and I think we can choose other way to stabilize fingerprints, such as simply ignoring .git files.

@d
Cloud Foundry member
d commented Mar 31, 2013

-1.
Instead of going down the submodule rabbit hole, I think we should add negative glob to the package spec

@yudai

Thank you for the comment.
Yes, we can exclude .git files by adding negative globs to specs. I understand that my proposal is adding a special care only to git submodules and it might bring in some inconsistency.
However, I think this special care to git submodules is natural to BOSH because BOSH itself is build on the top of Git and submodules are very common way to include src files. In addition to that, I, personally, don't want to add negative globs to each specs.
Thank you again for the comment. We can use your idea until we get Git 1.7.10.

@yudai

Closing because this commit does not support git 1.7.0.4 (lucid default), which did not support separated .git directories.

@yudai yudai closed this Apr 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment