git-s3-push icon indicating copy to clipboard operation
git-s3-push copied to clipboard

Path prefix for bucket key

Open dmfutcher opened this issue 7 years ago • 4 comments

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.

dmfutcher avatar Feb 26 '17 20:02 dmfutcher

Can you assign this to me for Hacktober please? :-)

sleepypikachu avatar Sep 25 '20 12:09 sleepypikachu

Assigned! If you run across any other ways to improve anything, I'm all ears ... project's more than over-due some love 😅

dmfutcher avatar Sep 25 '20 16:09 dmfutcher

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.

sleepypikachu avatar Oct 01 '20 12:10 sleepypikachu

Have merged this. Will do some more extensive testing over the weekend but it's looking good so far!

dmfutcher avatar Oct 09 '20 14:10 dmfutcher