Repository navigation
Updater: leave untracked files alone; stop only for ones in the way (mirrors NDI-matlab#1039) - #338
Merged
Merged
Conversation
Mirrors VH-Lab/NDI-matlab a24f19076. ndi.update.check counted every untracked file as a modification, so install asked "Update anyway?" (default No) or, with Confirm=False, refused -- although git stash and git pull never touch untracked files. Untracked files no longer count. An untracked file at a path the update adds a file to is the one case that matters (git refuses to overwrite it and the pull stops part-way): those are reported as BlockingFiles, replacing NewFiles, install stops before starting with ndi:update:install:untrackedFilesInTheWay naming them, and the Update button's dialog says to move them. Bridge entries for check, install, modificationSummary and ndiPane re-synced to a24f19076. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Ni686VRCwcmMfvCVcLypp
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.
Summary
Mirrors VH-Lab/NDI-matlab#1039, a follow-up to #337.
ndi.update.checkcounted every untracked file in a clone as one of the user's "modifications". Sondi.update.install,ndi updateand the Update button asked "Update anyway?", with No as the default, just because someone had their own scripts in the clone. WithConfirm=Falseit refused outright. Yetgit stashandgit pullnever touch untracked files.Untracked files no longer count as modifications. Only changed tracked files and local commits still need the user's OK.
There is one case where an untracked file does matter. If the update adds a file at the same path, git refuses to overwrite the untracked file, and the pull stops partway. For that case:
check: finds these files by comparinggit status --porcelain --untracked-files=allwithgit diff --name-only --diff-filter=A HEAD <upstream>, for NDI-python and for the~/.ndi/toolsclones. They are reported asModifications[*]["BlockingFiles"], which replacesNewFiles.install: raisesUpdateError("ndi:update:install:untrackedFilesInTheWay")before touching anything, and names the files. This happens even withAllowModified=True.update_dialogreturns a warning alert listing those files, instead of offering an update that would fail.modificationSummary: lists them as "in the way" and says what happens to each kind of file.Bridge contract: the
check,install,modificationSummaryandndiPaneentries are re-synced to NDI-matlaba24f19076, with decision-log notes.Merge order
Merge VH-Lab/NDI-matlab#1039 first.
a24f19076is on that PR's branch, which CI checks this branch against because it has the same name. Once #1039 is merged with a merge commit, the hash is on NDI-matlabmain. If it is squash-merged, the four hashes need re-recording.Testing
Run locally with NDI-matlab checked out at
a24f19076:black --checkandruff checkare clean.pytest tests/ --ignore=tests/symmetry: 6102 passed, 609 skipped. This includes the bridge checks run in strict mode.test_untracked_files_need_no_consent: untracked files, including one in an untracked folder, set no modifications, and the update goes ahead.test_untracked_file_in_the_way_stops_the_update: covers a top-level file and one in an untracked folder. Both are reported,installrefuses with or withoutAllowModified, and the file is left as it was.test_dialog_with_untracked_files_in_the_way_only_explains: checks the dialog's warning for that case.BlockingFilesand the new summary wording.Generated by Claude Code