How to add git push opts to datalad publish command?

datalad

#1

Hi datalads,

Another datalad question. Currently there is no good way to add google cloud as a special remote to git annex. If you want to use this service, you must utilize their CLI (gsutil/gcloud).

I wrote a wrapper for their CLI that allows a user to specify a remote bucket/project; i.e)

git push -o GCS_BUCKET=‘gs://BUCKETNAME’ origin master

Where the origin is a central bare repository with hooks for synchronizing to google cloud buckets.

Is there any way to pass this option to datalad publish? I noticed it only takes git-annex opts, which do not support push opts (as far as I am aware of in my limited understanding).

More info on hooks here: https://github.com/seldamat/gcp-hooks


#2

https://github.com/DanielDent/git-annex-remote-rclone doesn’t cover it?


#3

as for the option, manpage for git push says

           --push-option=<option> is given from the command line, the values
           of configuration variable push.pushOption are used instead.

so I guess you could just define them in the .git/config?


#4

Thank you Yarick,

I haven’t tried DanielDent’s solution yet but I’m afraid I’ll get the same authentication issues I ran into with https://github.com/bgilbert/gcsannex and other solutions suggested on https://git-annex.branchable.com/tips/using_Google_Cloud_Storage/

As for a temporary solution - I just added GCS_BUCKET in my .bash_profile. Didn’t think to add it to the git config. Thanks!!