git-s3-push
git-s3-push copied to clipboard
Path prefix for bucket key
Add an option to specify a path prefix for the bucket key ie. allow pushing git repos into sub-folders of S3 buckets. This would allow, for example, storage of multiple git repos in a single S3 bucket.
Can you assign this to me for Hacktober please? :-)
Assigned! If you run across any other ways to improve anything, I'm all ears ... project's more than over-due some love 😅
How do you think prefixes should handle commit refs?
Currently we always upload to the root of the bucket and keep track of whether there are any new commits by using a git ref. If you run
git-s3-push
git-s3-push -p foo
back to back you'll end up with nothing in foo because there are "0" new commits.
This might be fine if the intended use is to only ever use a single prefix per git repo, though I'd argue we might want to add a switch/some docs on the git invocations to ignore/reset the ref to allow existing users to move into a folder.
The other option is to create a per-prefix ref and use this to track the changes. Would allow pushing branches to prefixes, etc. but perhaps that is overkill for this tool/outside the scope of this feature?
EDIT: Also means if you add a prefix where you didn't have one previously you will end up with only the updated files in the prefix directory, which I think is pretty confusing behaviour.
Have merged this. Will do some more extensive testing over the weekend but it's looking good so far!