Skip to content

Updater: leave untracked files alone; stop only for ones in the way (mirrors NDI-matlab#1039) - #338

Merged
stevevanhooser merged 1 commit into
mainfrom
claude/amazing-clarke-a34o5c
Oct 21, 2026
Merged

stevevanhooser merged 1 commit into
mainfrom
claude/amazing-clarke-a34o5c

Conversation

@stevevanhooser

Copy link
Copy Markdown
Contributor

Summary

Mirrors VH-Lab/NDI-matlab#1039, a follow-up to #337. ndi.update.check counted every untracked file in a clone as one of the user's "modifications". So ndi.update.install, ndi update and the Update button asked "Update anyway?", with No as the default, just because someone had their own scripts in the clone. With Confirm=False it refused outright. Yet git stash and git pull never 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 comparing git status --porcelain --untracked-files=all with git diff --name-only --diff-filter=A HEAD <upstream>, for NDI-python and for the ~/.ndi/tools clones. They are reported as Modifications[*]["BlockingFiles"], which replaces NewFiles.
  • install: raises UpdateError("ndi:update:install:untrackedFilesInTheWay") before touching anything, and names the files. This happens even with AllowModified=True.
  • Update button: update_dialog returns 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, modificationSummary and ndiPane entries are re-synced to NDI-matlab a24f19076, with decision-log notes.

Merge order

Merge VH-Lab/NDI-matlab#1039 first. a24f19076 is 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-matlab main. If it is squash-merged, the four hashes need re-recording.

Testing

Run locally with NDI-matlab checked out at a24f19076:

  • black --check and ruff check are clean.
  • pytest tests/ --ignore=tests/symmetry: 6102 passed, 609 skipped. This includes the bridge checks run in strict mode.
  • New tests:
    • 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, install refuses with or without AllowModified, 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.
  • Existing tests were updated for BlockingFiles and the new summary wording.

Generated by Claude Code

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
@stevevanhooser
stevevanhooser merged commit 06af244 into main Oct 21, 2026
15 checks passed
@stevevanhooser
stevevanhooser deleted the claude/amazing-clarke-a34o5c branch October 21, 2026 19:22
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.

2 participants