Skip to content

fix(desktop): remove invalid -M flag from git status command#997

Merged
Kitenite merged 1 commit into
superset-sh:mainfrom
Ipriyankrajai:fix/desktop-git-status-invalid-flag
Jan 28, 2026
Merged

fix(desktop): remove invalid -M flag from git status command#997
Kitenite merged 1 commit into
superset-sh:mainfrom
Ipriyankrajai:fix/desktop-git-status-invalid-flag

Conversation

@Ipriyankrajai
Copy link
Copy Markdown
Contributor

@Ipriyankrajai Ipriyankrajai commented Jan 27, 2026

Summary

  • Remove invalid -M flag from the git status command in getStatusNoLock()
  • Update comments to clarify that porcelain=v1 already includes rename detection

Problem

When trying to remove a workspace, users saw:

Failed to check worktree status: Failed to get git status: Command failed:
git --no-optional-locks -C /path status --porcelain=v1 -b -z -M -uall
error: unknown switch `M'

Root Cause

The -M flag is a git diff option for rename detection, not a git status option. The comment incorrectly stated it was needed for rename detection, but git status --porcelain=v1 already includes rename information through R (rename) and C (copy) status codes.

Test plan

  • Open the desktop app
  • Open a workspace in the sidebar
  • Click the close/remove option
  • Confirm no error appears and the removal dialog works correctly
  • Test both "Hide" and "Delete" options work

Summary by CodeRabbit

  • Chores
    • Optimized git status command handling for improved efficiency without affecting functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

The -M flag is a git diff option for rename detection, not a git status
option. This was causing "error: unknown switch 'M'" when trying to
remove workspaces.

git status --porcelain=v1 already includes rename information through
R (rename) and C (copy) status codes, so the flag was unnecessary.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

The -M flag was removed from a git status command invocation in the desktop workspace utilities. The porcelain v1 format already provides rename detection via status codes, making the explicit flag redundant. The parsing logic and behavior remain unchanged.

Changes

Cohort / File(s) Summary
Git Status Configuration
apps/desktop/src/lib/trpc/routers/workspaces/utils/git.ts
Removed -M flag from git status invocation; updated accompanying comment to reflect that porcelain v1 format inherently provides rename detection without explicit flag

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Poem

🐰 A flag disappears into the misty git,
No need for -M when v1's already it,
The rename detection stays right here,
Cleaner code brings rabbit cheer!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: removing an invalid -M flag from git status command.
Description check ✅ Passed The description provides comprehensive detail including summary, problem, root cause, and test plan, though it lacks explicit type-of-change marking.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Ipriyankrajai
Copy link
Copy Markdown
Contributor Author

Ipriyankrajai commented Jan 27, 2026

@saddlepaddle @AviPeltz Can you review this?

When i try to remove the workspace im getting this error.
So created this PR
image

@Kitenite
Copy link
Copy Markdown
Collaborator

This works thank you @Ipriyankrajai !

@Kitenite Kitenite merged commit 9294470 into superset-sh:main Jan 28, 2026
5 checks passed
@Ipriyankrajai
Copy link
Copy Markdown
Contributor Author

@Kitenite When are we planning to release this?

Because this is causing files on right sidebar to fail

Before

image image

After

image

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