dokku-clone icon indicating copy to clipboard operation
dokku-clone copied to clipboard

Allow cloning of repositories at specific commits

Open ltalirz opened this issue 5 years ago • 4 comments

Some git repositories don't use tags (for example all of heroku's getting started apps), i.e. in order to do reproducible clones you would like to be able to point to a specific commit via its SHA1 hash.

ltalirz avatar Nov 08 '20 16:11 ltalirz

This plugin works by cloning the repo into a temp directory, then pushing it to dokku. So shouldn't be a big deal to update this to allow a hash, however not sure the best syntax for that as the third parameter is already being used for tags & branches. If this isn't a common issue, you could fork the repo you wanted at that commit, and use that.

Or if you want to suggest a nifty commit syntax I'd consider a pull request.

crisward avatar Nov 08 '20 20:11 crisward

What about the approach taken by the ansible git module (see the documentation of the version and refspec parameters): https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html

In essence, the version parameter can be used for branches, tags and sha1 hashes alike.

The refspec parameter is needed only when specifying sha1 hashes that are not reachable by any branch or tag, which is not a use case I have ever encountered. In my view it is fine not to support it until a use case arises.

ltalirz avatar Nov 08 '20 20:11 ltalirz

What about the approach taken by the ansible git module (see the documentation of the version and refspec parameters): https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html

In essence, the version parameter can be used for branches, tags and sha1 hashes alike.

This also seems to be the approach taken by @josegonzalez in the new git:sync feature of dokku 0.23 https://github.com/dokku/dokku/pull/4297

Does this new feature basically replace the dokku-clone plugin?

ltalirz avatar Jan 24 '21 15:01 ltalirz

@ltalirz that was the idea.

josegonzalez avatar Jan 24 '21 16:01 josegonzalez