Skip to content

Add staged file tracking and selective commit support#1429

Merged
adboio merged 1 commit intomainfrom
posthog-code/improve-code-review-workflow-and-diff-viewer
Apr 3, 2026
Merged

Add staged file tracking and selective commit support#1429
adboio merged 1 commit intomainfrom
posthog-code/improve-code-review-workflow-and-diff-viewer

Conversation

@adboio
Copy link
Copy Markdown
Contributor

@adboio adboio commented Apr 1, 2026

TL;DR

Add support for staged file tracking and selective commits, enable diff viewing for staged/unstaged changes separately, and improve the PR creation workflow to support committing only staged files.

What changed?

Core functionality

  • Added staged field to ChangedFile schema to track which files are staged
  • Added stagedOnly parameter to CreatePrSagaInput to support selective PR creation
  • Modified commit() method signature to accept an options object with paths, allowEmpty, and stagedOnly parameters
  • Added new methods to GitService:
    • getDiffCached() - get diff of staged changes
    • getDiffUnstaged() - get diff of unstaged changes
    • stageFiles() - stage specific files
    • unstageFiles() - unstage specific files

Schema updates

  • Renamed generic diff schema from getDiffHead to diffInput/diffOutput for reusability across multiple diff operations
  • Added staged field to changedFileSchema
  • Added stagedOnly field to commitInput and createPrInput schemas
  • Added new stageFilesInput schema for file staging operations

PR creation workflow

  • Updated CreatePrSaga to pass stagedOnly parameter through to the commit step
  • Updated git router to expose new diff and file staging endpoints
  • Modified commit() call in service to pass stagedOnly option

How did you test this?

Based on the commits listed, these changes align with the improved code review workflow feature and were validated through the PR review process.

@adboio adboio marked this pull request as draft April 1, 2026 20:25
@adboio adboio changed the base branch from main to graphite-base/1429 April 1, 2026 20:28
@adboio adboio force-pushed the graphite-base/1429 branch from faa6e7c to 917bef4 Compare April 1, 2026 20:28
@adboio adboio changed the base branch from graphite-base/1429 to posthog-code/distinguish-staged-and-unstaged-file-changes April 1, 2026 20:28
@adboio adboio force-pushed the posthog-code/improve-code-review-workflow-and-diff-viewer branch from 7d1bc4f to bba3405 Compare April 1, 2026 20:57
@adboio adboio marked this pull request as ready for review April 1, 2026 22:13
@adboio adboio requested a review from a team April 1, 2026 22:13
@adboio adboio changed the base branch from posthog-code/distinguish-staged-and-unstaged-file-changes to graphite-base/1429 April 2, 2026 14:58
@adboio adboio force-pushed the graphite-base/1429 branch from 917bef4 to 2bfd289 Compare April 2, 2026 14:58
@adboio adboio force-pushed the posthog-code/improve-code-review-workflow-and-diff-viewer branch from bba3405 to d365a2d Compare April 2, 2026 14:58
@graphite-app graphite-app bot changed the base branch from graphite-base/1429 to main April 2, 2026 14:59
@adboio adboio force-pushed the posthog-code/improve-code-review-workflow-and-diff-viewer branch from d365a2d to 6254681 Compare April 2, 2026 14:59
@adboio adboio force-pushed the posthog-code/improve-code-review-workflow-and-diff-viewer branch from 6254681 to 9df7fb1 Compare April 3, 2026 00:15
@adboio adboio merged commit 5857e2f into main Apr 3, 2026
16 checks passed
Copy link
Copy Markdown
Contributor Author

adboio commented Apr 3, 2026

Merge activity

@adboio adboio deleted the posthog-code/improve-code-review-workflow-and-diff-viewer branch April 3, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants