commit 9dd6f4a860aa6ad36607962b3d1998c8a252ff6a
parent c585c27b98d341891368e49c6e4c37858a0253f0
Author: mtmn <miro@haravara.org>
Date: Sun, 26 Apr 2026 00:08:58 +0200
dotfiles: polish git-annex-init
Diffstat:
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/modules/mixins/dotfiles/bin/git-annex-init b/modules/mixins/dotfiles/bin/git-annex-init
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
-Initialize git-annex with an S3 special remote.
+Initialize git-annex with an S3 special remote
Usage:
git-annex-init <name> <prefix> [options]
@@ -49,7 +49,7 @@ def aws_credential(key: str, profile: str) -> str:
def main() -> None:
parser = argparse.ArgumentParser(
- description="Initialize git-annex with an S3 special remote.",
+ description="Initialize git-annex with an S3 special remote",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=(
"examples:\n"
@@ -105,12 +105,12 @@ def main() -> None:
)
if args.dry_run:
- log.info("Dry run — no changes will be made.")
+ log.info("Dry run — no changes will be made")
cwd = Path.cwd()
# Credentials
- log.info("Fetching AWS credentials from profile '%s'...", args.aws_profile)
+ log.info("Fetching AWS credentials from profile '%s'", args.aws_profile)
os.environ["AWS_ACCESS_KEY_ID"] = aws_credential(
"aws_access_key_id", args.aws_profile
)
@@ -134,7 +134,7 @@ def main() -> None:
# git-annex init
if not run_ok(["git", "annex", "status"]):
- log.info("Initializing git-annex...")
+ log.info("Initializing git-annex")
run(["git", "annex", "init", args.name])
run(
[
@@ -156,7 +156,7 @@ def main() -> None:
# S3 remote
if not run_ok(["git", "annex", "info", "s3"]):
- log.info("Initializing S3 remote...")
+ log.info("Initializing S3 remote")
run(
[
"git",
@@ -174,16 +174,15 @@ def main() -> None:
]
)
else:
- log.info("Enabling existing S3 remote...")
+ log.info("Enabling existing S3 remote")
run(["git", "annex", "enableremote", "s3"])
# Push
- log.info("Copying files to S3...")
+ log.info("Copying files to S3")
run(["git", "annex", "copy", "--to", "s3", "."])
run(["git", "annex", "sync", "s3"])
- log.info("Done. %s → s3://%s/%s", args.name, args.bucket, args.prefix)
- log.info("Verify with: git annex whereis .")
+ log.info("%s → s3://%s/%s", args.name, args.bucket, args.prefix)
if __name__ == "__main__":