@procedures/git 0.2.3 → 0.4.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +125 -17
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/index.d.ts +2 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/module.d.ts.map +1 -1
  9. package/dist/module.js +314 -4
  10. package/dist/module.js.map +1 -1
  11. package/dist/procedures/git/blame.d.ts +17 -0
  12. package/dist/procedures/git/blame.d.ts.map +1 -0
  13. package/dist/procedures/git/blame.js +69 -0
  14. package/dist/procedures/git/blame.js.map +1 -0
  15. package/dist/procedures/git/branch/add.d.ts +12 -0
  16. package/dist/procedures/git/branch/add.d.ts.map +1 -0
  17. package/dist/procedures/git/branch/add.js +21 -0
  18. package/dist/procedures/git/branch/add.js.map +1 -0
  19. package/dist/procedures/git/branch/delete.d.ts +13 -0
  20. package/dist/procedures/git/branch/delete.d.ts.map +1 -0
  21. package/dist/procedures/git/branch/delete.js +24 -0
  22. package/dist/procedures/git/branch/delete.js.map +1 -0
  23. package/dist/procedures/git/branch/list.d.ts +13 -0
  24. package/dist/procedures/git/branch/list.d.ts.map +1 -0
  25. package/dist/procedures/git/branch/list.js +37 -0
  26. package/dist/procedures/git/branch/list.js.map +1 -0
  27. package/dist/procedures/git/branch.d.ts +8 -2
  28. package/dist/procedures/git/branch.d.ts.map +1 -1
  29. package/dist/procedures/git/branch.js +18 -37
  30. package/dist/procedures/git/branch.js.map +1 -1
  31. package/dist/procedures/git/commit.d.ts +2 -1
  32. package/dist/procedures/git/commit.d.ts.map +1 -1
  33. package/dist/procedures/git/commit.js +21 -12
  34. package/dist/procedures/git/commit.js.map +1 -1
  35. package/dist/procedures/git/index.d.ts +19 -0
  36. package/dist/procedures/git/index.d.ts.map +1 -1
  37. package/dist/procedures/git/index.js +19 -0
  38. package/dist/procedures/git/index.js.map +1 -1
  39. package/dist/procedures/git/init.d.ts +6 -2
  40. package/dist/procedures/git/init.d.ts.map +1 -1
  41. package/dist/procedures/git/init.js +8 -4
  42. package/dist/procedures/git/init.js.map +1 -1
  43. package/dist/procedures/git/merge/abort.d.ts +14 -0
  44. package/dist/procedures/git/merge/abort.d.ts.map +1 -0
  45. package/dist/procedures/git/merge/abort.js +18 -0
  46. package/dist/procedures/git/merge/abort.js.map +1 -0
  47. package/dist/procedures/git/merge.d.ts +16 -0
  48. package/dist/procedures/git/merge.d.ts.map +1 -0
  49. package/dist/procedures/git/merge.js +41 -0
  50. package/dist/procedures/git/merge.js.map +1 -0
  51. package/dist/procedures/git/porcelain.d.ts +27 -0
  52. package/dist/procedures/git/porcelain.d.ts.map +1 -0
  53. package/dist/procedures/git/porcelain.js +66 -0
  54. package/dist/procedures/git/porcelain.js.map +1 -0
  55. package/dist/procedures/git/push.d.ts.map +1 -1
  56. package/dist/procedures/git/push.js +4 -2
  57. package/dist/procedures/git/push.js.map +1 -1
  58. package/dist/procedures/git/rebase/abort.d.ts +13 -0
  59. package/dist/procedures/git/rebase/abort.d.ts.map +1 -0
  60. package/dist/procedures/git/rebase/abort.js +17 -0
  61. package/dist/procedures/git/rebase/abort.js.map +1 -0
  62. package/dist/procedures/git/rebase/continue.d.ts +13 -0
  63. package/dist/procedures/git/rebase/continue.d.ts.map +1 -0
  64. package/dist/procedures/git/rebase/continue.js +23 -0
  65. package/dist/procedures/git/rebase/continue.js.map +1 -0
  66. package/dist/procedures/git/rebase.d.ts +22 -0
  67. package/dist/procedures/git/rebase.d.ts.map +1 -0
  68. package/dist/procedures/git/rebase.js +46 -0
  69. package/dist/procedures/git/rebase.js.map +1 -0
  70. package/dist/procedures/git/refs.d.ts +31 -0
  71. package/dist/procedures/git/refs.d.ts.map +1 -0
  72. package/dist/procedures/git/refs.js +52 -0
  73. package/dist/procedures/git/refs.js.map +1 -0
  74. package/dist/procedures/git/reset.d.ts +13 -0
  75. package/dist/procedures/git/reset.d.ts.map +1 -0
  76. package/dist/procedures/git/reset.js +31 -0
  77. package/dist/procedures/git/reset.js.map +1 -0
  78. package/dist/procedures/git/restore.d.ts +13 -0
  79. package/dist/procedures/git/restore.d.ts.map +1 -0
  80. package/dist/procedures/git/restore.js +26 -0
  81. package/dist/procedures/git/restore.js.map +1 -0
  82. package/dist/procedures/git/revParse.d.ts +13 -0
  83. package/dist/procedures/git/revParse.d.ts.map +1 -0
  84. package/dist/procedures/git/revParse.js +23 -0
  85. package/dist/procedures/git/revParse.js.map +1 -0
  86. package/dist/procedures/git/run.d.ts +2 -0
  87. package/dist/procedures/git/run.d.ts.map +1 -1
  88. package/dist/procedures/git/run.js +1 -0
  89. package/dist/procedures/git/run.js.map +1 -1
  90. package/dist/procedures/git/show.d.ts +15 -0
  91. package/dist/procedures/git/show.d.ts.map +1 -0
  92. package/dist/procedures/git/show.js +49 -0
  93. package/dist/procedures/git/show.js.map +1 -0
  94. package/dist/procedures/git/status.d.ts +3 -1
  95. package/dist/procedures/git/status.d.ts.map +1 -1
  96. package/dist/procedures/git/status.js +11 -24
  97. package/dist/procedures/git/status.js.map +1 -1
  98. package/dist/procedures/git/tag/add.d.ts +12 -0
  99. package/dist/procedures/git/tag/add.d.ts.map +1 -0
  100. package/dist/procedures/git/tag/add.js +25 -0
  101. package/dist/procedures/git/tag/add.js.map +1 -0
  102. package/dist/procedures/git/tag/delete.d.ts +12 -0
  103. package/dist/procedures/git/tag/delete.d.ts.map +1 -0
  104. package/dist/procedures/git/tag/delete.js +19 -0
  105. package/dist/procedures/git/tag/delete.js.map +1 -0
  106. package/dist/procedures/git/tag/list.d.ts +12 -0
  107. package/dist/procedures/git/tag/list.d.ts.map +1 -0
  108. package/dist/procedures/git/tag/list.js +34 -0
  109. package/dist/procedures/git/tag/list.js.map +1 -0
  110. package/dist/procedures/git/worktree/add.d.ts +13 -0
  111. package/dist/procedures/git/worktree/add.d.ts.map +1 -0
  112. package/dist/procedures/git/worktree/add.js +35 -0
  113. package/dist/procedures/git/worktree/add.js.map +1 -0
  114. package/dist/procedures/git/worktree/list.d.ts +17 -0
  115. package/dist/procedures/git/worktree/list.d.ts.map +1 -0
  116. package/dist/procedures/git/worktree/list.js +52 -0
  117. package/dist/procedures/git/worktree/list.js.map +1 -0
  118. package/dist/procedures/git/worktree/remove.d.ts +13 -0
  119. package/dist/procedures/git/worktree/remove.d.ts.map +1 -0
  120. package/dist/procedures/git/worktree/remove.js +20 -0
  121. package/dist/procedures/git/worktree/remove.js.map +1 -0
  122. package/dist/types.d.ts +315 -0
  123. package/dist/types.d.ts.map +1 -1
  124. package/dist/types.js +280 -0
  125. package/dist/types.js.map +1 -1
  126. package/package.json +4 -4
  127. package/src/index.ts +2 -1
  128. package/src/module.ts +413 -4
  129. package/src/procedures/git/blame.ts +68 -0
  130. package/src/procedures/git/branch/add.ts +24 -0
  131. package/src/procedures/git/branch/delete.ts +29 -0
  132. package/src/procedures/git/branch/list.ts +40 -0
  133. package/src/procedures/git/branch.ts +19 -40
  134. package/src/procedures/git/commit.ts +20 -12
  135. package/src/procedures/git/index.ts +19 -0
  136. package/src/procedures/git/init.ts +11 -10
  137. package/src/procedures/git/merge/abort.ts +20 -0
  138. package/src/procedures/git/merge.ts +42 -0
  139. package/src/procedures/git/porcelain.ts +63 -0
  140. package/src/procedures/git/push.ts +4 -2
  141. package/src/procedures/git/rebase/abort.ts +19 -0
  142. package/src/procedures/git/rebase/continue.ts +25 -0
  143. package/src/procedures/git/rebase.ts +48 -0
  144. package/src/procedures/git/refs.ts +55 -0
  145. package/src/procedures/git/reset.ts +34 -0
  146. package/src/procedures/git/restore.ts +27 -0
  147. package/src/procedures/git/revParse.ts +24 -0
  148. package/src/procedures/git/run.ts +3 -0
  149. package/src/procedures/git/show.ts +57 -0
  150. package/src/procedures/git/status.ts +9 -17
  151. package/src/procedures/git/tag/add.ts +27 -0
  152. package/src/procedures/git/tag/delete.ts +22 -0
  153. package/src/procedures/git/tag/list.ts +36 -0
  154. package/src/procedures/git/worktree/add.ts +35 -0
  155. package/src/procedures/git/worktree/list.ts +48 -0
  156. package/src/procedures/git/worktree/remove.ts +21 -0
  157. package/src/types.ts +641 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The status letters of git, and a parser of `git status --porcelain=v1 -z`.
