@procedures/git 0.0.0-stage → 0.1.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 +5 -0
- package/LICENSE +21 -0
- package/README.md +1114 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +16 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +437 -0
- package/dist/module.js.map +1 -0
- package/dist/procedures/git/add.d.ts +12 -0
- package/dist/procedures/git/add.d.ts.map +1 -0
- package/dist/procedures/git/add.js +26 -0
- package/dist/procedures/git/add.js.map +1 -0
- package/dist/procedures/git/args.d.ts +15 -0
- package/dist/procedures/git/args.d.ts.map +1 -0
- package/dist/procedures/git/args.js +20 -0
- package/dist/procedures/git/args.js.map +1 -0
- package/dist/procedures/git/branch.d.ts +12 -0
- package/dist/procedures/git/branch.d.ts.map +1 -0
- package/dist/procedures/git/branch.js +54 -0
- package/dist/procedures/git/branch.js.map +1 -0
- package/dist/procedures/git/checkout.d.ts +12 -0
- package/dist/procedures/git/checkout.d.ts.map +1 -0
- package/dist/procedures/git/checkout.js +23 -0
- package/dist/procedures/git/checkout.js.map +1 -0
- package/dist/procedures/git/clone.d.ts +12 -0
- package/dist/procedures/git/clone.d.ts.map +1 -0
- package/dist/procedures/git/clone.js +28 -0
- package/dist/procedures/git/clone.js.map +1 -0
- package/dist/procedures/git/commit.d.ts +12 -0
- package/dist/procedures/git/commit.d.ts.map +1 -0
- package/dist/procedures/git/commit.js +41 -0
- package/dist/procedures/git/commit.js.map +1 -0
- package/dist/procedures/git/diff.d.ts +18 -0
- package/dist/procedures/git/diff.d.ts.map +1 -0
- package/dist/procedures/git/diff.js +58 -0
- package/dist/procedures/git/diff.js.map +1 -0
- package/dist/procedures/git/fetch.d.ts +12 -0
- package/dist/procedures/git/fetch.d.ts.map +1 -0
- package/dist/procedures/git/fetch.js +29 -0
- package/dist/procedures/git/fetch.js.map +1 -0
- package/dist/procedures/git/index.d.ts +15 -0
- package/dist/procedures/git/index.d.ts.map +1 -0
- package/dist/procedures/git/index.js +15 -0
- package/dist/procedures/git/index.js.map +1 -0
- package/dist/procedures/git/init.d.ts +12 -0
- package/dist/procedures/git/init.d.ts.map +1 -0
- package/dist/procedures/git/init.js +32 -0
- package/dist/procedures/git/init.js.map +1 -0
- package/dist/procedures/git/log.d.ts +12 -0
- package/dist/procedures/git/log.d.ts.map +1 -0
- package/dist/procedures/git/log.js +35 -0
- package/dist/procedures/git/log.js.map +1 -0
- package/dist/procedures/git/predicates.d.ts +40 -0
- package/dist/procedures/git/predicates.d.ts.map +1 -0
- package/dist/procedures/git/predicates.js +76 -0
- package/dist/procedures/git/predicates.js.map +1 -0
- package/dist/procedures/git/pull.d.ts +12 -0
- package/dist/procedures/git/pull.d.ts.map +1 -0
- package/dist/procedures/git/pull.js +36 -0
- package/dist/procedures/git/pull.js.map +1 -0
- package/dist/procedures/git/push.d.ts +12 -0
- package/dist/procedures/git/push.d.ts.map +1 -0
- package/dist/procedures/git/push.js +39 -0
- package/dist/procedures/git/push.js.map +1 -0
- package/dist/procedures/git/remote.d.ts +12 -0
- package/dist/procedures/git/remote.d.ts.map +1 -0
- package/dist/procedures/git/remote.js +31 -0
- package/dist/procedures/git/remote.js.map +1 -0
- package/dist/procedures/git/run.d.ts +32 -0
- package/dist/procedures/git/run.d.ts.map +1 -0
- package/dist/procedures/git/run.js +60 -0
- package/dist/procedures/git/run.js.map +1 -0
- package/dist/procedures/git/stash.d.ts +38 -0
- package/dist/procedures/git/stash.d.ts.map +1 -0
- package/dist/procedures/git/stash.js +211 -0
- package/dist/procedures/git/stash.js.map +1 -0
- package/dist/procedures/git/status.d.ts +17 -0
- package/dist/procedures/git/status.d.ts.map +1 -0
- package/dist/procedures/git/status.js +107 -0
- package/dist/procedures/git/status.js.map +1 -0
- package/dist/procedures/git.d.ts +5 -0
- package/dist/procedures/git.d.ts.map +1 -0
- package/dist/procedures/git.js +5 -0
- package/dist/procedures/git.js.map +1 -0
- package/dist/register.d.ts +8 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +14 -0
- package/dist/register.js.map +1 -0
- package/dist/types.d.ts +341 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +387 -0
- package/dist/types.js.map +1 -0
- package/package.json +74 -3
- package/src/index.ts +20 -0
- package/src/module.ts +570 -0
- package/src/procedures/git/add.ts +29 -0
- package/src/procedures/git/args.ts +21 -0
- package/src/procedures/git/branch.ts +61 -0
- package/src/procedures/git/checkout.ts +27 -0
- package/src/procedures/git/clone.ts +33 -0
- package/src/procedures/git/commit.ts +46 -0
- package/src/procedures/git/diff.ts +62 -0
- package/src/procedures/git/fetch.ts +32 -0
- package/src/procedures/git/index.ts +22 -0
- package/src/procedures/git/init.ts +43 -0
- package/src/procedures/git/log.ts +40 -0
- package/src/procedures/git/predicates.ts +90 -0
- package/src/procedures/git/pull.ts +45 -0
- package/src/procedures/git/push.ts +42 -0
- package/src/procedures/git/remote.ts +33 -0
- package/src/procedures/git/run.ts +70 -0
- package/src/procedures/git/stash.ts +255 -0
- package/src/procedures/git/status.ts +98 -0
- package/src/procedures/git.ts +5 -0
- package/src/register.ts +17 -0
- package/src/types.ts +799 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.push procedure
|
|
3
|
+
*
|
|
4
|
+
* Push to remote
|
|
5
|
+
*/
|
|
6
|
+
import { type GitContext } from "./run.js";
|
|
7
|
+
import type { GitPushInput, GitPushOutput } from "../../types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Push to remote
|
|
10
|
+
*/
|
|
11
|
+
export declare function gitPush(input: GitPushInput, ctx?: GitContext): Promise<GitPushOutput>;
|
|
12
|
+
//# sourceMappingURL=push.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.push procedure
|
|
3
|
+
*
|
|
4
|
+
* Push to remote
|
|
5
|
+
*/
|
|
6
|
+
import { gitArg } from "./args.js";
|
|
7
|
+
import { git, GitError } from "./run.js";
|
|
8
|
+
/**
|
|
9
|
+
* Push to remote
|
|
10
|
+
*/
|
|
11
|
+
export async function gitPush(input, ctx = {}) {
|
|
12
|
+
const { branch, force, setUpstream, cwd } = input;
|
|
13
|
+
const remoteName = input.remote ?? "origin";
|
|
14
|
+
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();
|
|
17
|
+
// Count commits to push
|
|
18
|
+
let commits = 0;
|
|
19
|
+
try {
|
|
20
|
+
const count = (await git(["rev-list", "--count", `${remoteName}/${branchName}..HEAD`], run)).trim();
|
|
21
|
+
commits = parseInt(count, 10) || 0;
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
// Remote branch may not exist yet
|
|
25
|
+
if (!(error instanceof GitError))
|
|
26
|
+
throw error;
|
|
27
|
+
const count = (await git(["rev-list", "--count", "HEAD"], run)).trim();
|
|
28
|
+
commits = parseInt(count, 10) || 0;
|
|
29
|
+
}
|
|
30
|
+
const args = ["push"];
|
|
31
|
+
if (setUpstream)
|
|
32
|
+
args.push("-u");
|
|
33
|
+
if (force)
|
|
34
|
+
args.push("--force");
|
|
35
|
+
args.push(gitArg("remote", remoteName), gitArg("branch", branchName));
|
|
36
|
+
await git(args, run);
|
|
37
|
+
return { remote: remoteName, branch: branchName, commits };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +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,cAAc,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE5F,wBAAwB;IACxB,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,UAAU,IAAI,UAAU,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACpG,OAAO,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kCAAkC;QAClC,IAAI,CAAC,CAAC,KAAK,YAAY,QAAQ,CAAC;YAAE,MAAM,KAAK,CAAC;QAC9C,MAAM,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACvE,OAAO,GAAG,QAAQ,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,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.remote procedure
|
|
3
|
+
*
|
|
4
|
+
* Get or set remote URLs
|
|
5
|
+
*/
|
|
6
|
+
import { type GitContext } from "./run.js";
|
|
7
|
+
import type { GitRemoteInput, GitRemoteOutput } from "../../types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Get or set remote URL
|
|
10
|
+
*/
|
|
11
|
+
export declare function gitRemote(input: GitRemoteInput, ctx?: GitContext): Promise<GitRemoteOutput>;
|
|
12
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/remote.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;GAEG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAmBrG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.remote procedure
|
|
3
|
+
*
|
|
4
|
+
* Get or set remote URLs
|
|
5
|
+
*/
|
|
6
|
+
import { gitArg } from "./args.js";
|
|
7
|
+
import { git, GitError } from "./run.js";
|
|
8
|
+
/**
|
|
9
|
+
* Get or set remote URL
|
|
10
|
+
*/
|
|
11
|
+
export async function gitRemote(input, ctx = {}) {
|
|
12
|
+
const { name, url, cwd } = input;
|
|
13
|
+
const run = { cwd, signal: ctx.signal };
|
|
14
|
+
if (url) {
|
|
15
|
+
// Set the remote URL
|
|
16
|
+
try {
|
|
17
|
+
await git(["remote", "set-url", gitArg("name", name), gitArg("url", url)], run);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
// Remote might not exist, try adding it
|
|
21
|
+
if (!(error instanceof GitError))
|
|
22
|
+
throw error;
|
|
23
|
+
await git(["remote", "add", gitArg("name", name), gitArg("url", url)], run);
|
|
24
|
+
}
|
|
25
|
+
return { name, url };
|
|
26
|
+
}
|
|
27
|
+
// Get the remote URL
|
|
28
|
+
const remoteUrl = (await git(["remote", "get-url", gitArg("name", name)], run)).trim();
|
|
29
|
+
return { name, url: remoteUrl };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=remote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../src/procedures/git/remote.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE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procedures run git: through `runCommand` of client-shell (roadmap 2.2).
|
|
3
|
+
*
|
|
4
|
+
* Before, they called `execFileSync`: each git call blocked the event loop of the host (an MCP
|
|
5
|
+
* server or a warm `mark` server stopped all its other calls), and the signal of the call could
|
|
6
|
+
* not stop git. Now each call is async, the signal kills git, and the output has a limit.
|
|
7
|
+
*/
|
|
8
|
+
/** The part of the procedure context that the git procedures read. */
|
|
9
|
+
export interface GitContext {
|
|
10
|
+
signal?: AbortSignal | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface GitRunOptions extends GitContext {
|
|
13
|
+
cwd?: string | undefined;
|
|
14
|
+
/** Text to write to the stdin of git (for example a patch for `git apply`). */
|
|
15
|
+
input?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** A git command that ended with an exit code other than 0. */
|
|
18
|
+
export declare class GitError extends Error {
|
|
19
|
+
readonly args: readonly string[];
|
|
20
|
+
readonly exitCode: number;
|
|
21
|
+
readonly stdout: string;
|
|
22
|
+
readonly stderr: string;
|
|
23
|
+
constructor(args: readonly string[], exitCode: number, stdout: string, stderr: string);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This function runs `git <args>` and gives its stdout. It throws a `GitError` when git fails,
|
|
27
|
+
* and an `AbortError` when the signal aborts.
|
|
28
|
+
*/
|
|
29
|
+
export declare function git(args: string[], options?: GitRunOptions): Promise<string>;
|
|
30
|
+
/** This function splits output that git wrote with `-z` into its fields. */
|
|
31
|
+
export declare function zFields(output: string): string[];
|
|
32
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +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,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAIxB;CACF;AAED;;;GAGG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBtF;AAED,4EAA4E;AAC5E,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAIhD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the git procedures run git: through `runCommand` of client-shell (roadmap 2.2).
|
|
3
|
+
*
|
|
4
|
+
* Before, they called `execFileSync`: each git call blocked the event loop of the host (an MCP
|
|
5
|
+
* server or a warm `mark` server stopped all its other calls), and the signal of the call could
|
|
6
|
+
* not stop git. Now each call is async, the signal kills git, and the output has a limit.
|
|
7
|
+
*/
|
|
8
|
+
import { runCommand } from "@procedures/shell/command";
|
|
9
|
+
import { GIT_MAX_BUFFER } from "./args.js";
|
|
10
|
+
/** A git command that ended with an exit code other than 0. */
|
|
11
|
+
export class GitError extends Error {
|
|
12
|
+
args;
|
|
13
|
+
exitCode;
|
|
14
|
+
stdout;
|
|
15
|
+
stderr;
|
|
16
|
+
constructor(args, exitCode, stdout, stderr) {
|
|
17
|
+
super(`git ${args.join(" ")} failed (exit ${exitCode}): ${(stderr || stdout).trim()}`);
|
|
18
|
+
this.args = args;
|
|
19
|
+
this.exitCode = exitCode;
|
|
20
|
+
this.stdout = stdout;
|
|
21
|
+
this.stderr = stderr;
|
|
22
|
+
this.name = "GitError";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This function runs `git <args>` and gives its stdout. It throws a `GitError` when git fails,
|
|
27
|
+
* and an `AbortError` when the signal aborts.
|
|
28
|
+
*/
|
|
29
|
+
export async function git(args, options = {}) {
|
|
30
|
+
const result = await runCommand("git", {
|
|
31
|
+
args,
|
|
32
|
+
cwd: options.cwd,
|
|
33
|
+
signal: options.signal,
|
|
34
|
+
input: options.input,
|
|
35
|
+
maxOutputBytes: GIT_MAX_BUFFER,
|
|
36
|
+
});
|
|
37
|
+
if (result.aborted) {
|
|
38
|
+
const error = new Error(`git ${args[0]} was aborted`);
|
|
39
|
+
error.name = "AbortError";
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
if (result.error) {
|
|
43
|
+
throw new Error(`git did not start: ${result.error}`);
|
|
44
|
+
}
|
|
45
|
+
if (result.truncated?.stdout) {
|
|
46
|
+
throw new Error(`The output of git ${args[0]} is longer than ${GIT_MAX_BUFFER} bytes`);
|
|
47
|
+
}
|
|
48
|
+
if (!result.success) {
|
|
49
|
+
throw new GitError(args, result.exitCode, result.stdout, result.stderr);
|
|
50
|
+
}
|
|
51
|
+
return result.stdout;
|
|
52
|
+
}
|
|
53
|
+
/** This function splits output that git wrote with `-z` into its fields. */
|
|
54
|
+
export function zFields(output) {
|
|
55
|
+
const fields = output.split("\0");
|
|
56
|
+
if (fields.at(-1) === "")
|
|
57
|
+
fields.pop();
|
|
58
|
+
return fields;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/procedures/git/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,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AAqB,IAAI,CAAC,CAAC,CAAC,mBAAmB,cAAc,QAAQ,CAAC,CAAC;IACzF,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.stash.* procedures
|
|
3
|
+
*
|
|
4
|
+
* Stash operations for saving and restoring work in progress.
|
|
5
|
+
* Includes export/import for snapshot storage.
|
|
6
|
+
*/
|
|
7
|
+
import { type GitContext } from "./run.js";
|
|
8
|
+
import type { GitStashListInput, GitStashListOutput, GitStashPushInput, GitStashPushOutput, GitStashPopInput, GitStashPopOutput, GitStashApplyInput, GitStashApplyOutput, GitStashDropInput, GitStashDropOutput, GitStashExportInput, GitStashExportOutput, GitStashImportInput, GitStashImportOutput } from "../../types.js";
|
|
9
|
+
/**
|
|
10
|
+
* List all stashes
|
|
11
|
+
*/
|
|
12
|
+
export declare function gitStashList(input: GitStashListInput, ctx?: GitContext): Promise<GitStashListOutput>;
|
|
13
|
+
/**
|
|
14
|
+
* Push changes to stash
|
|
15
|
+
*/
|
|
16
|
+
export declare function gitStashPush(input: GitStashPushInput, ctx?: GitContext): Promise<GitStashPushOutput>;
|
|
17
|
+
/**
|
|
18
|
+
* Pop stash (apply and remove)
|
|
19
|
+
*/
|
|
20
|
+
export declare function gitStashPop(input: GitStashPopInput, ctx?: GitContext): Promise<GitStashPopOutput>;
|
|
21
|
+
/**
|
|
22
|
+
* Apply stash without removing
|
|
23
|
+
*/
|
|
24
|
+
export declare function gitStashApply(input: GitStashApplyInput, ctx?: GitContext): Promise<GitStashApplyOutput>;
|
|
25
|
+
/**
|
|
26
|
+
* Drop a stash
|
|
27
|
+
*/
|
|
28
|
+
export declare function gitStashDrop(input: GitStashDropInput, ctx?: GitContext): Promise<GitStashDropOutput>;
|
|
29
|
+
/**
|
|
30
|
+
* Export a stash as a patch (for snapshot storage)
|
|
31
|
+
*/
|
|
32
|
+
export declare function gitStashExport(input: GitStashExportInput, ctx?: GitContext): Promise<GitStashExportOutput>;
|
|
33
|
+
/**
|
|
34
|
+
* Import a stash from a patch (for snapshot restore)
|
|
35
|
+
* Note: This creates a new stash, it doesn't recreate the exact stash state
|
|
36
|
+
*/
|
|
37
|
+
export declare function gitStashImport(input: GitStashImportInput, ctx?: GitContext): Promise<GitStashImportOutput>;
|
|
38
|
+
//# sourceMappingURL=stash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stash.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/stash.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EAErB,MAAM,gBAAgB,CAAC;AAqBxB;;GAEG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAgC9G;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA0C9G;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAe3G;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAcjH;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAW9G;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAmCpH;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAyBpH"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.stash.* procedures
|
|
3
|
+
*
|
|
4
|
+
* Stash operations for saving and restoring work in progress.
|
|
5
|
+
* Includes export/import for snapshot storage.
|
|
6
|
+
*/
|
|
7
|
+
import { gitArg } from "./args.js";
|
|
8
|
+
import { git, GitError } from "./run.js";
|
|
9
|
+
/**
|
|
10
|
+
* True when git stopped on a merge conflict. Git writes "CONFLICT (content): ..." to stdout,
|
|
11
|
+
* so the message alone (which has stderr) does not show it. (Before, the procedures examined
|
|
12
|
+
* only the message, and never reported a conflict.)
|
|
13
|
+
*/
|
|
14
|
+
function isConflict(error) {
|
|
15
|
+
return error instanceof GitError && /conflict/i.test(`${error.stdout}\n${error.stderr}`);
|
|
16
|
+
}
|
|
17
|
+
/** The message of a git failure. An abort is not a git failure: it throws again. */
|
|
18
|
+
function failure(error) {
|
|
19
|
+
if (!(error instanceof GitError))
|
|
20
|
+
throw error;
|
|
21
|
+
return error.message;
|
|
22
|
+
}
|
|
23
|
+
function stashRef(index) {
|
|
24
|
+
return index !== undefined ? `stash@{${index}}` : "stash@{0}";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List all stashes
|
|
28
|
+
*/
|
|
29
|
+
export async function gitStashList(input, ctx = {}) {
|
|
30
|
+
const cwd = input.cwd || process.cwd();
|
|
31
|
+
let output;
|
|
32
|
+
try {
|
|
33
|
+
// Get stash list with format: stash@{n}: WIP on branch: message
|
|
34
|
+
output = await git(["stash", "list", "--format=%H%x00%gd%x00%gs"], { cwd, signal: ctx.signal });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
// No stashes or not a git repo
|
|
38
|
+
failure(error);
|
|
39
|
+
return { stashes: [], count: 0 };
|
|
40
|
+
}
|
|
41
|
+
const stashes = [];
|
|
42
|
+
for (const line of output.split("\n").filter(Boolean)) {
|
|
43
|
+
const parts = line.split("\0");
|
|
44
|
+
const hash = parts[0] || "";
|
|
45
|
+
const ref = parts[1] || "";
|
|
46
|
+
const message = parts[2] || "";
|
|
47
|
+
// Extract index from stash@{n}
|
|
48
|
+
const indexMatch = ref.match(/stash@\{(\d+)\}/);
|
|
49
|
+
const index = indexMatch && indexMatch[1] ? parseInt(indexMatch[1], 10) : 0;
|
|
50
|
+
stashes.push({
|
|
51
|
+
index,
|
|
52
|
+
ref,
|
|
53
|
+
hash,
|
|
54
|
+
message,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return { stashes, count: stashes.length };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Push changes to stash
|
|
61
|
+
*/
|
|
62
|
+
export async function gitStashPush(input, ctx = {}) {
|
|
63
|
+
const cwd = input.cwd || process.cwd();
|
|
64
|
+
const run = { cwd, signal: ctx.signal };
|
|
65
|
+
const args = ["stash", "push"];
|
|
66
|
+
if (input.message) {
|
|
67
|
+
args.push("-m", input.message);
|
|
68
|
+
}
|
|
69
|
+
if (input.includeUntracked) {
|
|
70
|
+
args.push("--include-untracked");
|
|
71
|
+
}
|
|
72
|
+
if (input.keepIndex) {
|
|
73
|
+
args.push("--keep-index");
|
|
74
|
+
}
|
|
75
|
+
if (input.paths && input.paths.length > 0) {
|
|
76
|
+
args.push("--");
|
|
77
|
+
args.push(...input.paths);
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const output = await git(args, run);
|
|
81
|
+
// Check if anything was stashed
|
|
82
|
+
if (output.includes("No local changes to save")) {
|
|
83
|
+
return { stashed: false, message: "No local changes to save" };
|
|
84
|
+
}
|
|
85
|
+
// Get the ref of the new stash
|
|
86
|
+
const refOutput = (await git(["stash", "list", "-1", "--format=%gd"], run)).trim();
|
|
87
|
+
return {
|
|
88
|
+
stashed: true,
|
|
89
|
+
ref: refOutput || "stash@{0}",
|
|
90
|
+
message: input.message || "WIP",
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
return { stashed: false, message: failure(error) || "Failed to stash" };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Pop stash (apply and remove)
|
|
99
|
+
*/
|
|
100
|
+
export async function gitStashPop(input, ctx = {}) {
|
|
101
|
+
const cwd = input.cwd || process.cwd();
|
|
102
|
+
const ref = stashRef(input.index);
|
|
103
|
+
try {
|
|
104
|
+
await git(["stash", "pop", gitArg("ref", ref)], { cwd, signal: ctx.signal });
|
|
105
|
+
return { applied: true, ref, dropped: true };
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
// Check if it's a conflict
|
|
109
|
+
if (isConflict(error)) {
|
|
110
|
+
return { applied: false, ref, dropped: false, conflict: true };
|
|
111
|
+
}
|
|
112
|
+
failure(error);
|
|
113
|
+
return { applied: false, ref, dropped: false };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Apply stash without removing
|
|
118
|
+
*/
|
|
119
|
+
export async function gitStashApply(input, ctx = {}) {
|
|
120
|
+
const cwd = input.cwd || process.cwd();
|
|
121
|
+
const ref = stashRef(input.index);
|
|
122
|
+
try {
|
|
123
|
+
await git(["stash", "apply", gitArg("ref", ref)], { cwd, signal: ctx.signal });
|
|
124
|
+
return { applied: true, ref };
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
if (isConflict(error)) {
|
|
128
|
+
return { applied: false, ref, conflict: true };
|
|
129
|
+
}
|
|
130
|
+
failure(error);
|
|
131
|
+
return { applied: false, ref };
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Drop a stash
|
|
136
|
+
*/
|
|
137
|
+
export async function gitStashDrop(input, ctx = {}) {
|
|
138
|
+
const cwd = input.cwd || process.cwd();
|
|
139
|
+
const ref = stashRef(input.index);
|
|
140
|
+
try {
|
|
141
|
+
await git(["stash", "drop", gitArg("ref", ref)], { cwd, signal: ctx.signal });
|
|
142
|
+
return { dropped: true, ref };
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
failure(error);
|
|
146
|
+
return { dropped: false, ref };
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Export a stash as a patch (for snapshot storage)
|
|
151
|
+
*/
|
|
152
|
+
export async function gitStashExport(input, ctx = {}) {
|
|
153
|
+
const cwd = input.cwd || process.cwd();
|
|
154
|
+
const run = { cwd, signal: ctx.signal };
|
|
155
|
+
const ref = stashRef(input.index);
|
|
156
|
+
try {
|
|
157
|
+
// Get the stash as a patch
|
|
158
|
+
const patch = await git(["stash", "show", "-p", gitArg("ref", ref)], run);
|
|
159
|
+
// Get metadata
|
|
160
|
+
const metadata = (await git(["stash", "list", "-1", "--format=%H%x00%gs", ref], run)).trim();
|
|
161
|
+
const metaParts = metadata.split("\0");
|
|
162
|
+
const hash = metaParts[0] || "";
|
|
163
|
+
const message = metaParts[1] || "";
|
|
164
|
+
// Get untracked files if present (stash^3 contains untracked files if any)
|
|
165
|
+
let untrackedPatch = "";
|
|
166
|
+
try {
|
|
167
|
+
untrackedPatch = await git(["show", `${ref}^3`, "--format=", "--name-only"], run);
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
// No untracked files in this stash
|
|
171
|
+
failure(error);
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
ref,
|
|
175
|
+
hash,
|
|
176
|
+
message,
|
|
177
|
+
patch,
|
|
178
|
+
hasUntracked: untrackedPatch.length > 0,
|
|
179
|
+
untrackedPatch: untrackedPatch || undefined,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
throw new Error(`Failed to export stash ${ref}: ${failure(error)}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Import a stash from a patch (for snapshot restore)
|
|
188
|
+
* Note: This creates a new stash, it doesn't recreate the exact stash state
|
|
189
|
+
*/
|
|
190
|
+
export async function gitStashImport(input, ctx = {}) {
|
|
191
|
+
const cwd = input.cwd || process.cwd();
|
|
192
|
+
const run = { cwd, signal: ctx.signal };
|
|
193
|
+
try {
|
|
194
|
+
// Apply the patch to working directory
|
|
195
|
+
await git(["apply", "--3way"], { ...run, input: input.patch });
|
|
196
|
+
// Stash the changes with the original message
|
|
197
|
+
const message = input.message || "Imported stash";
|
|
198
|
+
const args = ["stash", "push", "-m", message];
|
|
199
|
+
if (input.includeUntracked) {
|
|
200
|
+
args.push("--include-untracked");
|
|
201
|
+
}
|
|
202
|
+
await git(args, run);
|
|
203
|
+
// Get the new stash ref
|
|
204
|
+
const ref = (await git(["stash", "list", "-1", "--format=%gd"], run)).trim();
|
|
205
|
+
return { imported: true, ref: ref || "stash@{0}" };
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
return { imported: false, error: failure(error) || "Failed to import stash" };
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=stash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stash.js","sourceRoot":"","sources":["../../../src/procedures/git/stash.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAC;AAmB1D;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,KAAK,YAAY,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3F,CAAC;AAED,oFAAoF;AACpF,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,CAAC,CAAC,KAAK,YAAY,QAAQ,CAAC;QAAE,MAAM,KAAK,CAAC;IAC9C,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAyB;IACzC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC;AAChE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAwB,EAAE,GAAG,GAAe,EAAE;IAC/E,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAEvC,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,gEAAgE;QAChE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,2BAA2B,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAClG,CAAC;IAAC,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QACf,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,wBAAwB,EAAE,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.status procedure
|
|
3
|
+
*
|
|
4
|
+
* Get git status
|
|
5
|
+
*
|
|
6
|
+
* One call of `git status --porcelain=v2 --branch -z` gives the branch, the ahead and behind
|
|
7
|
+
* counts and the files. With `-z`, git writes each path as it is: no quotes, and a rename gives
|
|
8
|
+
* its old path in a separate field (deep dive WRP-7). Before, the procedure read the quoted form,
|
|
9
|
+
* so a path with a space kept its quotes, and a rename gave the text "old -> new" as the path.
|
|
10
|
+
*/
|
|
11
|
+
import { type GitContext } from "./run.js";
|
|
12
|
+
import type { GitStatusInput, GitStatusOutput } from "../../types.js";
|
|
13
|
+
/**
|
|
14
|
+
* Get git status
|
|
15
|
+
*/
|
|
16
|
+
export declare function gitStatus(input: GitStatusInput, ctx?: GitContext): Promise<GitStatusOutput>;
|
|
17
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/procedures/git/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,gBAAgB,CAAC;AAwBrF;;GAEG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,GAAE,UAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA0DrG"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git.status procedure
|
|
3
|
+
*
|
|
4
|
+
* Get git status
|
|
5
|
+
*
|
|
6
|
+
* One call of `git status --porcelain=v2 --branch -z` gives the branch, the ahead and behind
|
|
7
|
+
* counts and the files. With `-z`, git writes each path as it is: no quotes, and a rename gives
|
|
8
|
+
* its old path in a separate field (deep dive WRP-7). Before, the procedure read the quoted form,
|
|
9
|
+
* so a path with a space kept its quotes, and a rename gave the text "old -> new" as the path.
|
|
10
|
+
*/
|
|
11
|
+
import { git, zFields } from "./run.js";
|
|
12
|
+
/** The status of one entry, from its two status letters (index, then work tree). */
|
|
13
|
+
function classify(xy) {
|
|
14
|
+
const index = xy[0];
|
|
15
|
+
const worktree = xy[1];
|
|
16
|
+
if (index === "A")
|
|
17
|
+
return { status: "added", staged: true };
|
|
18
|
+
if (index === "D")
|
|
19
|
+
return { status: "deleted", staged: true };
|
|
20
|
+
if (index === "R")
|
|
21
|
+
return { status: "renamed", staged: true };
|
|
22
|
+
if (index === "C")
|
|
23
|
+
return { status: "copied", staged: true };
|
|
24
|
+
if (index === "M" || index === "T")
|
|
25
|
+
return { status: "modified", staged: true };
|
|
26
|
+
if (worktree === "D")
|
|
27
|
+
return { status: "deleted", staged: false };
|
|
28
|
+
if (worktree === "A")
|
|
29
|
+
return { status: "added", staged: false };
|
|
30
|
+
if (worktree === "R")
|
|
31
|
+
return { status: "renamed", staged: false };
|
|
32
|
+
return { status: "modified", staged: false };
|
|
33
|
+
}
|
|
34
|
+
/** The text after the first `count` space-separated fields of a line. */
|
|
35
|
+
function afterFields(line, count) {
|
|
36
|
+
let at = 0;
|
|
37
|
+
for (let i = 0; i < count; i++)
|
|
38
|
+
at = line.indexOf(" ", at) + 1;
|
|
39
|
+
return line.slice(at);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get git status
|
|
43
|
+
*/
|
|
44
|
+
export async function gitStatus(input, ctx = {}) {
|
|
45
|
+
const output = await git(["status", "--porcelain=v2", "--branch", "-z"], { cwd: input.cwd, signal: ctx.signal });
|
|
46
|
+
let branch = "HEAD";
|
|
47
|
+
let ahead = 0;
|
|
48
|
+
let behind = 0;
|
|
49
|
+
const files = [];
|
|
50
|
+
const lines = [];
|
|
51
|
+
const fields = zFields(output);
|
|
52
|
+
for (let i = 0; i < fields.length; i++) {
|
|
53
|
+
const field = fields[i];
|
|
54
|
+
if (field.startsWith("# branch.head ")) {
|
|
55
|
+
const head = field.slice("# branch.head ".length);
|
|
56
|
+
branch = head === "(detached)" ? "HEAD" : head;
|
|
57
|
+
}
|
|
58
|
+
else if (field.startsWith("# branch.ab ")) {
|
|
59
|
+
const match = /\+(\d+) -(\d+)/.exec(field);
|
|
60
|
+
ahead = Number(match?.[1] ?? 0);
|
|
61
|
+
behind = Number(match?.[2] ?? 0);
|
|
62
|
+
}
|
|
63
|
+
else if (field.startsWith("1 ")) {
|
|
64
|
+
// 1 XY sub mH mI mW hH hI path
|
|
65
|
+
const xy = field.slice(2, 4);
|
|
66
|
+
const path = afterFields(field, 8);
|
|
67
|
+
files.push({ path, ...classify(xy) });
|
|
68
|
+
lines.push(`${xy.replace(/\./g, " ")} ${path}`);
|
|
69
|
+
}
|
|
70
|
+
else if (field.startsWith("2 ")) {
|
|
71
|
+
// 2 XY sub mH mI mW hH hI Xscore path, then the old path in the next field
|
|
72
|
+
const xy = field.slice(2, 4);
|
|
73
|
+
const path = afterFields(field, 9);
|
|
74
|
+
const from = fields[++i] ?? "";
|
|
75
|
+
files.push({ path, from, ...classify(xy) });
|
|
76
|
+
lines.push(`${xy.replace(/\./g, " ")} ${from} -> ${path}`);
|
|
77
|
+
}
|
|
78
|
+
else if (field.startsWith("u ")) {
|
|
79
|
+
// An unmerged path: u XY sub m1 m2 m3 mW h1 h2 h3 path
|
|
80
|
+
const xy = field.slice(2, 4);
|
|
81
|
+
const path = afterFields(field, 10);
|
|
82
|
+
files.push({ path, status: "modified", staged: false });
|
|
83
|
+
lines.push(`${xy} ${path}`);
|
|
84
|
+
}
|
|
85
|
+
else if (field.startsWith("? ")) {
|
|
86
|
+
const path = field.slice(2);
|
|
87
|
+
files.push({ path, status: "untracked", staged: false });
|
|
88
|
+
lines.push(`?? ${path}`);
|
|
89
|
+
}
|
|
90
|
+
else if (field.startsWith("! ")) {
|
|
91
|
+
const path = field.slice(2);
|
|
92
|
+
files.push({ path, status: "ignored", staged: false });
|
|
93
|
+
lines.push(`!! ${path}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const result = {
|
|
97
|
+
branch,
|
|
98
|
+
ahead,
|
|
99
|
+
behind,
|
|
100
|
+
files,
|
|
101
|
+
clean: files.length === 0,
|
|
102
|
+
};
|
|
103
|
+
if (input.short)
|
|
104
|
+
result.lines = lines;
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/procedures/git/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,GAAG,EAAE,OAAO,EAAmB,MAAM,UAAU,CAAC;AAGzD,oFAAoF;AACpF,SAAS,QAAQ,CAAC,EAAU;IAC1B,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC5D,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9D,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9D,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7D,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,E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AAC,CAAC;QAC3B,CAAC;aAAM,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5B,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;YACvD,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAoB;QAC9B,MAAM;QACN,KAAK;QACL,MAAM;QACN,KAAK;QACL,KAAK,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC;KAC1B,CAAC;IACF,IAAI,KAAK,CAAC,KAAK;QAAE,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACtC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/procedures/git.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/procedures/git.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC"}
|