Stvad / CrowdAnki

Plugin for Anki SRS designed to facilitate cooperation on creation of notes and decks.
MIT License
520 stars 44 forks source link

Wiki locked? #191

Closed sudomain closed 1 year ago

sudomain commented 1 year ago

Hello,

I was going to add this as a page to the wiki, but it seems locked. Wikis are git repos themselves, but surprisingly they don't seem to have a fork/PR workflow on github like regular git repos.

I was going to add page called Adding git based source material as a git submodule with the following contents:

If you are creating a deck and your cards are based on source material that is version controlled with git, you can add the source material as a submodule pegged at a specific commit. If you're not interested in older commits, you can even set it up to not fetch the whole history. As an example with the Anki source code) (I would have chosen the Anki manual as an example here, but it doesn't utilize git tags and I want to demonstrate cloning at a specific tag):

  1. Change directories into your deck project directory: cd ~/anki-collab-decks/anki

  2. Add the source material git repo as a submodule. --depth 1 creates a shallow clone (most recent commit): git submodule add --depth 1 https://github.com/ankitects/anki

  3. change directories in the new source material directory: cd anki

4a. fetch only commit that you want by tag name (-n tells it to get no tags instead of all of them, this flag gets overwritten by the refspec): git fetch --depth 1 -n origin 2.1.61:refs/tags/2.1.61

4b. OR if the source material repo doesn't use tags, you can reference a commit by the hash (must be the full hash at the time of this writing): git fetch --depth 1 -n origin 55f4ccdcbedcbc6be23c6b309db52e87766d63cb

  1. checkout the submodule at the commit: git checkout 2.1.61 or git checkout 55f4ccdcbedcbc6be23c6b309db52e87766d63cb

  2. go to your deck repo: cd ..

  3. commit the source material submodule to your deck repo git add . && git commit

Your deck repo will now also contain your version-controlled source material

aplaice commented 1 year ago

Thanks very much for the contribution! I've added your page here:

https://github.com/Stvad/CrowdAnki/wiki/Adding-git-based-source-material-as-a-git-submodule


Unfortunately, it seems that the Wiki is currently only open to people with push access to the repository, and I'm unable to change this. I'll ask Stvad whether we could make the Wiki open to everybody. (I don't think it's a direct security risk, and if I keep an eye on it (e.g. subscribing to the Wiki atom feed) I can ensure that it won't contain any malicious instructions for users.)

In the meantime, if you have further suggestions please just comment here (or open a new issue, as you prefer) and I'll try to add them asap. You can include your changes in the comment or, alternatively, edit the Wiki in your fork of CrowdAnki and I'll directly pull the commits from your Wiki git repo and push to the "main" version of the Wiki here (whichever is more convenient).

Sorry about the inconvenience! (I wasn't aware of this!) (And thanks for writing here about the problem!)


Wikis are git repos themselves, but surprisingly they don't seem to have a fork/PR workflow on github like regular git repos.

Yeah, that's unfortunate. I'm not sure why GitHub doesn't allow that.

sudomain commented 1 year ago

Thanks for adding it! Keeping this open until we find out whether the wiki will be opened or remain closed

Stvad commented 1 year ago

So it seems the only 2 options are "public editing by everyone" or "editing only by collaborators", with no ability to do PR flow/etc. Given those two options I think I prefer the current default, @aplaice lmk if you disagree!

aplaice commented 1 year ago

Thanks for chiming in! (I was going to write..)

tldr: I'd be in favour of a globally-editable Wiki, but only weakly. (The benefits are minor, and at least some of them can be achieved via other means.)


I think that public editing by anyone on GitHub is not too problematic, though admittedly not great.

AFAICT the main issues are spam* and malicious instructions; if I monitor the changes (e.g. by following the Wiki RSS commit feed), I should be able to catch these. (Obviously, though, if I become unavailable, for some reason, for a longer period of time, you might end up with a spam-filled wiki, which would be unfortunate).

The main benefit of a globally-editable wiki is allowing minor frictionless/permissionless improvements, for which people would not bother to go through the process of opening an issue**. With no PR-workflow, editing the Wiki, as an external person, becomes more annoying than modifying the main repo (I'm not sure what GitHub is/was thinking).

* googling for spam on public github wikis I unfortunately get quite a few results :( However, most of these seem to be old; and currently it seems that GitHub is blocking crawling of the Wikis by search engines so spammers shouldn't benefit from spamming wikis, and so it might not be a problem any longer?

** For instance, I was hoping that people would list their CrowdAnki decks, for which most people would probably not bother opening an issue. OTOH we could have a discussions thread for sharing their decks, which might even be preferable (at least for some people).

sudomain commented 1 year ago

Fwiw, I don't really need to edit it. Perfectly happy to open an issue if something else comes up.