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

add reference option for all create and add commands #14

Merged
merged 1 commit into from Sep 3, 2013
Merged

add reference option for all create and add commands #14

merged 1 commit into from Sep 3, 2013

Conversation

adgoudz
Copy link
Contributor

@adgoudz adgoudz commented Aug 16, 2013

When creating release repositories in my development environment I've found it helpful to pass the --reference option to git submodule 'add' and 'update' commands (see git documentation) to hard-link objects from a local clone of a sub-module, rather than recopying them from an origin. This makes things a lot more efficient than duplicating modules when I typically already have a clone on disk for local development.

The git documentation cautions against referencing local clones where natural branch progression might result in garbage collection of referenced objects, however the general concept and usage of release repositories seems to preclude this.

I've come up with a --reference_root option to signify to git release commands that submodules should be referenced from a specified root directory. This pertains specifically to the following release "create" commands:

  • clone
  • deploy
  • add

The tests can verify this functionality by checking for the existence of a .git/modules/<name>/objects/info/alternates file as per the git documentation.

Right now this functionality assumes the existence of the reference repository on disk (and that it is local, i.e. not mounted) and git will complain if otherwise. I could enhance the error handling to catch this earlier on (and possibly recover gracefully) but for now everything seems to work.

preaction added a commit that referenced this pull request Sep 3, 2013
add reference option for all create and add commands
@preaction preaction merged commit be977bd into preaction:master Sep 3, 2013
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.

None yet

2 participants