You are browsing as a guest. Sign up (or log in) to start making projects!

Trail

  • 5 Devlogs
  • 9 Total hours

A VCS (Version Control System) that works on the same core principles as Git.

Open comments for this post

54m 16s logged

Devlog 05

Fixed the trail revert "commitId" bug that was requested by a stardance reviewer. Plus, some other improvements.

0
0
11
Ship #1 💀 Cursed

Completed “trail”, a version control system (VCS)


Core Features included:

  • Initialize a trail repository. Run trail init
  • Commit the project with a message. Run trail commit 'commit_description'
  • View Commit history. Run trail log --oneline
  • Revert back to any commit in history. Run trail revert 'commit_id'
  • Compresses the file contents before storing them
  • It hashes the content of each file and sets that hash as the title of that file after it is compressed.
  • Now, it also supports nested files and folders (stores history for all the nested files/folders).
  • Push your code to GitHub seamlessly.
  • Pull code from GitHub

How it works? Step-by-step workflow

  1. You run trail init, it initializes an empty trail repository.
  2. When you have completed a specific feature of your project, run trail commit 'commit_desc' to save a snapshot of current state of your project in history.
  3. Stores the current state of your project in .trail/history.json file.
  4. View commit history by trail log --oneline.
  5. If you want to go back to a specific commit in history, just run trail revert 'commit_id". (Get commit id by running ‘trail log –oneline’)
  6. Push code to GitHub using trail push owner/repo --token GITHUB-PAT --branch main
  7. Pull code from GitHub using trail pull owner/repo --token GITHUB-PAT --branch main

How to generate a GitHub Personal Access Token (PAT):

  1. Go to Settings > Developer Settings > Personal Access Tokens > Tokens (classic) (or Fine-grained tokens).
  2. Click Generate new token.
  3. Give your token a Note (description) and set an Expiration period.
  4. Select the required scope (repo)
  5. Click Generate token at the bottom.
  6. Copy and save your token immediately — GitHub will not show it to you again!

Where history is stored?

All the history of your project is stored in a .trail folder. The structure of .trail is:

my-project/
├── .trail/
│   ├── compressed/
│   └── history.json
├── file1.js
├── package.json
└── ...

history.json stores metadata for every commit.

Each commit contains:

  • Commit ID
  • Commit message
  • Date
  • Mapping of project filenames to compressed file hashes
{
  "commitId": "...",
  "parentId": "...",
  "commitDesc": "Added authentication",
  "date": "...",
  "files": {
    "index.js": "af82bd73...",
    "src/app.js": "b17de09a..."
  }
}

Suggest any other features you want to be in “trail”. I would love to get the feedback and improvement suggestions.

  • 4 devlogs
  • 8h
  • 17.54x multiplier
  • 71 Stardust
Try project → See source code →
Open comments for this post

3h 35m 56s logged

Devlog 04

Added the feature of pushing and pulling the code to GitHub using GitHub PAT (Personal Access Token) and octokit.


How to do this?

Push: trail push owner/repo --token GITHUB-PAT --branch main
Pull: trail push owner/repo --token GITHUB-PAT --branch main

0
0
11
Open comments for this post

46m 43s logged

Devlog 03

Welcome to devlog 3 of trail, I have made some changes in src/commands/revertBack.js so it can bring back nested folders and files also when user runs trail revert commitId.

Future goal:

Enable users to push and pull code from GitHub. It is a complex task, but I will try my best to implement this.

0
0
4
Open comments for this post

2h 7m 53s logged

Devlog 02

Modified the structure of history.json to support nested files also. Before it, trail only saved commit data for root level files.


Before:

{  
    "commitId": "...",
    "commitDesc": "Added authentication", 
    "date": "...",
    "files": {
             "index.js": "af82bd73...",
             "app.js": "b17de09a..."  
    }
}

After:

{
     "commitId": "...", 
     "commitDesc": "Added authentication", 
     "date": "...", 
     "filesAndFolders": {   
                  "D:\\Projects\\my_project_1\\file1.txt": "af82bd73...",    
                  "D:\\Projects\\my_project_1\\src\\app.js": "b17de09a..."  
       }
}
0
0
4
Open comments for this post

1h 36m 59s logged

Devlog 01

Welcome to “trail”, a version control system built on the same core principles as Git.


Features:

  • Takes a snapshot of the current state of your project.
  • View all the commit history using ‘trail log –oneline’.
  • Revert back to a specific commit in history.

Note:

It currently supports only root level files (no nested folders), but I’m actively working on it to expand its features.

0
0
4

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…