Skip to content

nix develop: Restore hiding the "dirty" notice#485

Merged
edolstra merged 1 commit into
mainfrom
hide-dirty
Jun 5, 2026
Merged

nix develop: Restore hiding the "dirty" notice#485
edolstra merged 1 commit into
mainfrom
hide-dirty

Conversation

@edolstra

@edolstra edolstra commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Restores #33. This was accidentally lost in
823b119.

As a slight improvement over #33, put this in Common so nix print-dev-env is affected as well.

Context

Summary by CodeRabbit

  • Bug Fixes
    • Suppressed dirty-fetch warnings during command execution.

Restores #33. This was accidentally lost in
823b119.

As a slight improvement over #33, put this in `Common` so `nix
print-dev-env` is affected as well.
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a preRun override to the Common command base in src/nix/develop.cc that disables dirty-fetch warnings by setting fetchSettings.warnDirty = false before command execution.

Changes

Dirty-fetch warning override

Layer / File(s) Summary
Disable dirty-fetch warnings in preRun
src/nix/develop.cc
A preRun(ref<Store>) override on struct Common sets fetchSettings.warnDirty = false to suppress warnings before command execution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A warning suppressed, a flag set low,
The develop command flows through, nice and slow,
No dirty-fetch grumbles to clutter the way,
One gentle override brightens the day! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: restoring the hiding of the dirty notice in nix develop, which aligns with the code change that disables dirty-fetch warnings.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hide-dirty

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
src/nix/develop.cc

src/nix/develop.cc:1:10: fatal error: 'nix/util/config-global.hh' file not found
1 | #include "nix/util/config-global.hh"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
src/nix/develop.cc:97:9-29: ERROR translating statement 'ReturnStmt'
Aborting translation of method 'BuildEnvironment::parseJSON' in file 'src/nix/develop.cc': "Assert_failure src/clang/cAst_utils.ml:249:53"
Uncaught Internal Error: "Assert_failure src/clang/cAst_utils.ml:249:53"
Error backtrace:
Raised at ClangFrontend__CAst_utils.get_decl_from_typ_ptr in file "src/clang/cAst_utils.ml", line 249, characters 53-65
Called from ClangFrontend__CTrans.CTrans_funct.get_destructor_decl_ref in file "src/clang/cTrans.ml", line 658, characters 12-59
Called from ClangFrontend__CTrans.CTrans_funct.destructor_calls.(fun) in file "src/clang/cTrans.ml", line 2048, characters 12-69
Called from Base__List.rev_filter_map.loop in file "src/list.ml", line 944, characters 13-17
Called from Base__List.filter_map in file

... [truncated 2200 characters] ...

l", line 4784, characters 10-1023
Called from ClangFrontend__CTrans.CTrans_funct.instruction in file "src/clang/cTrans.ml" (inlined), line 4765, characters 38-71
Called from ClangFrontend__CTrans.CTrans_funct.exec_with_node_creation in file "src/clang/cTrans.ml" (inlined), line 104, characters 20-38
Called from ClangFrontend__CTrans.CTrans_funct.get_clang_stmt_trans in file "src/clang/cTrans.ml" (inlined), line 5395, characters 4-69
Called from ClangFrontend__CTrans.CTrans_funct.get_custom_stmt_trans in file "src/clang/cTrans.ml", line 5401, characters 8-55
Called from ClangFrontend__CTrans.CTrans_funct.exec_trans_instrs.exec_trans_instrs_rev in file "src/clang/cTrans.ml" (inlined), line 5365, characters 28-54
Called from ClangFrontend__CTrans.CTrans_funct.exec_trans_instrs in file "src/cl


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

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request June 5, 2026 10:17 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/nix/develop.cc (1)

499-502: ⚡ Quick win

Consider adding a comment explaining the suppression.

While the PR description makes the intent clear, a brief comment would help future maintainers understand why dirty warnings are suppressed for development shells.

📝 Suggested documentation
+    // Suppress dirty Git/Mercurial tree warnings in development shells
+    // since developers typically work with uncommitted changes.
     void preRun(ref<Store> store) override
     {
         fetchSettings.warnDirty = false;
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/nix/develop.cc` around lines 499 - 502, Add a short clarifying comment
above the assignment in preRun (method preRun in src/nix/develop.cc) explaining
why fetchSettings.warnDirty is set to false (i.e., to suppress dirty-repo
warnings for interactive development shells so normal workflow isn't interrupted
and to avoid spurious warnings during iterative edits). Keep the comment concise
and reference that this behavior is intentional for development shells and not
for normal runs so future maintainers understand the suppression.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/nix/develop.cc`:
- Around line 499-502: Add a short clarifying comment above the assignment in
preRun (method preRun in src/nix/develop.cc) explaining why
fetchSettings.warnDirty is set to false (i.e., to suppress dirty-repo warnings
for interactive development shells so normal workflow isn't interrupted and to
avoid spurious warnings during iterative edits). Keep the comment concise and
reference that this behavior is intentional for development shells and not for
normal runs so future maintainers understand the suppression.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 25be2994-9749-42b3-ac1f-52643cf94332

📥 Commits

Reviewing files that changed from the base of the PR and between 43e551d and 0a82b79.

📒 Files selected for processing (1)
  • src/nix/develop.cc

@edolstra edolstra enabled auto-merge June 5, 2026 10:28
@edolstra edolstra added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit 722f4e1 Jun 5, 2026
29 checks passed
@edolstra edolstra deleted the hide-dirty branch June 5, 2026 14:32
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