3
+ *
4
+ * With `-z`, git writes each path as it is: no quotes. A rename or a copy gives its new path in
5
+ * the entry, and its old path in the next field.
6
+ */
7
+ import { zFields } from "./run.js";
8
+ /** The status letters of a path with a conflict (git status, "Short Format"). */
9
+ const UNMERGED = new Set(["DD", "AU", "UD", "UA", "DU", "AA", "UU"]);
10
+ /** This function gives the status of one entry from its two status letters (index, then work tree). */
11
+ export function classifyStatus(xy) {
12
+ if (xy === "??")
13
+ return { status: "untracked", staged: false };
14
+ if (xy === "!!")
15
+ return { status: "ignored", staged: false };
16
+ if (UNMERGED.has(xy))
17
+ return { status: "modified", staged: false };
18
+ const index = xy[0];
19
+ const worktree = xy[1];
20
+ if (index === "A")
21
+ return { status: "added", staged: true };
22
+ if (index === "D")
23
+ return { status: "deleted", staged: true };
24
+ if (index === "R")
25
+ return { status: "renamed", staged: true };
26
+ if (index === "C")
27
+ return { status: "copied", staged: true };
28
+ if (index === "M" || index === "T")
29
+ return { status: "modified", staged: true };
30
+ if (worktree === "D")
31
+ return { status: "deleted", staged: false };
32
+ if (worktree === "A")
33
+ return { status: "added", staged: false };
34
+ if (worktree === "R")
35
+ return { status: "renamed", staged: false };
36
+ return { status: "modified", staged: false };
37
+ }
38
+ /**
39
+ * This function reads the output of `git status --porcelain=v1 -z`. Each entry has its status
40
+ * letters, its exact path, and for a rename or a copy the old path in `from`. It skips the
41
+ * branch line of `--branch`.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const output = await git(["status", "--porcelain=v1", "-z", "--untracked-files=all", "--", "notes"]);
46
+ * const untracked = parsePorcelainV1(output).filter((entry) => entry.status === "untracked");
47
+ * ```
48
+ */
49
+ export function parsePorcelainV1(output) {
50
+ const fields = zFields(output);
51
+ const entries = [];
52
+ for (let i = 0; i < fields.length; i++) {
53
+ const field = fields[i];
54
+ // "XY path": two letters, a space, then the path. "## branch" is the line of --branch.
55
+ if (field.length < 4 || field[2] !== " " || field.startsWith("## "))
56
+ continue;
57
+ const xy = field.slice(0, 2);
58
+ const entry = { xy, path: field.slice(3), ...classifyStatus(xy) };
59
+ // A rename or a copy, in the index or in the work tree, gives its old path in the next field
60
+ if (!UNMERGED.has(xy) && /[RC]/.test(xy))
61
+ entry.from = fields[++i] ?? "";
62
+ entries.push(entry);
63
+ }
64
+ return entries;
65
+ }
66
+ //# sourceMappingURL=porcelain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"porcelain.js","sourceRoot":"","sources":["../../../src/procedures/git/porcelain.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AASnC,iFAAiF;AACjF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAErE,uGAAuG;AACvG,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC/D,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC7D,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACnE,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,C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,CAAC,CAAE,CAAC;QACzB,uFAAuF;QACvF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,SAAS;QAC9E,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAsB,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC;QACrF,6FAA6F;QAC7F,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/push.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAElE;;GAEG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CA4B/F"}
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/push.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAElE;;GAEG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CA6B/F"}
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { gitArg } from "./args.js";
7
7
  import { git, GitError } from "./run.js";
