-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Keeping corrected typos with CrowdAnki #144
Comments
In brief: currently it's unfortunately not possible without manually using Thanks for the question!
It's the best available place! :)
Ultimate Geography uses SuggestionsThe following are obviously very, very far from convenient. The descriptions are based on CrowdAnki's Readme but differ from it, in some places. I'm focusing on the git CLI approach, as I've never used GitHub desktop. I have no idea if it's not too convoluted for everyday use for people not familiar with git. I'm describing it in detail, since it might also help us (the CrowdAnki developers) as a specification for what we might want to automate, to make it easier for future users. :) (Implementing the improvements will take a while, though.) Example workflowI'll try to describe example workflows, for two people correcting typos. In both cases, I'm assuming that you already have a git repository (on GitHub, say at From "scratch"(From "scratch" means that we're assuming that the users haven't imported their decks, yet.) Person A clones cd /path/to/dir/
git clone https://github.com/creator/deck/ In Anki, they import the deck In parallel, person B also clones Person A then exports their deck (with CrowdAnki) back to the directory containing the git clone. In the git directory (in cd /path/to/dir/deck/
# The next line is not strictly necessary but will help avoid some
# issues. It creates a branch, named `person_a_typo_fixes_1` — it
# could be any other name.
git checkout -b person_a_typo_fixes_1
git add '*'
git commit -m "Add person A's typo-fixes" In order to push their changes they need a GitHub account, a fork of the deck on GitHub (just click Fork in the top right corner) and a way of authenticating on GitHub. They can then add their fork and push to it: git remote add personA https://github.com/personA/deck/
git push personA --set-upstream person_a_typo_fixes_1 On GitHub they can then open a PR (Pull requests > New pull request > compare across forks > set "head repository" to Person B can do the same thing (add, commit and push their changes): cd /path/to/dir/deck/
# The next line is not strictly necessary but will help avoid some
# issues. It creates a branch, named `person_b_typo_fixes_1` — it
# could be any other name.
git checkout -b person_b_typo_fixes_1
git add '*'
git commit -m "Add person B's typo-fixes" # This can be any message! :)
git remote add personB https://github.com/personB/deck/
git push personB --set-upstream person_b_typo_fixes_1 The manager/creator of the deck can then merge the two pull requests. If there are no merge conflicts (none of the same notes were modified by different people), this should be straightforward; if not, it might be messy. :( (If the manager/creator of the deck is one of persons A or B, they can push directly to the Once the changes are merged, A and B can pull all the changes back from GitHub: git checkout main # or master, the name of the main branch depends on your git version...
git pull origin and import into Anki. (If their changes haven't yet been merged upstream, but they want to get other people's changes that have been made since their previous import, they can do something like: git pull origin # without first changing the branch and import into Anki.) Starting to use
|
I could not have dreamed of a more profound answer, thank you so much for the write-up. I think I understood most of it, but only testing will show, if I fully comprehend the workflow and underlying mechanics of git. As I am in the middle of studying, I hope to get around to testing this on the weekend. I'd hit you up with any follow-up questions and feedback once I tried it out, if that's okay. Thanks again, this was a huge help already! |
Thanks for the question — it motivated me to rethink the collaboration workflow with CrowdAnki from the Anki side and what are its pain-points (as mentioned, collaboration from the "git"/"repo" side, as in Ultimate Geography, is well developed, but it's far less convenient for end-users).
Yes, of course!
Good luck studying and in your exams! |
A quick update on my situation and the proposed workflow: It works really well, so far! If done some testing, messing around with a 3 card test deck, using two seperate accounts, replicating two users collaborating on that deck. Merging the changes worked flawlessly (unless I messed up) and it's actually not that inconveniet imo. Using GitHub Destkop, for a person collaborating on the deck I now broke it down to:
Honestly, once you get the hang of it, I think it's not to bad. For furthter updates, the person just has to repeat steps 3-10. Probably more questions and issues will arise in the future, using a much more complicated deck, where more things can go wrong. |
Thanks for the update!
I don't think that with the current tooling things can be streamlined. (The idea for improvements would be to roll 2-3 and 5-7 (and ideally also 1 and 8) into CrowdAnki. In principle 2-3 is already possible ( * Technically snapshotting already allows exporting to git, but it's not geared for collaboration.
Merging issues might start cropping up when people use different versions of Anki and when the differences between decks start becoming larger. (They shouldn't and hopefully won't, but I can't promise anything.) |
UpdateJust to let you know: Merging worked fine for a 30.000+ card deck (at least once)! Follow-up questionFrom my understanding, using a fork and a pull request, a contributer publishes only those changes, that are different between his fork and the new export from anki he made. Therefore, any changes made to the main repository are irrelevant, as only the difference on his side is checked and uploaded. In order for this to work porperly, whenever the fork ist updated to the current version of the main repository, the contributing person must import those changes to anki. Otherwise there will be issues on the next export as differences betwenn the now updated fork and the old version in anki, which were created by changes others commited in the mean time, will be interpreted as changes on the contributers side. On merge, those would revert these changes. My question regards contributing as the creator: I, as the creator, import the repository and make some changes. In the mean time, others contribute changes, which I accept and merge with the main. Afterwards, I want upload my changes to the repository aswell, so I export my anki deck as respository. Now: As the main was changed inbetween my import to anki and the export now, wouldn't all changes made by others commited in the mean time be seen as differences to my exportet repository and thereby overwritten, when I push my changes to main? There is probably a very easy explanation, but with my very limited github knowledge I cant figure it out. Any help would be much appreciated! :) |
Yes, exactly!
Yes, you're right — this is tricky, and my previous suggestion (of just pushing to (What I had been thinking was that you, as the creator, would keep your local
However, this is rather confusing and extremely error-prone — if you updated your "local" Instead, I'd suggest that you keep a branch (say "local" You (as creator of the deck and manager of the repository) merge some PRs from contributors (hence "local" You switch your current local branch to "local" Here, you have two options. Either you can locally (in GitHub desktop) merge " Finally, you import everything back into Anki: "local" I hope that this makes sense! (Also, apologies if I've made the explanations too long-winded.) Sorry again for the confusion! |
Great solution, as always! So basically, I would use a branch the way a contributer can use his fork, as both will not correspond directly to main, right? Put that way, it's actually not that complicated. I will let you now, if I run into any issues. Thanks! |
Yes, that's the idea! :) |
Hey guys,
first of: thanks for your work, it's amazing.
I don't know, if this is the right place, but i got a question:
When two people (A and B) collaborate on a deck and simultaneously correct typos on different notes, is there a way to sync both changes to the repository without losing any progress?
As I understand, the normal workflow would be to first import the deck to sync with any other changes people made. But by doing that, you would lose the changes you made to the content of notes, so all corrected typos would be reverted.
Looking at ultimate geographys github, i found that in order to preserve typo corrections, one is supposed to create a pull request.
As I only use git hub for crowdanki and don't know how to create a pull request for changes regarding certain notes (if that's how it works) I really would appreciate someone to enlighten my, if there are options to resolve this issue and if so, how you would use them.
Any help is much appreciated. Have a nice day!
The text was updated successfully, but these errors were encountered: