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 +21 -21
- package/README.md +176 -89
- package/package.json +40 -45
- package/src/cli.js +147 -235
- package/src/git.js +690 -213
- package/src/public/app.css +2628 -0
- package/src/public/index.html +78 -88
- package/src/public/js/compare.js +426 -0
- package/src/public/js/detail.js +269 -0
- package/src/public/js/diff.js +328 -0
- package/src/public/js/graph.js +110 -0
- package/src/public/js/history.js +386 -0
- package/src/public/js/insights.js +150 -0
- package/src/public/js/main.js +409 -0
- package/src/public/js/theme.js +5 -0
- package/src/public/js/ui.js +226 -0
- package/src/public/logo.svg +1 -0
- package/src/server.js +207 -103
- package/src/public/app.js +0 -960
- package/src/public/fonts/InterVariable.woff2 +0 -0
- package/src/public/images/logo.png +0 -0
- package/src/public/images/logo.svg +0 -9
- package/src/public/styles.css +0 -1259
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/
|
|
3
|
-
|
|
4
|
-
<h1>Git Time Machine</h1>
|
|
5
|
-
|
|
6
|
-
<br
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
+

|
|
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
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"bin": {
|
|
7
|
-
"git-tm": "src/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
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
|
+
}
|