[WIP] Add interactive patch application command for selective patching#11
Merged
Merged
Conversation
Co-authored-by: hahwul <13212227+hahwul@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds interactive, hunk-by-hunk selection for applying Jules gitPatch artifacts, enabling cjules patch <id> -i/--interactive behavior similar to git add -p.
Changes:
- Introduces a minimal unified-diff splitter and an interactive hunk selector (
Cjules::Unidiff::Interactive). - Extends
cjules patchwith-i/--interactive, integrating selection before runninggit apply. - Adds specs for chunk splitting and basic interactive decisions; updates CLI/docs/help text.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cjules/unidiff.cr | New unidiff chunking + interactive selection/editing implementation. |
| src/cjules/commands/patch.cr | Adds --interactive/-i option and applies selected hunks via git apply. |
| src/cjules/commands/completion.cr | Updates completion descriptions to mention -i. |
| src/cjules/cli.cr | Updates CLI usage text for patch to mention interactive application. |
| spec/unidiff_spec.cr | Adds specs for chunk splitting and interactive selection flows. |
| skills/cjules/SKILL.md | Documents patch --interactive usage and TTY requirement. |
| README.md | Documents interactive patch usage in feature list and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ractive (#12) * Initial plan * Fix shell injection in run_editor and add STDERR TTY check for --interactive - Avoid shell invocation in run_editor by parsing editor into argv and passing path as a separate argument, eliminating quoting/injection risks. - Add STDERR.tty? check alongside STDIN/STDOUT in --interactive mode so the command won't appear to hang when STDERR is redirected. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.