@osdlc/typed-git 0.22.0 → 0.22.1

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
@@ -1,5 +1,11 @@
1
1
  # @osdlc/typed-git
2
2
 
3
+ ## 0.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 3b7fc6b: `statusPorcelain()`, and so `isDirty()`, pass `--untracked-files=normal`, so a `status.showUntrackedFiles=no` in the user's config no longer hides untracked files. A check that found a worktree clean under that setting let `git worktree remove` delete files it never saw.
8
+
3
9
  ## 0.22.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -768,7 +768,7 @@ exit throws the classified failure.
768
768
  | `mainCheckout()` | the parent of `gitCommonDir()` when that is `<checkout>/.git`, else `core.worktree` or the main worktree | `null` outside a repository, or for a bare store |
769
769
  | `symbolicRef(ref)` | `symbolic-ref <ref>` | `128` → `null` |
770
770
  | `currentBranch()` | `branch --show-current` | none — `null` when detached |
771
- | `statusPorcelain({ paths })` | `status --porcelain` | none |
771
+ | `statusPorcelain({ paths })` | `status --porcelain --untracked-files=normal`, so `status.showUntrackedFiles=no` hides nothing | none |
772
772
  | `statusEntries({ ignored })` | `status --porcelain -z --untracked-files=all [--ignored]` | none — `{ x, y, path }` rows; a rename is one row, with the source dropped; `ignored` adds each ignored file as a `!` row |
773
773
  | `isDirty({ paths })` | `statusPorcelain().length > 0` | none |
774
774
  | `hasStagedChanges()` | `diff --cached --quiet` | `1` → `true`, `0` → `false` — on an unborn HEAD the index is compared against the empty tree; outside a repository (`129`) it throws |
package/dist/verbs.d.ts CHANGED
@@ -294,11 +294,17 @@ export interface StatusPorcelainOptions {
294
294
  paths?: string[] | undefined;
295
295
  }
296
296
  /**
297
- * `git status --porcelain` lines; empty array on a clean tree, and a throw
298
- * outside a repository (exit 128).
297
+ * `git status --porcelain --untracked-files=normal` lines; empty array on a
298
+ * clean tree, and a throw outside a repository (exit 128).
299
299
  *
300
300
  * Verbatim: the first two columns are the status, so ` M f.ts` (unstaged
301
301
  * modification) must not be trimmed down to `M f.ts` (staged one).
302
+ *
303
+ * `--untracked-files=normal` overrides a `status.showUntrackedFiles=no` in
304
+ * the user's config, which would hide untracked files from a dirty check
305
+ * while `git worktree remove` still deletes them. An untracked directory is
306
+ * one `?? dir/` line, as git shows it by default; {@link statusEntries}
307
+ * lists each file.
302
308
  */
303
309
  export declare function statusPorcelain(opts?: StatusPorcelainOptions): GitVerb<string[]>;
304
310
  /** One `git status --porcelain -z` record. */
package/dist/verbs.js CHANGED
@@ -436,14 +436,20 @@ export function currentBranch() {
436
436
  return { argv: ['branch', '--show-current'], absent: NONE, parse: trimmedOrNull };
437
437
  }
438
438
  /**
439
- * `git status --porcelain` lines; empty array on a clean tree, and a throw
440
- * outside a repository (exit 128).
439
+ * `git status --porcelain --untracked-files=normal` lines; empty array on a
440
+ * clean tree, and a throw outside a repository (exit 128).
441
441
  *
442
442
  * Verbatim: the first two columns are the status, so ` M f.ts` (unstaged
443
443
  * modification) must not be trimmed down to `M f.ts` (staged one).
444
+ *
445
+ * `--untracked-files=normal` overrides a `status.showUntrackedFiles=no` in
446
+ * the user's config, which would hide untracked files from a dirty check
447
+ * while `git worktree remove` still deletes them. An untracked directory is
448
+ * one `?? dir/` line, as git shows it by default; {@link statusEntries}
449
+ * lists each file.
444
450
  */
445
451
  export function statusPorcelain(opts = {}) {
446
- const argv = ['status', '--porcelain'];
452
+ const argv = ['status', '--porcelain', '--untracked-files=normal'];
447
453
  if (opts.paths !== undefined && opts.paths.length > 0)
448
454
  argv.push('--', ...opts.paths);
449
455
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdlc/typed-git",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "A typed git client for TypeScript, sync and awaitable. Each verb declares what absence means for it; every other failure throws. git.try.* inspects, raw() bypasses — over an injectable backend that drives the git CLI or any other implementation.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "author": "sksizer",