Skip to content

Allow to use custom snapshot command - #240

Merged
aplaice merged 1 commit into
Stvad:masterfrom
martyone:custom-snapshot-command
Dec 2, 2025
Merged

Allow to use custom snapshot command#240
aplaice merged 1 commit into
Stvad:masterfrom
martyone:custom-snapshot-command

Conversation

@martyone

Copy link
Copy Markdown
Contributor

No description provided.

@martyone

Copy link
Copy Markdown
Contributor Author

Screenshot of the added UI controls:

image

@aplaice

aplaice commented Nov 14, 2025

Copy link
Copy Markdown
Collaborator

Interesting! Thanks! (Thanks also for the screenshot and for keeping the change as self-contained as possible.) Good catch on the ABC class method!


Some comments:

I believe logger in custom_command_repo.py is no longer used?

(Nitpicky, sorry!) I think that it'd be better if CUSTOM_SNAPSHOT_COMMAND (and the lower-case variants) were renamed in the order SNAPSHOT_CUSTOM_COMMAND. (I believe that we currently are sort-of namespacing the config keys (import_, export_, snapshot_), which makes it easier to read.) (Hopefully it should be a trivial recursive search/replace.)


I think that the "docs" (on the right side of the config UI) should be clarified for the default case — something to the effect of "if left blank runs normal procedure". The description for the env variable is also IMO slightly too concise.

Maybe something like:

Optional shell command to run instead of the normal `git-commit` procedure. The `CROWD_ANKI_COMMIT_MESSAGE` environment variable for the shell command will be set to the commit message that would be used normally.

Default: Blank, so the normal `git-commit` procedure is run.

(Maybe "built-in git-commit procedure" instead of "normal git-commit procedure?)

Further, I believe that it would be better for the field in the UI to be labelled fully "Snapshot custom command" (and also in the "docs"). (Yes, it's the "snapshot" section, so it should be obvious, but given that people often just quickly glance through, it's better to be explicit. It's also more consistent with the previous cases, (e.g. "snapshot path") where we repeat "snapshot".)


Sorry about the nit-picks!

@martyone
martyone force-pushed the custom-snapshot-command branch from 5446ee3 to 3be6d97 Compare November 21, 2025 12:35
@martyone

Copy link
Copy Markdown
Contributor Author

@aplaice Thanks for review and suggestions! Updated.

I did a bit differently in case of the command, because the command overrides just one aspect of taking a snapshot, but using the wording "snapshot custom command" would imply (to me) that it overrides it completely.

image

@aplaice aplaice left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much!

"snapshot custom command" would imply (to me) that it overrides it completely.

Yeah, you're right. Good call! Thanks!


I'll leave this open for a short while in case anybody has further thoughts, and then merge!

@aplaice
aplaice merged commit ac5a2e1 into Stvad:master Dec 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants