Moodle-DL icon indicating copy to clipboard operation
Moodle-DL copied to clipboard

Git like feature in course download folder

Open HumHongeKamyaab opened this issue 3 years ago • 4 comments

It is continuation of issue #43. It more makes sense to use the git approach for folder version management in downloaded course folder. It will automatically add features to solve the issue of accidental file/folder deletion.
May be it is better that if each course can be treated independently, for e.g.,

$ python3 main.py --pull "$(courseid)" # will update the course content for id $(courseid)
$ python3 main.py --status "$(courseid)" # show status as git status
$ python3 main.py --checkout $(courseid) $(logid) # restore to old log id like git checkout
$ python3 main.py --rm $(some_individual_file) # like git rm

HumHongeKamyaab avatar Aug 26 '20 09:08 HumHongeKamyaab

Ah, now I see what you mean. Yeah, those would be really cool features.

C0D3D3V avatar Aug 26 '20 09:08 C0D3D3V

On second thought, I think it is much easier if main.py function automatically make local git repository for each course folder when first time it is called and make a first commit for it. So each time main.py is run, all the course folder will be updated and new commit will be made in each repository with some predefined message syntax. Now user can manage each course folder with git, without any interference with main.py.

Just to clarify, main.py will work as git clone, pull and commit each time it run depending on context.

HumHongeKamyaab avatar Aug 26 '20 09:08 HumHongeKamyaab

I think the simplest solution would be create a single repository manually and write your own simple shell wrapper which would call moodle-dl and afterwards calls add and commit with e.g. a timestamp as a commit message.

septatrix avatar Feb 14 '22 21:02 septatrix

This downloader kind of implemented the ideas you had (only in a other way, maybe more usefull) https://github.com/omareldeeb/tum-moodle-downloader Actually I still do not get your idea fully. maybe you also just wanted these commands for the moodle-dl database...

I do not want to work on such a feature, I do not see a good reason in it. If someone is intrested in it, do a PR, but first describe what you want to implement.

jonas-t-s already showed in his PR how to implement git repo actions, but that is not what you really want (And I also do not really want it).

C0D3D3V avatar Mar 18 '23 08:03 C0D3D3V