Skip to content

Commit 988c8a8

Browse files
fieldingclaude
andcommitted
Update README with branch, show rev:path, and NIT_COLORS docs
- Add branch and show rev:path to usage examples - Add Color Customization section documenting NIT_COLORS env var - Update project structure with branch.zig and color.zig description - Remove completed roadmap items (branch, show rev:path) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c4be919 commit 988c8a8

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,15 @@ nit diff # 1-line context, stripped file headers
7272
nit diff -s # staged changes
7373
nit show # HEAD commit + patch
7474
nit show abc123 # specific commit
75+
nit show HEAD:path # file content at revision
76+
nit show --stat # compact file change summary
77+
nit branch # list local branches
7578

7679
nit status -H # grouped by staged/unstaged/untracked, colored
7780
nit log -H # includes dates, colored hashes
7881
nit diff -H # 3-line context, stat summary, colored output
7982

8083
nit log -n 5 # limit to 5 commits
81-
nit show --stat # compact file change summary
8284
```
8385

8486
### Passthrough
@@ -146,20 +148,35 @@ src/
146148
main.zig entry point
147149
cli.zig arg parsing, dispatch, git passthrough
148150
git.zig libgit2 wrapper (@cImport, repo, error handling)
149-
color.zig ANSI escape codes + TTY detection
151+
color.zig ANSI colors + NIT_COLORS env var support
150152
fmt.zig shared diff callbacks, stat output, date formatting
151153
cmd/
152154
status.zig compact + human output
153155
log.zig oneline + human with dates
154156
diff.zig stripped headers + colored human mode
155-
show.zig commit info + patch + --stat
157+
show.zig commit info + patch + --stat + rev:path blob
158+
branch.zig branch listing
159+
```
160+
161+
## Color Customization
162+
163+
nit uses standard ANSI colors by default, so it respects your terminal theme. To override specific colors, set the `NIT_COLORS` environment variable:
164+
165+
```sh
166+
export NIT_COLORS="add=32:del=31:hunk=36:staged=32:unstaged=31:hash=33:date=2:context=2"
167+
```
168+
169+
Values are ANSI SGR parameters. True-color is supported:
170+
171+
```sh
172+
export NIT_COLORS="staged=38;2;4;179;114:unstaged=38;2;231;52;156"
156173
```
157174

175+
Available slots: `add`, `del`, `hunk`, `context`, `staged`, `unstaged`, `hash`, `date`.
176+
158177
## Roadmap
159178

160-
- [ ] `branch` command (compact listing)
161179
- [ ] `stash` command
162-
- [ ] `show <rev>:<path>` native implementation (36% of show usage)
163180
- [ ] Benchmark against larger repos (linux kernel, chromium)
164181

165182
## License

0 commit comments

Comments
 (0)