Skip to content

[WIP] Add interactive patch application command for selective patching#11

Merged
hahwul merged 3 commits into
mainfrom
codex/feature-interactive-patch-application
May 27, 2026
Merged

[WIP] Add interactive patch application command for selective patching#11
hahwul merged 3 commits into
mainfrom
codex/feature-interactive-patch-application

Conversation

@Codex

@Codex Codex AI commented May 25, 2026

Copy link
Copy Markdown

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.


This section details on the original issue you should resolve

<issue_title>[Feature] Interactive patch application (cjules patch --interactive)</issue_title>
<issue_description>Sometimes users don't want to apply the entire patch generated by Jules. Similar to git add -p, an interactive patch utility would let users selectively review and apply patch chunks (hunks).

Proposed Command:

cjules patch <id> --interactive # or -i

Behavior:

  • Loop through the generated diff chunks.
  • Prompt user: Apply this hunk? [y,n,q,a,d,e,?] for each chunk.</issue_description>

<agent_instructions>/goal 이 기능의 프로덕션 레벨의 구현</agent_instructions>

Comments on the Issue (you are @codex[agent] in this section)

Co-authored-by: hahwul <13212227+hahwul@users.noreply.github.com>
@Codex Codex AI requested a review from hahwul May 25, 2026 15:44
@hahwul hahwul marked this pull request as ready for review May 27, 2026 12:07
@hahwul hahwul requested a review from Copilot May 27, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 patch with -i/--interactive, integrating selection before running git 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.

Comment thread src/cjules/unidiff.cr Outdated
Comment thread src/cjules/commands/patch.cr Outdated
…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>
@hahwul hahwul merged commit f39193a into main May 27, 2026
8 checks passed
@hahwul hahwul deleted the codex/feature-interactive-patch-application branch June 6, 2026 03:21
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.

[Feature] Interactive patch application (cjules patch --interactive)

4 participants