Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions UPSTREAM.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Fork ledger

What this fork changes relative to [nilbuild/diffity](https://github.com/nilbuild/diffity), so any
of it can be extracted as a pointed upstream pull request later.
What this fork changes relative to [nilbuild/diffity](https://github.com/nilbuild/diffity).

**This is no longer aimed at upstream.** Decided 2026-08-28: upstream has pull requests sitting
uncommented since May, and this fork has diverged past the point where a pointed patch would still
apply — the review loop, the live agent protocol, session carry-forward and the idle lifecycle are
all ours. The record below stays because it explains where the code came from and why the
arrangement is what it is, not because anything is queued to be offered.

What that changes in practice: keeping a thing because it might be upstreamable is no longer a
reason. Judge it on whether this fork uses it.

## How this fork is arranged

Expand All @@ -21,8 +29,8 @@ of it can be extracted as a pointed upstream pull request later.
Everything up to and including PR #24 was merged with merge commits, before this arrangement — that
part of the history is mixed, and those branches still exist.

Nothing here is NaturalCycles-specific — all of it is upstreamable as-is. When that changes,
fork-local work goes in its own section below so it never lands in an upstream patch by accident.
The `Fork-local` section below predates the decision above; with upstream retired the distinction
it drew no longer does any work.

## Upstream pull requests merged in

Expand All @@ -42,7 +50,7 @@ Merged unmodified, so they can simply be dropped once upstream lands them.
same `--no-ext-diff` more broadly, and the two call sites #21 additionally covered are handled in
our own change on #3.

## Ours, offerable upstream
## Ours (was: offerable upstream)

| Fork PR | Branch | Base | What | Notes for upstreaming |
| --- | --- | --- | --- | --- |
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "diffity",
"version": "0.9.17",
"version": "0.9.18",
"description": "GitHub-style git diff viewer in the browser",
"type": "module",
"bin": {
Expand Down
42 changes: 0 additions & 42 deletions packages/cli/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import {
getUntrackedDiff,
getRepoInfo,
getFileContent,
getStagedFiles,
getUnstagedFiles,
getRecentCommits,
getFileLineCount,
resolveBaseRef,
resolveDiffArgs,
Expand Down Expand Up @@ -564,46 +561,7 @@ export function startServer(options: ServerOptions): Promise<ServerResult> {
return;
}

if (pathname === '/api/overview') {
try {
const staged = getStagedFiles();
const unstaged = getUnstagedFiles();
const untracked = getUntrackedFiles();

const fileMap = new Map<string, string>();
for (const f of staged) {
fileMap.set(f, 'staged');
}
for (const f of unstaged) {
fileMap.set(f, 'modified');
}
for (const f of untracked) {
fileMap.set(f, 'added');
}

const files = Array.from(fileMap.entries()).map(
([path, status]) => ({ path, status }),
);

sendJson(res, { files });
} catch (err) {
sendError(res, 500, `Failed to get overview: ${err}`);
}
return;
}

if (pathname === '/api/commits') {
const count = parseInt(url.searchParams.get('count') || '10', 10);
const skip = parseInt(url.searchParams.get('skip') || '0', 10);
const search = url.searchParams.get('search') || undefined;
try {
const commits = getRecentCommits({ count, skip, search });
sendJson(res, { commits, hasMore: commits.length === count });
} catch (err) {
sendError(res, 500, `Failed to get commits: ${err}`);
}
return;
}

if (pathname === '/api/diff-fingerprint') {
const ref = url.searchParams.get('ref');
Expand Down
2 changes: 1 addition & 1 deletion packages/git/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@diffity/git",
"version": "0.9.17",
"version": "0.9.18",
"private": true,
"type": "module",
"main": "./dist/index.js",
Expand Down
7 changes: 0 additions & 7 deletions packages/git/src/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,3 @@ export function gitLines(args: string[]): string[] {
return output.split('\n');
}

export function execLines(cmd: string): string[] {
const output = exec(cmd);
if (!output) {
return [];
}
return output.split('\n');
}
2 changes: 1 addition & 1 deletion packages/git/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type { RefCapabilities } from './repo.js';
export { isGitRepo, getRepoRoot, getRepoName, getCurrentBranch, getRepoInfo, getHeadHash, getDiffityDir, getDiffityDirPath, isDataDirUntracked, getRefCapabilities, isValidGitRef } from './repo.js';
export { getDiff, getDiffFiles, getDiffStat, getDiffStatForRef, getRenameStatus, getUntrackedFiles, getUntrackedDiff, getFileContent, getFileLineCount, getMergeBase, normalizeRef, resolveBaseRef, resolveThroughUpstream, resolveDiffArgs, resolveRef, revertFile, revertHunk, WORKING_TREE_REFS } from './diff.js';
export type { RefDiffArgs } from './diff.js';
export { getStagedFiles, getUnstagedFiles, isDirty } from './status.js';
export { isDirty } from './status.js';
export { getRecentCommits } from './commits.js';
export { readRepoConfig, resolveDataDir, REPO_CONFIG_FILE, DEFAULT_SEVERITIES } from './config.js';
export type { RepoConfig, ReviewConfig } from './config.js';
Expand Down
10 changes: 1 addition & 9 deletions packages/git/src/status.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import { exec, execLines } from './exec.js';

export function getStagedFiles(): string[] {
return execLines('git diff --staged --name-only');
}

export function getUnstagedFiles(): string[] {
return execLines('git diff --name-only');
}
import { exec } from './exec.js';

export function isDirty(): boolean {
return exec('git status --porcelain').length > 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@diffity/github",
"version": "0.9.17",
"version": "0.9.18",
"private": true,
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@diffity/parser",
"version": "0.9.17",
"version": "0.9.18",
"private": true,
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@diffity/ui",
"version": "0.9.17",
"version": "0.9.18",
"type": "module",
"private": true,
"scripts": {
Expand Down
100 changes: 0 additions & 100 deletions packages/ui/src/components/layout/commit-list.tsx

This file was deleted.

Loading