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

Import Git Repository with multiple Anki Decks #159

Open
gnarlex opened this issue Dec 16, 2021 · 3 comments
Open

Import Git Repository with multiple Anki Decks #159

gnarlex opened this issue Dec 16, 2021 · 3 comments

Comments

@gnarlex
Copy link

gnarlex commented Dec 16, 2021

Thank you for your plugin 🙏 Makes collaborating to Anki decks much easier 😌

One feature that I'm missing is importing multiple decks in a git repository, structured in multiple directories (like in this repository)

github.com/user/university-decks/
├─ foo-deck/
│   ├─ media/
│   └─ deck.json
└─ bar-deck/
   └─ deck.json

At our university we often keep decks in "monorepos" structured like this, because it can be cumbersome to keep many decks in many repositories.

@aplaice
Copy link
Collaborator

aplaice commented Dec 17, 2021

This sounds like a good idea. (No promises about when this might be implemented, though. :))


Ideally, it would be implemented in such a way that it integrates well with export to a git repo with multiple decks (once git export is actually, fully implemented) and possibly snapshotting multiple decks to a single git repo (#115).

@Sparklester
Copy link

Why is it not possible as of now to initialize a single git repo for a profile containing several decks separately?

The only thing stopping it is that snapshots automatically add a .git in the folder corresponding to every deck within a profile. This makes manual git handling impossible, since I have to delete the .git in every folder every time before making a commit.

Can the auto git init not be disabled when snapshotting?

@aplaice
Copy link
Collaborator

aplaice commented Apr 3, 2022

@Sparklester that's a good point!

It seems that Dulwich's git init-equivalent (just like the "real" git init) is perfectly happy to initialise a repo within another repo. We (CrowdAnki) should probably at least get out of the way and not initialise when directly within an existing repo. (i.e. check whether the parent of the deck directory is the root of a git repository and if it is, not initialise — I think there aren't any major edge cases with that (people using git sub-trees?). I'd rather not just check whether we're in a git repository at any level, since people might do crazy things like keep their home folder in git etc.) Ideally, there should be a config option to allow this (single git snapshot repo) without the user having to manually initialise a repo in the root snapshot directory.

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

No branches or pull requests

3 participants