git-tm 0.4.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Nandhu Krishnan A
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Nandhu Krishnan A
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,89 +1,176 @@
1
- <div align="center">
2
- <img src="src/public/images/logo.svg" width="100" height="100">
3
-
4
- <h1>Git Time Machine</h1>
5
-
6
- <br/>
7
- </div>
8
-
9
- An elegant visual Git history explorer with real-time commit comparison capabilities.
10
-
11
- Built for [FOSS Hack 2025](https://fossunited.org/fosshack/2025), Git Time Machine empowers developers to travel through their codebase history, debug with ease, and collaborate seamlessly. Whether you're auditing changes, resolving conflicts, or understanding project growth, this tool has you covered—all while staying true to the spirit of free and open-source software.
12
-
13
- ---
14
-
15
- ## Demo Video
16
-
17
- [Git Time Machine Demo](demo/git-tm-demo.mp4)
18
-
19
- ## Features
20
-
21
- ### Core Functionality
22
-
23
- - **Interactive Branch Navigation**:
24
- - Visual branch list with color coding
25
- - Support for both local and remote branches
26
- - Easy branch switching and tracking
27
-
28
- - **Rich Commit History**:
29
- - Beautiful commit timeline visualization
30
- - Emoji support for conventional commit messages
31
- - Author avatars with GitHub profile integration
32
- - Detailed commit metadata (author, date, hash)
33
-
34
- - **Advanced Diff Viewer**:
35
- - Side-by-side commit comparison
36
- - Syntax-highlighted code diffs
37
- - File status indicators (Added, Modified, Deleted)
38
- - Collapsible diff sections by file
39
- - Line number tracking for both versions
40
- - Binary file detection
41
-
42
- - **User Interface**:
43
- - Modern glass-morphism design
44
- - Responsive layout for all screen sizes
45
- - Smooth animations and transitions
46
- - Toast notifications for user feedback
47
- - Collapsible comparison panel
48
-
49
- ### Technical Features
50
-
51
- - **Git Integration**:
52
- - Full Git repository support
53
- - Remote repository synchronization
54
- - Branch checkout capabilities
55
- - Comprehensive commit history
56
-
57
- - **Performance**:
58
- - Lazy loading of commit data
59
- - Efficient diff parsing and rendering
60
- - Optimized avatar loading with fallbacks
61
- - Minimal memory footprint
62
-
63
- ### Installation
64
-
65
- ```bash
66
- npm install -g git-tm
67
- ```
68
-
69
- ## Usage
70
-
71
- 1. **Open a Project**:
72
- - Clone a Git repository or open an existing project directory
73
- - Ensure that the project has a valid Git history
74
-
75
- 2. **Run the cli command**:
76
- - Run the following command in the terminal:
77
-
78
- ```bash
79
- git-tm .
80
- ```
81
-
82
- - This will start the Git Time Machine server and open the web interface in your default browser
83
-
84
- 3. **Explore the History**:
85
- - Navigate through the commit history using the timeline
86
- - Compare commits by selecting two different versions
87
- - View detailed commit metadata and file changes
88
- - Switch branches and track changes in real-time
89
- - Enjoy the seamless Git experience!
1
+ <div align="center">
2
+ <img src="src/public/logo.svg" width="96" height="96" alt="Git Time Machine logo">
3
+
4
+ <h1>Git Time Machine</h1>
5
+
6
+ <p>Explore any Git repository's history in your browser.<br>
7
+ Commit graph, diffs, blame, compare and insights. One command, zero dependencies.</p>
8
+
9
+ <a href="https://www.npmjs.com/package/git-tm"><img src="https://img.shields.io/npm/v/git-tm?color=f05133" alt="npm version"></a>
10
+ <img src="https://img.shields.io/badge/dependencies-0-2ea44f" alt="zero dependencies">
11
+ <img src="https://img.shields.io/npm/l/git-tm" alt="license">
12
+ </div>
13
+
14
+ <br>
15
+
16
+ ![Git Time Machine showing a commit graph and a merge commit's changes](docs/screenshot.png)
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ npm install -g git-tm
22
+ ```
23
+
24
+ Or run it once without installing:
25
+
26
+ ```bash
27
+ npx git-tm
28
+ ```
29
+
30
+ Requires Node.js 18.3 or newer and `git` on your `PATH`.
31
+
32
+ ## Usage
33
+
34
+ Run it inside any repository (or any folder within one):
35
+
36
+ ```bash
37
+ git-tm
38
+ ```
39
+
40
+ Then open `http://localhost:7890`, or start it with `git-tm --open` to open the browser for you. Point it at another repository with `git-tm ../other-repo`.
41
+
42
+ It also works as a Git subcommand. Git runs any `git-<name>` program on your `PATH` as `git <name>`, so once installed you can type:
43
+
44
+ ```bash
45
+ git tm
46
+ ```
47
+
48
+ `git -C ../other-repo tm` works too. Use `git tm -h` for help: Git handles `git tm --help` itself and looks for a manual page instead.
49
+
50
+ | Option | Description |
51
+ | --- | --- |
52
+ | `-p, --port <number>` | Port to listen on (default `7890`; the next free port is used if it is busy) |
53
+ | `--host <address>` | Interface to bind (default `127.0.0.1`) |
54
+ | `-o, --open` | Open the browser once the server is running |
55
+ | `--no-avatars` | Do not load author avatars from GitHub or Gravatar |
56
+ | `-v, --version` | Print the version |
57
+ | `-h, --help` | Print help |
58
+
59
+ ## Features
60
+
61
+ **History**
62
+ - Commit graph with branch lanes, merges, and badges for the current branch, local and remote branches and tags
63
+ - Smooth on large repositories: the list is virtualised and history loads page by page as you scroll
64
+ - Show all branches or a single branch, tag or remote
65
+ - Uncommitted changes appear on top of `HEAD`
66
+
67
+ **Commits**
68
+ - Full message, author and committer, parents, and every branch and tag that contains the commit
69
+ - Unified or split diffs with word-level highlights, a hide-whitespace toggle and full-file context
70
+ - Merge commits can be diffed against any parent
71
+ - Open the commit on GitHub, GitLab or Bitbucket when the repository has a remote
72
+
73
+ **Browse and blame**
74
+ - Walk the file tree as it was at any commit
75
+ - View a file at any point in time, with `git blame` alongside
76
+ - File history that follows renames
77
+
78
+ **Time travel (Compare)**
79
+ - Travel from any commit, branch or tag to any other, or to your working tree, and see exactly what changes
80
+ - Works in every direction: forward (commits applied), back in time (commits undone), or across branches (back to the common ancestor, then forward)
81
+ - Step through the journey one snapshot at a time with a slider or the arrow keys; the diff updates at each step
82
+ - Pick commits with a searchable picker, with *Time travel* mode in History (click From, then To), from a commit's detail pane, or by shift-clicking a second commit
83
+ - *Direct* (`a..b`) or *since branch point* (`a...b`, like a pull request)
84
+
85
+ **Search**
86
+
87
+ | Query | Finds |
88
+ | --- | --- |
89
+ | `fix login` | Commit messages |
90
+ | `author:ada` | Commits by an author (name or email) |
91
+ | `path:src/app.js` | Commits that touched a path, following renames |
92
+ | `code:parseConfig` | Commits that added or removed a string (`git log -S`) |
93
+ | `a1b2c3d` | Jumps straight to a commit |
94
+
95
+ **Insights**
96
+ - Activity heatmap for the past year, weekly rhythm by day and hour, and top contributors
97
+
98
+ **Everything else**
99
+ - Light and dark themes (follows your system by default)
100
+ - Notices when the repository changes on disk and offers to refresh; if the git-tm process stops, the page says so and reconnects when it is back
101
+ - Fetch all remotes with one click
102
+ - Keyboard shortcuts: `j`/`k` to move, `Enter` to open, `t` for time travel mode, `←`/`→` to step through a journey, `/` to search, `Esc` to close, `g h`/`g c`/`g i` to switch views, `?` for help
103
+ - Works on phones and tablets
104
+
105
+ ## Privacy and safety
106
+
107
+ - Everything runs locally. The server binds to `127.0.0.1` and rejects requests for other host names, so other websites cannot read your repository.
108
+ - Read-only. Git Time Machine never checks out, commits or rewrites anything. The only command that touches the network is **Fetch**, and only when you press it.
109
+ - Author avatars are loaded from GitHub (for `users.noreply.github.com` addresses) or Gravatar. Use `--no-avatars` to keep everything offline; initials are shown instead.
110
+
111
+ ## How it works
112
+
113
+ `git-tm` starts a small HTTP server built on Node's standard library. It asks `git` for machine-readable output (for example `git log --format=...`, `git diff --raw -z`, `git blame --porcelain`), so it works with every Git feature your installed `git` supports: worktrees, submodules, SHA-256 repositories, `.mailmap` and more. The interface is plain HTML, CSS and JavaScript modules, with no framework and no build step.
114
+
115
+ ```
116
+ src/
117
+ cli.js command-line entry point
118
+ server.js HTTP server and JSON API
119
+ git.js git commands and output parsing
120
+ public/ the web interface
121
+ js/graph.js commit graph layout
122
+ js/diff.js diff rendering
123
+ test/ node:test suites
124
+ ```
125
+
126
+ ## Development
127
+
128
+ There is nothing to install or build. Clone and run:
129
+
130
+ ```bash
131
+ git clone https://github.com/nandhu-44/Git-Time-Machine.git
132
+ cd Git-Time-Machine
133
+ node src/cli.js .
134
+ ```
135
+
136
+ Run the tests:
137
+
138
+ ```bash
139
+ npm test
140
+ ```
141
+
142
+ Use your working copy as the global `git-tm` command (undo with `npm unlink -g git-tm`):
143
+
144
+ ```bash
145
+ npm link
146
+ ```
147
+
148
+ Check exactly what would be published:
149
+
150
+ ```bash
151
+ npm pack --dry-run
152
+ ```
153
+
154
+ ### Releasing
155
+
156
+ Pushing a version tag publishes to npm from GitHub Actions ([`publish.yml`](.github/workflows/publish.yml)), using npm trusted publishing, so no npm token is stored anywhere.
157
+
158
+ ```bash
159
+ npm version patch
160
+ ```
161
+
162
+ ```bash
163
+ git push origin main --follow-tags
164
+ ```
165
+
166
+ `npm version` bumps `package.json`, commits and creates the `vX.Y.Z` tag. Use `minor` or `major` as needed. The workflow checks that the tag matches `package.json`, runs the tests and publishes.
167
+
168
+ GitLab CI ([`.gitlab-ci.yml`](.gitlab-ci.yml)) runs the same tests. It publishes only if an `NPM_TOKEN` CI/CD variable is set, so a mirrored tag is not published twice.
169
+
170
+ ## Background
171
+
172
+ Git Time Machine started at [FOSS Hack 2025](https://fossunited.org/fosshack/2025). Version 1 is a complete rewrite focused on speed, a clean interface and deeper Git features.
173
+
174
+ ## License
175
+
176
+ [MIT](LICENSE)
package/package.json CHANGED
@@ -1,45 +1,40 @@
1
- {
2
- "name": "git-tm",
3
- "version": "0.4.1",
4
- "description": "An elegant visual Git history explorer with real-time commit comparison capabilities",
5
- "main": "src/cli.js",
6
- "bin": {
7
- "git-tm": "src/cli.js"
8
- },
9
- "scripts": {
10
- "start": "node src/cli.js"
11
- },
12
- "type": "module",
13
- "dependencies": {
14
- "boxen": "^8.0.1",
15
- "center-align": "^1.0.1",
16
- "chalk": "^4.1.2",
17
- "commander": "^11.1.0",
18
- "express": "^4.18.2",
19
- "figlet": "^1.6.0",
20
- "gradient-string": "^3.0.0",
21
- "open": "^10.0.3",
22
- "ora": "^7.0.1",
23
- "simple-git": "^3.22.0"
24
- },
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://gitlab.com/nandhu-44/Git-Time-Machine.git"
28
- },
29
- "keywords": [
30
- "git-tm",
31
- "git-time-machine",
32
- "git",
33
- "time",
34
- "commits",
35
- "commit-history",
36
- "source-control",
37
- "gitlab"
38
- ],
39
- "author": "nandhu-44",
40
- "license": "MIT",
41
- "bugs": {
42
- "url": "https://gitlab.com/nandhu-44/Git-Time-Machine/issues"
43
- },
44
- "homepage": "https://gitlab.com/nandhu-44/Git-Time-Machine#readme"
45
- }
1
+ {
2
+ "name": "git-tm",
3
+ "version": "1.0.1",
4
+ "description": "Explore any Git repository's history in your browser: commit graph, diffs, blame, compare and insights. Zero dependencies.",
5
+ "type": "module",
6
+ "bin": {
7
+ "git-tm": "src/cli.js"
8
+ },
9
+ "files": [
10
+ "src"
11
+ ],
12
+ "scripts": {
13
+ "start": "node src/cli.js",
14
+ "test": "node --test"
15
+ },
16
+ "engines": {
17
+ "node": ">=18.3"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/nandhu-44/Git-Time-Machine.git"
22
+ },
23
+ "keywords": [
24
+ "git",
25
+ "git-tm",
26
+ "git-time-machine",
27
+ "git-history",
28
+ "commit-graph",
29
+ "diff",
30
+ "blame",
31
+ "cli",
32
+ "visualization"
33
+ ],
34
+ "author": "nandhu-44",
35
+ "license": "MIT",
36
+ "bugs": {
37
+ "url": "https://github.com/nandhu-44/Git-Time-Machine/issues"
38
+ },
39
+ "homepage": "https://github.com/nandhu-44/Git-Time-Machine#readme"
40
+ }