Skip to content

Add staged file tracking and selective commit support#1429

Open
adboio wants to merge 1 commit intoposthog-code/distinguish-staged-and-unstaged-file-changesfrom
posthog-code/improve-code-review-workflow-and-diff-viewer
Open

Add staged file tracking and selective commit support#1429
adboio wants to merge 1 commit intoposthog-code/distinguish-staged-and-unstaged-file-changesfrom
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
Copy link
Copy Markdown
Contributor Author

adboio commented Apr 1, 2026

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.

1 participant