8
+ import { currentBranch } from "./refs.js";
8
9
  /**
9
10
  * Push to remote
10
11
  */
@@ -12,8 +13,9 @@ export async function gitPush(input, ctx = {}) {
12
13
  const { branch, force, setUpstream, cwd } = input;
13
14
  const remoteName = input.remote ?? "origin";
14
15
  const run = { cwd, signal: ctx.signal };
15
- // Get current branch if not specified
16
- const branchName = branch || (await git(["rev-parse", "--abbrev-ref", "HEAD"], run)).trim();
16
+ // The current branch if not specified. `git symbolic-ref` reads it in a repository without
17
+ // commits too, so git gives its own error there (roadmap R40).
18
+ const branchName = branch || (await currentBranch(run));
17
19
  // Count commits to push
18
20
  let commits = 0;
19
21
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/procedures/git/push.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,KAAmB,EAAE,GAAG,GAAe,EAAE;IACrE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAClD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,IAAI,QAAQ,CAAC;IAC5C,MAAM,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;IAExC,sCAAsC;IACtC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,EAAE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Q,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,IAAI,GAAa,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,WAAW;QAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAEtE,MAAM,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAErB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * git.rebase.abort procedure
3
+ *
4
+ * Stop a rebase, and go back to the branch as it was before the rebase (roadmap R40). The
5
+ * resolutions of the conflicts are lost. Without a rebase, the call fails.
6
+ */
7
+ import { type GitContext } from "../run.js";
8
+ import type { GitRebaseAbortInput, GitRebaseAbortOutput } from "../../../types.js";
9
+ /**
10
+ * Stop a rebase, and go back to the branch before it
11
+ */
12
+ export declare function gitRebaseAbort(input: GitRebaseAbortInput, ctx?: GitContext): Promise<GitRebaseAbortOutput>;
13
+ //# sourceMappingURL=abort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abort.d.ts","sourceRoot":"","sources":["../../../../src/procedures/git/rebase/abort.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEnF;;GAEG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAIpH"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * git.rebase.abort procedure
3
+ *
4
+ * Stop a rebase, and go back to the branch as it was before the rebase (roadmap R40). The
5
+ * resolutions of the conflicts are lost. Without a rebase, the call fails.
6
+ */
7
+ import { git } from "../run.js";
8
+ import { headHash } from "../refs.js";
9
+ /**
10
+ * Stop a rebase, and go back to the branch before it
11
+ */
12
+ export async function gitRebaseAbort(input, ctx = {}) {
13
+ const run = { cwd: input.cwd, signal: ctx.signal };
14
+ await git(["rebase", "--abort"], run);
15
+ return { aborted: true, hash: await headHash(run) };
16
+ }
17
+ //# sourceMappingURL=abort.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abort.js","sourceRoot":"","sources":["../../../../src/procedures/git/rebase/abort.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAmB,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAA0B,EAAE,GAAG,GAAe,EAAE;IACnF,MAAM,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;IACnD,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC;IACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * git.rebase.continue procedure
3
+ *
4
+ * Continue a rebase after the conflicts are resolved and staged (roadmap R40). Git keeps the
5
+ * message of each commit: it does not start an editor. A next commit can stop on conflicts again.
6
+ */
7
+ import { type GitContext } from "../run.js";
8
+ import type { GitRebaseContinueInput, GitRebaseContinueOutput } from "../../../types.js";
9
+ /**
10
+ * Continue a rebase after the conflicts are resolved
11
+ */
12
+ export declare function gitRebaseContinue(input: GitRebaseContinueInput, ctx?: GitContext): Promise<GitRebaseContinueOutput>;
13
+ //# sourceMappingURL=continue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continue.d.ts","sourceRoot":"","sources":["../../../../src/procedures/git/rebase/continue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEzF;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAS7H"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * git.rebase.continue procedure
3
+ *
4
+ * Continue a rebase after the conflicts are resolved and staged (roadmap R40). Git keeps the
5
+ * message of each commit: it does not start an editor. A next commit can stop on conflicts again.
6
+ */
7
+ import {} from "../run.js";
8
+ import { conflictedFiles, headHash } from "../refs.js";
9
+ import { rebaseStep } from "../rebase.js";
10
+ /**
11
+ * Continue a rebase after the conflicts are resolved
12
+ */
13
+ export async function gitRebaseContinue(input, ctx = {}) {
14
+ const run = { cwd: input.cwd, signal: ctx.signal };
15
+ // Files that still have conflicts: git refuses to continue, so the call gives them
16
+ const unresolved = await conflictedFiles(run);
17
+ if (unresolved.length > 0) {
18
+ return { hash: await headHash(run), completed: false, upToDate: false, conflict: true, conflicts: unresolved };
19
+ }
20
+ // A continued rebase changed the branch: upToDate is false
21
+ return rebaseStep(["rebase", "--continue"], "", run);
22
+ }
23
+ //# sourceMappingURL=continue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continue.js","sourceRoot":"","sources":["../../../../src/procedures/git/rebase/continue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAmB,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAA6B,EAAE,GAAG,GAAe,EAAE;IACzF,MAAM,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;IACnD,mFAAmF;IACnF,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IACjH,CAAC;IACD,2DAA2D;IAC3D,OAAO,UAAU,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * git.rebase procedure
3
+ *
4
+ * Rebase the current branch on another branch (roadmap R40). The rebase is never interactive,
5
+ * and git does not start an editor.
6
+ *
7
+ * A rebase that stops on conflicts is a result, not an error: `conflict` is true, and
8
+ * `conflicts` names the files. Then resolve them, stage them with git.add and call
9
+ * git.rebase.continue, or call git.rebase.abort.
10
+ */
11
+ import { type GitContext, type GitRunOptions } from "./run.js";
12
+ import type { GitRebaseInput, GitRebaseOutput } from "../../types.js";
13
+ /**
14
+ * This function runs a step of a rebase (the start or `--continue`), and gives its result. A
15
+ * stop on conflicts gives `conflict: true`. Any other failure throws.
16
+ */
17
+ export declare function rebaseStep(args: string[], before: string, run: GitRunOptions): Promise<GitRebaseOutput>;
18
+ /**
19
+ * Rebase the current branch on another branch
20
+ */
21
+ export declare function gitRebase(input: GitRebaseInput, ctx?: GitContext): Promise<GitRebaseOutput>;
22
+ //# sourceMappingURL=rebase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebase.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/rebase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAO,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;;GAGG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAS7G;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAarG"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * git.rebase procedure
3
+ *
4
+ * Rebase the current branch on another branch (roadmap R40). The rebase is never interactive,
5
+ * and git does not start an editor.
6
+ *
7
+ * A rebase that stops on conflicts is a result, not an error: `conflict` is true, and
8
+ * `conflicts` names the files. Then resolve them, stage them with git.add and call
9
+ * git.rebase.continue, or call git.rebase.abort.
10
+ */
11
+ import { gitArg } from "./args.js";
12
+ import { git } from "./run.js";
13
+ import { commitOf, conflictedFiles, headHash, NO_EDITOR, stoppedOnConflict } from "./refs.js";
14
+ /**
15
+ * This function runs a step of a rebase (the start or `--continue`), and gives its result. A
16
+ * stop on conflicts gives `conflict: true`. Any other failure throws.
17
+ */
18
+ export async function rebaseStep(args, before, run) {
19
+ try {
20
+ await git(args, { ...run, env: NO_EDITOR });
21
+ }
22
+ catch (error) {
23
+ if (!stoppedOnConflict(error))
24
+ throw error;
25
+ return { hash: await headHash(run), completed: false, upToDate: false, conflict: true, conflicts: await conflictedFiles(run) };
26
+ }
27
+ const hash = await headHash(run);
28
+ return { hash, completed: true, upToDate: hash === before, conflict: false };
29
+ }
30
+ /**
31
+ * Rebase the current branch on another branch
32
+ */
33
+ export async function gitRebase(input, ctx = {}) {
34
+ const { upstream, onto, branch, cwd } = input;
35
+ const run = { cwd, signal: ctx.signal };
36
+ // With a branch, git checks it out first: compare with that branch
37
+ const before = branch ? await commitOf(branch, run) : await headHash(run);
38
+ const args = ["rebase"];
39
+ if (onto)
40
+ args.push("--onto", gitArg("onto", onto));
41
+ args.push(gitArg("upstream", upstream));
42
+ if (branch)
43
+ args.push(gitArg("branch", branch));
44
+ return rebaseStep(args, before, run);
45
+ }
46
+ //# sourceMappingURL=rebase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebase.js","sourceRoot":"","sources":["../../../src/procedures/git/rebase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAuC,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9F;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAc,EAAE,MAAc,EAAE,GAAkB;IACjF,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAA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ebase on conflicts.
4
+ */
5
+ import { type GitRunOptions } from "./run.js";
6
+ /**
7
+ * The current branch, or "HEAD" when HEAD is detached.
8
+ *
9
+ * `git rev-parse --abbrev-ref HEAD` fails in a repository without commits (roadmap R33), because
10
+ * HEAD names a branch that does not exist yet. `git symbolic-ref` reads the name that HEAD
11
+ * holds, so it works there too. It fails only for a detached HEAD.
12
+ */
13
+ export declare function currentBranch(run: GitRunOptions): Promise<string>;
14
+ /** The hash of the commit of a ref (a tag gives its commit). It throws a `GitError` for an unknown ref. */
15
+ export declare function commitOf(ref: string, run: GitRunOptions): Promise<string>;
16
+ /** The hash of HEAD. */
17
+ export declare function headHash(run: GitRunOptions): Promise<string>;
18
+ /** The files that have conflicts, as `git diff --diff-filter=U` gives them. */
19
+ export declare function conflictedFiles(run: GitRunOptions): Promise<string[]>;
20
+ /**
21
+ * True when a failed merge or rebase stopped on conflicts. Git writes "CONFLICT (content): ..."
22
+ * to stdout, and "could not apply" to stderr. Any other failure (a working tree with changes, an
23
+ * unknown ref) is an error of the call.
24
+ */
25
+ export declare function stoppedOnConflict(error: unknown): boolean;
26
+ /**
27
+ * The environment of a merge or a rebase. Git does not start an editor for a message: it keeps
28
+ * the message that it made. `GIT_EDITOR` overrides `core.editor` and `EDITOR` of the machine.
29
+ */
30
+ export declare const NO_EDITOR: Record<string, string>;
31
+ //# sourceMappingURL=refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/refs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CASvE;AAED,2GAA2G;AAC3G,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/E;AAED,wBAAwB;AACxB,wBAAsB,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAElE;AAED,+EAA+E;AAC/E,wBAAsB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA0B,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Helpers of the git procedures of roadmap R40: the current branch, the hash of a ref, the
3
+ * files with conflicts, and the stop of a merge or a rebase on conflicts.
4
+ */
5
+ import { gitArg } from "./args.js";
6
+ import { git, GitError, zFields } from "./run.js";
7
+ /**
8
+ * The current branch, or "HEAD" when HEAD is detached.
9
+ *
10
+ * `git rev-parse --abbrev-ref HEAD` fails in a repository without commits (roadmap R33), because
11
+ * HEAD names a branch that does not exist yet. `git symbolic-ref` reads the name that HEAD
12
+ * holds, so it works there too. It fails only for a detached HEAD.
13
+ */
14
+ export async function currentBranch(run) {
15
+ try {
16
+ return (await git(["symbolic-ref", "--quiet", "--short", "HEAD"], run)).trim();
17
+ }
18
+ catch (error) {
19
+ if (!(error instanceof GitError))
20
+ throw error;
21
+ // A detached HEAD: exit 1 and no message. Outside a repository: exit 128, and that is an error.
22
+ if (error.exitCode === 1)
23
+ return "HEAD";
24
+ throw error;
25
+ }
26
+ }
27
+ /** The hash of the commit of a ref (a tag gives its commit). It throws a `GitError` for an unknown ref. */
28
+ export async function commitOf(ref, run) {
29
+ return (await git(["rev-parse", "--verify", `${gitArg("ref", ref)}^{commit}`], run)).trim();
30
+ }
31
+ /** The hash of HEAD. */
32
+ export async function headHash(run) {
33
+ return (await git(["rev-parse", "--verify", "HEAD"], run)).trim();
34
+ }
35
+ /** The files that have conflicts, as `git diff --diff-filter=U` gives them. */
36
+ export async function conflictedFiles(run) {
37
+ return zFields(await git(["diff", "--name-only", "--diff-filter=U", "-z"], run));
38
+ }
39
+ /**
40
+ * True when a failed merge or rebase stopped on conflicts. Git writes "CONFLICT (content): ..."
41
+ * to stdout, and "could not apply" to stderr. Any other failure (a working tree with changes, an
42
+ * unknown ref) is an error of the call.
43
+ */
44
+ export function stoppedOnConflict(error) {
45
+ return error instanceof GitError && /^CONFLICT \(|could not apply/im.test(`${error.stdout}\n${error.stderr}`);
46
+ }
47
+ /**
48
+ * The environment of a merge or a rebase. Git does not start an editor for a message: it keeps
49
+ * the message that it made. `GIT_EDITOR` overrides `core.editor` and `EDITOR` of the machine.
50
+ */
51
+ export const NO_EDITOR = { GIT_EDITOR: "true" };
52
+ //# sourceMappingURL=refs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refs.js","sourceRoot":"","sources":["../../../src/procedures/git/refs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAsB,MAAM,UAAU,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAkB;IACpD,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACjF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,QAAQ,CAAC;YAAE,MAAM,KAAK,CAAC;QAC9C,gGAAgG;QAChG,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC;YAAE,OAAO,MAAM,CAAC;QACxC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,2GAA2G;AAC3G,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,GAAW,EAAE,GAAkB;IAC5D,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9F,CAAC;AAED,wBAAwB;AACxB,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,GAAkB;IAC/C,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACpE,CAAC;AAED,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAkB;IACtD,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACnF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,KAAK,YAAY,QAAQ,IAAI,gCAAgC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AAChH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAA2B,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * git.reset procedure
3
+ *
4
+ * Move HEAD to a commit, and reset the index or the working tree (roadmap R40). The mode hard
5
+ * deletes the changes of the working tree that are not committed.
6
+ */
7
+ import { type GitContext } from "./run.js";
8
+ import type { GitResetInput, GitResetOutput } from "../../types.js";
9
+ /**
10
+ * Move HEAD to a commit, and reset the index or the working tree
11
+ */
12
+ export declare function gitReset(input: GitResetInput, ctx?: GitContext): Promise<GitResetOutput>;
13
+ //# sourceMappingURL=reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/reset.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEpE;;GAEG;AACH,wBAAsB,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAkBlG"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * git.reset procedure
3
+ *
4
+ * Move HEAD to a commit, and reset the index or the working tree (roadmap R40). The mode hard
5
+ * deletes the changes of the working tree that are not committed.
6
+ */
7
+ import { gitArg } from "./args.js";
8
+ import { git } from "./run.js";
9
+ import { headHash } from "./refs.js";
10
+ /**
11
+ * Move HEAD to a commit, and reset the index or the working tree
12
+ */
13
+ export async function gitReset(input, ctx = {}) {
14
+ const ref = input.ref ?? "HEAD";
15
+ const mode = input.mode ?? "mixed";
16
+ const run = { cwd: input.cwd, signal: ctx.signal };
17
+ const args = ["reset", "--quiet"];
18
+ if (input.paths && input.paths.length > 0) {
19
+ // Git resets paths only in the index: HEAD and the working tree stay
20
+ if (mode !== "mixed") {
21
+ throw new Error(`git.reset: paths need the mode mixed, not ${mode}`);
22
+ }
23
+ args.push(gitArg("ref", ref), "--", ...input.paths);
24
+ }
25
+ else {
26
+ args.push(`--${mode}`, gitArg("ref", ref));
27
+ }
28
+ await git(args, run);
29
+ return { ref, mode, hash: await headHash(run) };
30
+ }
31
+ //# sourceMappingURL=reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset.js","sourceRoot":"","sources":["../../../src/procedures/git/reset.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAmB,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,KAAoB,EAAE,GAAG,GAAe,EAAE;IACvE,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC;IAChC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC;IACnC,MAAM,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;IAEnD,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAClC,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,qEAAqE;QACrE,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,6CAA6C,IAAI,EAAE,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,MAAM,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAErB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;AAClD,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * git.restore procedure
3
+ *
4
+ * Restore files of the working tree or the index (roadmap R40). A restore of the working tree
5
+ * deletes the changes of the files that are not committed.
6
+ */
7
+ import { type GitContext } from "./run.js";
8
+ import type { GitRestoreInput, GitRestoreOutput } from "../../types.js";
9
+ /**
10
+ * Restore files of the working tree or the index
11
+ */
12
+ export declare function gitRestore(input: GitRestoreInput, ctx?: GitContext): Promise<GitRestoreOutput>;
13
+ //# sourceMappingURL=restore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restore.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/restore.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExE;;GAEG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAYxG"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * git.restore procedure
3
+ *
4
+ * Restore files of the working tree or the index (roadmap R40). A restore of the working tree
5
+ * deletes the changes of the files that are not committed.
6
+ */
7
+ import { gitArg } from "./args.js";
8
+ import { git } from "./run.js";
9
+ /**
10
+ * Restore files of the working tree or the index
11
+ */
12
+ export async function gitRestore(input, ctx = {}) {
13
+ const { paths, source, staged, worktree, cwd } = input;
14
+ const args = ["restore"];
15
+ if (source)
16
+ args.push(`--source=${gitArg("source", source)}`);
17
+ if (staged)
18
+ args.push("--staged");
19
+ if (worktree)
20
+ args.push("--worktree");
21
+ // After "--", a path that starts with "-" stays a path
22
+ args.push("--", ...paths);
23
+ await git(args, { cwd, signal: ctx.signal });
24
+ return { restored: paths };
25
+ }
26
+ //# sourceMappingURL=restore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restore.js","sourceRoot":"","sources":["../../../src/procedures/git/restore.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAmB,MAAM,UAAU,CAAC;AAGhD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAsB,EAAE,GAAG,GAAe,EAAE;IAC3E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAEvD,MAAM,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACzB,IAAI,MAAM;QAAE,IAAI,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IAC9D,IAAI,MAAM;QAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,QAAQ;QAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtC,uDAAuD;IACvD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;IAC1B,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAE7C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * git.revParse procedure
3
+ *
4
+ * Give the hash or the name of a ref (roadmap R40). With `--verify`, git gives exactly one value,
5
+ * or fails for an unknown ref.
6
+ */
7
+ import { type GitContext } from "./run.js";
8
+ import type { GitRevParseInput, GitRevParseOutput } from "../../types.js";
9
+ /**
10
+ * Give the hash or the name of a ref
11
+ */
12
+ export declare function gitRevParse(input: GitRevParseInput, ctx?: GitContext): Promise<GitRevParseOutput>;
13
+ //# sourceMappingURL=revParse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revParse.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/revParse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE1E;;GAEG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAS3G"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * git.revParse procedure
3
+ *
4
+ * Give the hash or the name of a ref (roadmap R40). With `--verify`, git gives exactly one value,
5
+ * or fails for an unknown ref.
6
+ */
7
+ import { gitArg } from "./args.js";
8
+ import { git } from "./run.js";
9
+ /**
10
+ * Give the hash or the name of a ref
11
+ */
12
+ export async function gitRevParse(input, ctx = {}) {
13
+ const ref = input.ref ?? "HEAD";
14
+ const args = ["rev-parse", "--verify"];
15
+ if (input.abbrevRef)
16
+ args.push("--abbrev-ref");
17
+ else if (input.short)
18
+ args.push("--short");
19
+ args.push(gitArg("ref", ref));
20
+ const value = (await git(args, { cwd: input.cwd, signal: ctx.signal })).trim();
21
+ return { ref, value };
22
+ }
23
+ //# sourceMappingURL=revParse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revParse.js","sourceRoot":"","sources":["../../../src/procedures/git/revParse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAmB,MAAM,UAAU,CAAC;AAGhD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAuB,EAAE,GAAG,GAAe,EAAE;IAC7E,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC;IAChC,MAAM,IAAI,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACvC,IAAI,KAAK,CAAC,SAAS;QAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAC1C,IAAI,KAAK,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAE9B,MAAM,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/E,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AACxB,CAAC"}
@@ -13,6 +13,8 @@ export interface GitRunOptions extends GitContext {
13
13
  cwd?: string | undefined;
14
14
  /** Text to write to the stdin of git (for example a patch for `git apply`). */
15
15
  input?: string | undefined;
16
+ /** Environment variables to add for git (for example `GIT_EDITOR`). */
17
+ env?: Record<string, string> | undefined;
16
18
  }
17
19
  /** A git command that ended with an exit code other than 0. */
18
20
  export declare class GitError extends Error {
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,sEAAsE;AACtE,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,+DAA+D;AAC/D,qBAAa,QAAS,SAAQ,KAAK;IAE/B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM;IAJzB,YACW,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,QAAQ,EAAE,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AM,GAAG,MAAM,EAAE,CAIhD"}
@@ -32,6 +32,7 @@ export async function git(args, options = {}) {
32
32
  cwd: options.cwd,
33
33
  signal: options.signal,
34
34
  input: options.input,
35
+ env: options.env,
35
36
  maxOutputBytes: GIT_MAX_BUFFER,
36
37
  });
37
38
  if (result.aborted) {
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/procedures/git/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAa3C,+DAA+D;AAC/D,MAAM,OAAO,QAAS,SAAQ,KAAK;IAEtB,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IAJjB,YACW,IAAuB,EACvB,QAAgB,EAChB,MAAc,EACd,MAAc;QAEvB,KAAK,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,QAAQ,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBAL9E,IAAI;wBACJ,QAAQ;sBACR,MAAM;sBACN,MAAM;QAGf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,IAAc,EAAE,OAAO,GAAkB,EAAE;IACnE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE;QACrC,IAAI;QACJ,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,cAAc,EAAE,cAAc;KAC/B,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,cAA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C,MAAM,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;AACvB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;QAAE,MAAM,CAAC,GAAG,EAAE,CAAC;IACvC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * git.show procedure
3
+ *
4
+ * Show a commit, or a file at a commit (roadmap R40).
5
+ *
6
+ * The procedure first resolves the ref to its commit, so a tag gives its commit and not the text
7
+ * of the tag object. A merge commit gives its changes against its first parent.
8
+ */
9
+ import { type GitContext } from "./run.js";
10
+ import type { GitShowInput, GitShowOutput } from "../../types.js";
11
+ /**
12
+ * Show a commit, or a file at a commit
13
+ */
14
+ export declare function gitShow(input: GitShowInput, ctx?: GitContext): Promise<GitShowOutput>;
15
+ //# sourceMappingURL=show.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/show.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKlE;;GAEG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CAoC/F"}