Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

apply_patch changes have no Undo

Open
#197 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
desktop, tooling

Research direction

Start with src/main/tools/apply_patch.ts and trace how write_file and edit_file return undo records, then follow the existing edit:undo handling. The proposal calls for backups and post-change hashes per changed file, with a single undo refused if any file has changed since; deleted and moved files also need records. Done means multi-file patches can be undone together while preserving that safety check.

Written by the indexing model from the issue text.

Description

enhancement priority: medium severity: low

Suggestion from the 2026-10-07 code review (not a bug).

write_file and edit_file return an undo record, so their cards offer Undo. apply_patch (src/main/tools/apply_patch.ts) returns none, so a multi-file patch can't be undone from the transcript, even though it is the tool the model is told to use for larger changes.

Proposal

Return one backup per changed file (before bytes plus the hash after the change) and let edit:undo restore them together. Refuse the undo when any file no longer matches, as single-file undo already does. Deleted and moved files need their own records.

Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
5h 52m
Merged PRs (30d)
18

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PierrunoYT/patch

All issues in PierrunoYT/patch

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.