version control system
- changefile format: record all characters that are different, record space between each different character
-
if a change is made in the middle of the file, it will make the diff file really big. However, if data is just appended or not added at all, then the file will be very small
-
store each character/space in a linked list
-
hex code/character to separate space and char nodes when written to file
-
put each character/space different in struct, don't group characters/spaces until writing final commit file
-
base/reference files: (separate from 1st commit) will have their own directory and extension (
.bas)
-
- base
.repfolder in directorybase: directory holds the original file versionsbranches: holds sub folders for each commit- commits: identifier will be a directory inside their respective branch
logs: logfiles for each branch, holds commit id, message, action type, and timestampSTAGE: file that holds files ready to be committedHEAD: holds current repository head (commit id and branch)
- branches are created with the
rollbackcommand, which copies all commit files from the specified commit id into a separate branch. These branches are prefixed withsub-, along with the first 8 characters of the source commit id. Branches must be manually switched to with thecheckoutcommand, and all subsequent commit folders are placed in the new branch's folder. A new log function is created and log information is printed for that branch only.
Article link: https://dev.to/gbafana25/building-a-version-control-system-2e11
- client gets commit data and creates tarball
- data: id, time, action type, message, tarball size
- 1. - get current commit, use to build folder path
- 2. - create tarball (system())
- client sends struct with action information
- server creates folders for action (new commit, new branch for rollback)
- client sends tarball of folder
- create more helper functions
- have files contents match current commit when switching/rolling back
- fix occasional mangling of tarballs in transit
- server component: client can pull files back down
- automatically have newly created files be unstaged