gitSettings.ts
utils/gitSettings.ts
No strong subsystem tag
19
Lines
838
Bytes
1
Exports
2
Imports
10
Keywords
What this is
This page documents one file from the repository and includes its full source so you can read it without leaving the docs site.
Beginner explanation
This file is one piece of the larger system. Its name, directory, imports, and exports show where it fits. Start by reading the exports and related files first.
How it is used
Start from the exports list and related files. Those are the easiest clues for where this file fits into the system.
Expert explanation
Architecturally, this file intersects with general runtime concerns. It contains 19 lines, 2 detected imports, and 1 detected exports.
Important relationships
Detected exports
shouldIncludeGitInstructions
Keywords
settingsenvvalvscodeisenvdefinedfalsyisenvtruthygetinitialsettingsgit-relatedbehaviorsdependuser
Detected imports
./envUtils.js./settings/settings.js
Source notes
This page embeds the full file contents. Small or leaf files are still indexed honestly instead of being over-explained.
Full source
// Git-related behaviors that depend on user settings.
//
// This lives outside git.ts because git.ts is in the vscode extension's
// dep graph and must stay free of settings.ts, which transitively pulls
// @opentelemetry/api + undici (forbidden in vscode). It's also a cycle:
// settings.ts → git/gitignore.ts → git.ts, so git.ts → settings.ts loops.
//
// If you're tempted to add `import settings` to git.ts — don't. Put it here.
import { isEnvDefinedFalsy, isEnvTruthy } from './envUtils.js'
import { getInitialSettings } from './settings/settings.js'
export function shouldIncludeGitInstructions(): boolean {
const envVal = process.env.CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS
if (isEnvTruthy(envVal)) return false
if (isEnvDefinedFalsy(envVal)) return true
return getInitialSettings().includeGitInstructions ?? true
}