A version control system built using Python and DropBox API
Groot can be used both on command line as well as through a GUI window, however we do suggest using the CLI to access all of Groot's features, due to certain implementation based restrictions in the GUI.
Groot supports most major version control features such as add, commit, pull, push, status, clone to name a few. The CLI also features prominent CLI utility tools to help out such as clear, cd, mkdir, rmdir, nano, ls and cat.
The GUI interface is basic and supports only the core features. There are no plans to extend work on the GUI since the interface was included as a course deliverable.
- Create a virtual environment using
virtualenv
virtualenv groot
source groot/bin/activate- Install the dependencies using
pip3 install -r requirements.txt - Create a
.envfile and add the following keys
DATABASE_URL=
DB_URL=(same as above)
DROPBOX_API_KEY=
DROPBOX_API_SECRET=
DROPBOX_ACC_TOK=- Create the database schema for Groot
You can create the schema for the database using database.py inside the app directory. Navigate into the folder, run python3 and execute the following commands
>>> from database import db
>>> db.create_all()Note that if you are running it via an online database such as Heroku-PostgreSQL, you will need to run the above commands on the hosted Python environment.
To run Groot on command-line, run python3 src/main.py
If you would like to run with the debugger, use python3 src/main.py debug
Welcome to Groot!
>>>You can create users using tgp user create. This will create user specific directories on DropBox as well.
>>> tgp user create
Enter username: amithanayak
Enter email: nayak@gmail.com
Enter password:
Creating ID: USER000003
New user successfully created.You can create users using tgp user login
>>> tgp user login
Enter username: amithanayak
Enter password:
Welcome back, amithanayakYou can logout using tgp user logout
>>> tgp user logout
You have logged out.To access repository functions, you need to be inside a directory with a .groot subfolder. The .groot subfolder handles all commit history, and stores the diffs in tracked files across commits.
You can either navigate to a directory with cd or clone or create a repository as required.
You can create a repository using tgp init [REPOSITORY NAME]. This will create a local directory with a .groot subfolder to handle commit history. The repository will also gets created on DropBox.
>>> tgp init myfirstrepo
Enter repository description? [y/n]: y
Enter repository description (under 150 chars): this is myfirstrepo
Enter repository visibility [public/private]: public
New repository successfully created.
Uploading .groot/tgpinfo.txtTo clone a repository, it either needs to be public or you need to have collaborator access to it. Clone a repository using tgp clone [USERNAME]/[REPOSITORY NAME]
>>> tgp clone amithanayak/helloworld
Cloning repository helloworld...
Archive: helloworld.zip
creating: helloworld/
creating: helloworld/.groot/
extracting: helloworld/.groot/tgpinfo.txtYou can track files using the tgp add [.|FILEPATH FILEPATH ...]. Using a . will track all files inside the directory recursively.
>>> tgp add .
File ./helloworld.txt successfully tracked.
File ./.groot/tgpinfo.txt successfully tracked.You can create commits using tgp commit [COMMIT MESSAGE]. Once committed, diff files are generated and commit history is created in .groot.
>>> tgp commit add helloworld.txt
added changes: ./helloworld.txt
1 files changed: 1 addtions(+) 0 deletions(-)You can fetch the commit history on the remote and compare it with your local working copy. To perform a check, run tgp status
>>> tgp status
modified: ./.groot/tgpinfo.txt
modified: ./helloworld.txtYou can push your changes to the remote using tgp push. This will update the repository directory on DropBox with the files in your local repository directory.
>>> tgp push
Uploading helloworld.txt
Uploading .groot/tgpinfo.txt
Uploading .groot/COMMIT000005--2021-04-11-16:42:57/FILE000008.txtYou can pull changes from remote using tgp pull. Internally, a tgp status is also performed to check for diffs in each file.
>>> tgp pull
Pulling changes...
Archive: myfirstrepo.zip
extracting: myfirstrepo/hi.txt
extracting: myfirstrepo/helloworld.txt
extracting: myfirstrepo/.groot/tgpinfo.txt
creating: myfirstrepo/.groot/COMMIT000006--2021-04-11-18:49:18/
extracting: myfirstrepo/.groot/COMMIT000005--2021-04-11-16:42:57/FILE000008.txt
extracting: myfirstrepo/.groot/COMMIT000006--2021-04-11-18:49:18/FILE000010.txt To add a collaborator, you need to be the owner of the repository. Add a collaborator using tgp repo add collab [USERNAME]
>>> tgp repo add collab <username>
User <username> successfully added as collaborator.Groot also features prominent command line utilities to allow users to quickly made file edits as well as move files and folders without leaving the application.
cd [PATH]ls [OPTIONAL=DIRECTORY PATH]cat [FILE PATH]mkdir [DIRECTORY PATH]rmdir [DIRECTORY PATH]nano [FILE PATH]clearorcls
Groot also features a convenient help command to assist you in times of need.
>>> help
GROOT
Groot is a version control system built using Python3 and DropBox API
1. User Commands
tgp create user -- Create an account
tgp user login username password -- Login to existing account
2. Repository Commands
tgp init repository_name -- Create a new repository
...If you would like to see a cute Groot, just type groot
>>> groot
.^. . _
/: ||`\/ \~ ,
, [ & / \ y'
{v': `\ / `&~-,
'y. ' |` . ' /
\ ' . , y
v . ' v
V .~. .~. V
: ( 0) ( 0) :
i `'` `'` j
i __ ,j
`%`~....~'&
<~o' / \/` \-s,
o.~'. )( r .o ,.
o', %``\/``& : 'bF
d', ,ri.~~-~.ri , +h
`oso' d`~..~`b 'sos`
d`+ II +`b
i_:_yi_;_y Contributions to Groot are welcome, in the form of bug fixes as well as feature enhancements. We look forward to adding more features to the CLI, such as forks and branches.
This project was made as a part of the Object Oriented Analysis and Design & Software Engineering Laboratory Course (UE18CS355) at PES University.