@gitkraken/core-gitlens 0.38.4 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.39.0] - 2026-11-16
10
+
11
+ ### Added
12
+
13
+ - Adds `GitOptions.getQuietNetworkEnvironment`, a host hook for the ssh askpass of the network reads core runs without a person present (`branches.getDefaultBranchName`, `branches.setRemoteHeadIfMissing`, `remotes.probeRemote`). They blanked `SSH_ASKPASS` per call, so behind a `ProxyJump` host that asks for a password or a code the hop's ssh sent an empty answer to each prompt, each a failed sign-in. When the hook returns an environment, core drops its own `SSH_ASKPASS*` defaults for those reads and uses the host's (`{}` means the inherited askpass); the other quiet keys stay. Without it nothing changes (git-cli)
14
+
9
15
  ## [0.38.4] - 2026-11-15
10
16
 
11
17
  ### Added
@@ -1327,7 +1333,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1327
1333
 
1328
1334
  - Initial release. Bundles `@gitlens/utils`, `@gitlens/git`, `@gitlens/git-cli`, `@gitlens/ai`, and `@gitlens/git-github` into a single core npm package with subpath exports.
1329
1335
 
1330
- [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.38.4...HEAD
1336
+ [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.39.0...HEAD
1337
+ [0.39.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.38.4...gitkraken:releases/core/v0.39.0
1331
1338
  [0.38.4]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.38.3...gitkraken:releases/core/v0.38.4
1332
1339
  [0.38.3]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.38.2...gitkraken:releases/core/v0.38.3
1333
1340
  [0.38.2]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.38.1...gitkraken:releases/core/v0.38.2
@@ -196,6 +196,19 @@ export interface GitOptions {
196
196
  env?: Record<string, string | undefined>;
197
197
  /** Dynamic environment provider called for each command (e.g., host-discovered SCM credentials) */
198
198
  getEnvironment?: () => Record<string, string | undefined> | undefined;
199
+ /**
200
+ * The environment for network commands core runs without a person present (a default-branch lookup,
201
+ * a remote probe, a background `remote set-head`), which is how a host supplies an askpass that ends the asking
202
+ * ssh without answering, so a jump host isn't sent empty answers. When it returns an environment, the host owns
203
+ * the ssh askpass of those commands: core drops its own `SSH_ASKPASS*` defaults (an empty `SSH_ASKPASS`, plus
204
+ * `SSH_ASKPASS_REQUIRE=never` on the default-branch reads), so an `SSH_ASKPASS*` key the host leaves out comes
205
+ * from the inherited environment and `{}` means "use the inherited askpass".
206
+ * A key set to `undefined` leaves that variable unset; a key core doesn't set (`DISPLAY`, a helper's own
207
+ * variables) is added. `GIT_TERMINAL_PROMPT=0`, `GIT_ASKPASS=''` and `GCM_INTERACTIVE` keep core's values
208
+ * whatever it returns, as does `credential.interactive=false` on the default-branch reads (the probe sets none).
209
+ * Called per command; return the same object while nothing changes. Without it, core's defaults apply unchanged.
210
+ */
211
+ getQuietNetworkEnvironment?: () => Record<string, string | undefined> | undefined;
199
212
  /** Git command timeout in milliseconds, for runs that don't set their own. Defaults to {@link defaultGitTimeout}. Set to 0 to disable. */
200
213
  gitTimeout?: number;
201
214
  /**
@@ -300,6 +313,8 @@ export declare class Git {
300
313
  private _fullEnv;
301
314
  /** Last dynamic env reference, used to detect when getEnvironment() returns a new object */
302
315
  private _lastDynamicEnv;
316
+ /** Merged quiet-network environments, by the defaults they extend, rebuilt only when the host returns a new reference */
317
+ private readonly _quietNetworkEnvs;
303
318
  /** Bound via {@link bindChangeNotifier}; announces a `notify`-flagged run's changes. No-op until bound. */
304
319
  private _changeNotifier;
305
320
  /** Bound via {@link bindHeadReader}; reads HEAD around a `notify: 'infer'` run that moves only HEAD's branch */
@@ -348,6 +363,12 @@ export declare class Git {
348
363
  * when getEnvironment() returns a different object reference.
349
364
  */
350
365
  private getFullEnv;
366
+ /**
367
+ * Returns `defaults` with its `SSH_ASKPASS*` keys replaced by the host's quiet-network environment. Every other
368
+ * default key is pinned. Returns `defaults` itself without a host environment, and the same merged object while
369
+ * the host returns the same reference.
370
+ */
371
+ quietNetworkEnv(defaults: Record<string, string>): Record<string, string | undefined>;
351
372
  /** The environment git runs with, before a run's own `env` */
352
373
  getRunEnvironment(): Readonly<Record<string, string | undefined>>;
353
374
  /**
@@ -523,6 +523,8 @@ var Git = class {
523
523
  _fullEnv;
524
524
  /** Last dynamic env reference, used to detect when getEnvironment() returns a new object */
525
525
  _lastDynamicEnv;
526
+ /** Merged quiet-network environments, by the defaults they extend, rebuilt only when the host returns a new reference */
527
+ _quietNetworkEnvs = /* @__PURE__ */ new WeakMap();
526
528
  /** Bound via {@link bindChangeNotifier}; announces a `notify`-flagged run's changes. No-op until bound. */
527
529
  _changeNotifier;
528
530
  /** Bound via {@link bindHeadReader}; reads HEAD around a `notify: 'infer'` run that moves only HEAD's branch */
@@ -598,6 +600,25 @@ var Git = class {
598
600
  } : this.getBaseEnv();
599
601
  return this._fullEnv;
600
602
  }
603
+ /**
604
+ * Returns `defaults` with its `SSH_ASKPASS*` keys replaced by the host's quiet-network environment. Every other
605
+ * default key is pinned. Returns `defaults` itself without a host environment, and the same merged object while
606
+ * the host returns the same reference.
607
+ */
608
+ quietNetworkEnv(defaults) {
609
+ const hostEnv = this.options.getQuietNetworkEnvironment?.() ?? void 0;
610
+ if (hostEnv == null) return defaults;
611
+ let cached = this._quietNetworkEnvs.get(defaults);
612
+ if (cached?.hostEnv === hostEnv) return cached.merged;
613
+ const merged = { ...hostEnv };
614
+ for (const [key, value] of Object.entries(defaults)) if (!key.startsWith("SSH_ASKPASS")) merged[key] = value;
615
+ cached = {
616
+ hostEnv,
617
+ merged
618
+ };
619
+ this._quietNetworkEnvs.set(defaults, cached);
620
+ return merged;
621
+ }
601
622
  /** The environment git runs with, before a run's own `env` */
602
623
  getRunEnvironment() {
603
624
  return this.getFullEnv();