Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ease commiting after export with custom settings #15

Closed
code-hunger opened this issue Jun 9, 2017 · 2 comments
Closed

Ease commiting after export with custom settings #15

code-hunger opened this issue Jun 9, 2017 · 2 comments

Comments

@code-hunger
Copy link
Contributor

code-hunger commented Jun 9, 2017

After I make my edits and I export the deck as JSON, I get quite a lot of differences with the repository file that don't need to be commited.

Lines like 'crowdanki_uuid', 'deck_config_uuid', custom settings like new cards/reviews per day, the media file list (some files are reordered), the font, 'mid' value, marked cards - all these lines need to be reset by hand one by one when adding the file for commit.
This is really annoying when I want to commit just a few changes to the deck.

I was about to write a script to do this but I found no easy way to git add by line programmatically. How do you deal with this problem?

If there was a way to split the file into multiple parts so that the card info is separated from the settings, I could .gitignore the other files but currently that's impossible.

@axelboc
Copy link
Collaborator

axelboc commented Jun 12, 2017

Yeah it's annoying... I don't get why the CrowdAnki plugin is exporting all this stuff, especially the custom settings. The media ordering is definitely an issue. Feel free to create an issue there, but I reckon the easiest for now would be to edit the JSON file directly.

@code-hunger
Copy link
Contributor Author

I did it! A bash script to reset the first 792 lines (they hold the settings information).
https://gist.github.com/code-hunger/40d28682628186b8e7568da7a0645dcd
It works wonderfully. Now I just export the deck and run this script, and only the note changes are kept. I'm sure it'll make life a lot easier!
Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants