-
-
Notifications
You must be signed in to change notification settings - Fork 43
Detach process #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detach process #243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a detach feature so that git webdiff can return control to the terminal while the diff server continues running. It introduces environment-variable–driven parent/child detection, shallow copies of diff directories to work around git difftool cleanup, and updates documentation accordingly.
- Detect subprocess via
WEBDIFF_*env vars and re-invoke in detached mode - Copy directories (with optional symlink resolution) before detaching
- Update CLI parsing, core logic, and README to support detachment
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| webdiff/toy.py | Prototype for subprocess detachment |
| webdiff/gitwebdiff.py | Export WEBDIFF_FROM_GIT_DIFFTOOL before calling difftool |
| webdiff/github_fetcher.py | Reordered imports and added raw string to ssh_push_re |
| webdiff/dirdiff.py | Added follow_symlinks flag and propagated to copies |
| webdiff/argparser.py | Single-line imports, load dirs from env in detached mode |
| webdiff/app.py | Spawn detached child, log once, shallow copy before detach |
| README.md | Updated install command and documented detach behavior |
Comments suppressed due to low confidence (1)
webdiff/app.py:351
- The new detach and shallow-copy logic under this branch isn’t covered by existing tests; add unit tests to verify that directories are copied and the subprocess is spawned correctly.
if os.environ.get('WEBDIFF_FROM_GIT_DIFFTOOL'):
Co-authored-by: Copilot <[email protected]>
Fixes #89
This has been a long-standing pet peeve of mine. If you have a few
git webdifftabs live, you lose most of your terminals! Thanks to #223, webdiff reliably terminates when you close the tab. This means it's safe to detach.There are two complications here:
git difftoolcleans up after itself when the parent process terminates (makes sense!). This means that the child process tries to diff non-existent directories. To make that work, we have to make a copy of the directories before detaching. Fortunately, this can be a shallow copy. We don't need to resolve symlinks.This seems to work great, but I'll have to try it out locally for a bit to feel confident.