gitx.do 0.1.0 → 0.1.2
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/README.md +40 -353
- package/dist/do/logger.d.ts +50 -0
- package/dist/do/logger.d.ts.map +1 -0
- package/dist/do/logger.js +122 -0
- package/dist/do/logger.js.map +1 -0
- package/dist/{durable-object → do}/schema.d.ts +3 -3
- package/dist/do/schema.d.ts.map +1 -0
- package/dist/{durable-object → do}/schema.js +4 -3
- package/dist/do/schema.js.map +1 -0
- package/dist/do/types.d.ts +267 -0
- package/dist/do/types.d.ts.map +1 -0
- package/dist/do/types.js +62 -0
- package/dist/do/types.js.map +1 -0
- package/dist/index.d.ts +15 -415
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -483
- package/dist/index.js.map +1 -1
- package/package.json +13 -21
- package/dist/cli/commands/add.d.ts +0 -174
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -131
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/blame.d.ts +0 -259
- package/dist/cli/commands/blame.d.ts.map +0 -1
- package/dist/cli/commands/blame.js +0 -609
- package/dist/cli/commands/blame.js.map +0 -1
- package/dist/cli/commands/branch.d.ts +0 -249
- package/dist/cli/commands/branch.d.ts.map +0 -1
- package/dist/cli/commands/branch.js +0 -693
- package/dist/cli/commands/branch.js.map +0 -1
- package/dist/cli/commands/commit.d.ts +0 -182
- package/dist/cli/commands/commit.d.ts.map +0 -1
- package/dist/cli/commands/commit.js +0 -437
- package/dist/cli/commands/commit.js.map +0 -1
- package/dist/cli/commands/diff.d.ts +0 -464
- package/dist/cli/commands/diff.d.ts.map +0 -1
- package/dist/cli/commands/diff.js +0 -958
- package/dist/cli/commands/diff.js.map +0 -1
- package/dist/cli/commands/log.d.ts +0 -239
- package/dist/cli/commands/log.d.ts.map +0 -1
- package/dist/cli/commands/log.js +0 -535
- package/dist/cli/commands/log.js.map +0 -1
- package/dist/cli/commands/merge.d.ts +0 -106
- package/dist/cli/commands/merge.d.ts.map +0 -1
- package/dist/cli/commands/merge.js +0 -55
- package/dist/cli/commands/merge.js.map +0 -1
- package/dist/cli/commands/review.d.ts +0 -457
- package/dist/cli/commands/review.d.ts.map +0 -1
- package/dist/cli/commands/review.js +0 -533
- package/dist/cli/commands/review.js.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -269
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js +0 -493
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/web.d.ts +0 -199
- package/dist/cli/commands/web.d.ts.map +0 -1
- package/dist/cli/commands/web.js +0 -696
- package/dist/cli/commands/web.js.map +0 -1
- package/dist/cli/fs-adapter.d.ts +0 -656
- package/dist/cli/fs-adapter.d.ts.map +0 -1
- package/dist/cli/fs-adapter.js +0 -1179
- package/dist/cli/fs-adapter.js.map +0 -1
- package/dist/cli/fsx-cli-adapter.d.ts +0 -359
- package/dist/cli/fsx-cli-adapter.d.ts.map +0 -1
- package/dist/cli/fsx-cli-adapter.js +0 -619
- package/dist/cli/fsx-cli-adapter.js.map +0 -1
- package/dist/cli/index.d.ts +0 -387
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -523
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/ui/components/DiffView.d.ts +0 -7
- package/dist/cli/ui/components/DiffView.d.ts.map +0 -1
- package/dist/cli/ui/components/DiffView.js +0 -11
- package/dist/cli/ui/components/DiffView.js.map +0 -1
- package/dist/cli/ui/components/ErrorDisplay.d.ts +0 -6
- package/dist/cli/ui/components/ErrorDisplay.d.ts.map +0 -1
- package/dist/cli/ui/components/ErrorDisplay.js +0 -11
- package/dist/cli/ui/components/ErrorDisplay.js.map +0 -1
- package/dist/cli/ui/components/FuzzySearch.d.ts +0 -9
- package/dist/cli/ui/components/FuzzySearch.d.ts.map +0 -1
- package/dist/cli/ui/components/FuzzySearch.js +0 -12
- package/dist/cli/ui/components/FuzzySearch.js.map +0 -1
- package/dist/cli/ui/components/LoadingSpinner.d.ts +0 -6
- package/dist/cli/ui/components/LoadingSpinner.d.ts.map +0 -1
- package/dist/cli/ui/components/LoadingSpinner.js +0 -10
- package/dist/cli/ui/components/LoadingSpinner.js.map +0 -1
- package/dist/cli/ui/components/NavigationList.d.ts +0 -9
- package/dist/cli/ui/components/NavigationList.d.ts.map +0 -1
- package/dist/cli/ui/components/NavigationList.js +0 -11
- package/dist/cli/ui/components/NavigationList.js.map +0 -1
- package/dist/cli/ui/components/ScrollableContent.d.ts +0 -8
- package/dist/cli/ui/components/ScrollableContent.d.ts.map +0 -1
- package/dist/cli/ui/components/ScrollableContent.js +0 -11
- package/dist/cli/ui/components/ScrollableContent.js.map +0 -1
- package/dist/cli/ui/components/index.d.ts +0 -7
- package/dist/cli/ui/components/index.d.ts.map +0 -1
- package/dist/cli/ui/components/index.js +0 -9
- package/dist/cli/ui/components/index.js.map +0 -1
- package/dist/cli/ui/terminal-ui.d.ts +0 -52
- package/dist/cli/ui/terminal-ui.d.ts.map +0 -1
- package/dist/cli/ui/terminal-ui.js +0 -121
- package/dist/cli/ui/terminal-ui.js.map +0 -1
- package/dist/do/BashModule.d.ts +0 -871
- package/dist/do/BashModule.d.ts.map +0 -1
- package/dist/do/BashModule.js +0 -1143
- package/dist/do/BashModule.js.map +0 -1
- package/dist/do/FsModule.d.ts +0 -601
- package/dist/do/FsModule.d.ts.map +0 -1
- package/dist/do/FsModule.js +0 -1120
- package/dist/do/FsModule.js.map +0 -1
- package/dist/do/GitModule.d.ts +0 -635
- package/dist/do/GitModule.d.ts.map +0 -1
- package/dist/do/GitModule.js +0 -781
- package/dist/do/GitModule.js.map +0 -1
- package/dist/do/GitRepoDO.d.ts +0 -281
- package/dist/do/GitRepoDO.d.ts.map +0 -1
- package/dist/do/GitRepoDO.js +0 -479
- package/dist/do/GitRepoDO.js.map +0 -1
- package/dist/do/bash-ast.d.ts +0 -246
- package/dist/do/bash-ast.d.ts.map +0 -1
- package/dist/do/bash-ast.js +0 -888
- package/dist/do/bash-ast.js.map +0 -1
- package/dist/do/container-executor.d.ts +0 -491
- package/dist/do/container-executor.d.ts.map +0 -1
- package/dist/do/container-executor.js +0 -730
- package/dist/do/container-executor.js.map +0 -1
- package/dist/do/index.d.ts +0 -53
- package/dist/do/index.d.ts.map +0 -1
- package/dist/do/index.js +0 -91
- package/dist/do/index.js.map +0 -1
- package/dist/do/tiered-storage.d.ts +0 -403
- package/dist/do/tiered-storage.d.ts.map +0 -1
- package/dist/do/tiered-storage.js +0 -689
- package/dist/do/tiered-storage.js.map +0 -1
- package/dist/do/withBash.d.ts +0 -231
- package/dist/do/withBash.d.ts.map +0 -1
- package/dist/do/withBash.js +0 -244
- package/dist/do/withBash.js.map +0 -1
- package/dist/do/withFs.d.ts +0 -237
- package/dist/do/withFs.d.ts.map +0 -1
- package/dist/do/withFs.js +0 -387
- package/dist/do/withFs.js.map +0 -1
- package/dist/do/withGit.d.ts +0 -180
- package/dist/do/withGit.d.ts.map +0 -1
- package/dist/do/withGit.js +0 -271
- package/dist/do/withGit.js.map +0 -1
- package/dist/durable-object/object-store.d.ts +0 -633
- package/dist/durable-object/object-store.d.ts.map +0 -1
- package/dist/durable-object/object-store.js +0 -1161
- package/dist/durable-object/object-store.js.map +0 -1
- package/dist/durable-object/schema.d.ts.map +0 -1
- package/dist/durable-object/schema.js.map +0 -1
- package/dist/durable-object/wal.d.ts +0 -416
- package/dist/durable-object/wal.d.ts.map +0 -1
- package/dist/durable-object/wal.js +0 -445
- package/dist/durable-object/wal.js.map +0 -1
- package/dist/mcp/adapter.d.ts +0 -772
- package/dist/mcp/adapter.d.ts.map +0 -1
- package/dist/mcp/adapter.js +0 -895
- package/dist/mcp/adapter.js.map +0 -1
- package/dist/mcp/sandbox/miniflare-evaluator.d.ts +0 -22
- package/dist/mcp/sandbox/miniflare-evaluator.d.ts.map +0 -1
- package/dist/mcp/sandbox/miniflare-evaluator.js +0 -140
- package/dist/mcp/sandbox/miniflare-evaluator.js.map +0 -1
- package/dist/mcp/sandbox/object-store-proxy.d.ts +0 -32
- package/dist/mcp/sandbox/object-store-proxy.d.ts.map +0 -1
- package/dist/mcp/sandbox/object-store-proxy.js +0 -30
- package/dist/mcp/sandbox/object-store-proxy.js.map +0 -1
- package/dist/mcp/sandbox/template.d.ts +0 -17
- package/dist/mcp/sandbox/template.d.ts.map +0 -1
- package/dist/mcp/sandbox/template.js +0 -71
- package/dist/mcp/sandbox/template.js.map +0 -1
- package/dist/mcp/sandbox.d.ts +0 -764
- package/dist/mcp/sandbox.d.ts.map +0 -1
- package/dist/mcp/sandbox.js +0 -1362
- package/dist/mcp/sandbox.js.map +0 -1
- package/dist/mcp/sdk-adapter.d.ts +0 -835
- package/dist/mcp/sdk-adapter.d.ts.map +0 -1
- package/dist/mcp/sdk-adapter.js +0 -974
- package/dist/mcp/sdk-adapter.js.map +0 -1
- package/dist/mcp/tools/do.d.ts +0 -32
- package/dist/mcp/tools/do.d.ts.map +0 -1
- package/dist/mcp/tools/do.js +0 -115
- package/dist/mcp/tools/do.js.map +0 -1
- package/dist/mcp/tools.d.ts +0 -548
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js +0 -1934
- package/dist/mcp/tools.js.map +0 -1
- package/dist/ops/blame.d.ts +0 -551
- package/dist/ops/blame.d.ts.map +0 -1
- package/dist/ops/blame.js +0 -1037
- package/dist/ops/blame.js.map +0 -1
- package/dist/ops/branch.d.ts +0 -766
- package/dist/ops/branch.d.ts.map +0 -1
- package/dist/ops/branch.js +0 -950
- package/dist/ops/branch.js.map +0 -1
- package/dist/ops/commit-traversal.d.ts +0 -349
- package/dist/ops/commit-traversal.d.ts.map +0 -1
- package/dist/ops/commit-traversal.js +0 -821
- package/dist/ops/commit-traversal.js.map +0 -1
- package/dist/ops/commit.d.ts +0 -555
- package/dist/ops/commit.d.ts.map +0 -1
- package/dist/ops/commit.js +0 -826
- package/dist/ops/commit.js.map +0 -1
- package/dist/ops/merge-base.d.ts +0 -397
- package/dist/ops/merge-base.d.ts.map +0 -1
- package/dist/ops/merge-base.js +0 -691
- package/dist/ops/merge-base.js.map +0 -1
- package/dist/ops/merge.d.ts +0 -855
- package/dist/ops/merge.d.ts.map +0 -1
- package/dist/ops/merge.js +0 -1551
- package/dist/ops/merge.js.map +0 -1
- package/dist/ops/tag.d.ts +0 -247
- package/dist/ops/tag.d.ts.map +0 -1
- package/dist/ops/tag.js +0 -649
- package/dist/ops/tag.js.map +0 -1
- package/dist/ops/tree-builder.d.ts +0 -178
- package/dist/ops/tree-builder.d.ts.map +0 -1
- package/dist/ops/tree-builder.js +0 -271
- package/dist/ops/tree-builder.js.map +0 -1
- package/dist/ops/tree-diff.d.ts +0 -291
- package/dist/ops/tree-diff.d.ts.map +0 -1
- package/dist/ops/tree-diff.js +0 -705
- package/dist/ops/tree-diff.js.map +0 -1
- package/dist/pack/delta.d.ts +0 -248
- package/dist/pack/delta.d.ts.map +0 -1
- package/dist/pack/delta.js +0 -736
- package/dist/pack/delta.js.map +0 -1
- package/dist/pack/format.d.ts +0 -446
- package/dist/pack/format.d.ts.map +0 -1
- package/dist/pack/format.js +0 -572
- package/dist/pack/format.js.map +0 -1
- package/dist/pack/full-generation.d.ts +0 -612
- package/dist/pack/full-generation.d.ts.map +0 -1
- package/dist/pack/full-generation.js +0 -1378
- package/dist/pack/full-generation.js.map +0 -1
- package/dist/pack/generation.d.ts +0 -441
- package/dist/pack/generation.d.ts.map +0 -1
- package/dist/pack/generation.js +0 -707
- package/dist/pack/generation.js.map +0 -1
- package/dist/pack/index.d.ts +0 -502
- package/dist/pack/index.d.ts.map +0 -1
- package/dist/pack/index.js +0 -833
- package/dist/pack/index.js.map +0 -1
- package/dist/refs/branch.d.ts +0 -668
- package/dist/refs/branch.d.ts.map +0 -1
- package/dist/refs/branch.js +0 -897
- package/dist/refs/branch.js.map +0 -1
- package/dist/refs/storage.d.ts +0 -833
- package/dist/refs/storage.d.ts.map +0 -1
- package/dist/refs/storage.js +0 -1023
- package/dist/refs/storage.js.map +0 -1
- package/dist/refs/tag.d.ts +0 -860
- package/dist/refs/tag.d.ts.map +0 -1
- package/dist/refs/tag.js +0 -996
- package/dist/refs/tag.js.map +0 -1
- package/dist/storage/backend.d.ts +0 -425
- package/dist/storage/backend.d.ts.map +0 -1
- package/dist/storage/backend.js +0 -41
- package/dist/storage/backend.js.map +0 -1
- package/dist/storage/fsx-adapter.d.ts +0 -204
- package/dist/storage/fsx-adapter.d.ts.map +0 -1
- package/dist/storage/fsx-adapter.js +0 -470
- package/dist/storage/fsx-adapter.js.map +0 -1
- package/dist/storage/lru-cache.d.ts +0 -691
- package/dist/storage/lru-cache.d.ts.map +0 -1
- package/dist/storage/lru-cache.js +0 -813
- package/dist/storage/lru-cache.js.map +0 -1
- package/dist/storage/object-index.d.ts +0 -585
- package/dist/storage/object-index.d.ts.map +0 -1
- package/dist/storage/object-index.js +0 -532
- package/dist/storage/object-index.js.map +0 -1
- package/dist/storage/r2-pack.d.ts +0 -1257
- package/dist/storage/r2-pack.d.ts.map +0 -1
- package/dist/storage/r2-pack.js +0 -1770
- package/dist/storage/r2-pack.js.map +0 -1
- package/dist/tiered/cdc-pipeline.d.ts +0 -1888
- package/dist/tiered/cdc-pipeline.d.ts.map +0 -1
- package/dist/tiered/cdc-pipeline.js +0 -1880
- package/dist/tiered/cdc-pipeline.js.map +0 -1
- package/dist/tiered/migration.d.ts +0 -1104
- package/dist/tiered/migration.d.ts.map +0 -1
- package/dist/tiered/migration.js +0 -1214
- package/dist/tiered/migration.js.map +0 -1
- package/dist/tiered/parquet-writer.d.ts +0 -1145
- package/dist/tiered/parquet-writer.d.ts.map +0 -1
- package/dist/tiered/parquet-writer.js +0 -1183
- package/dist/tiered/parquet-writer.js.map +0 -1
- package/dist/tiered/read-path.d.ts +0 -835
- package/dist/tiered/read-path.d.ts.map +0 -1
- package/dist/tiered/read-path.js +0 -487
- package/dist/tiered/read-path.js.map +0 -1
- package/dist/types/capability.d.ts +0 -1385
- package/dist/types/capability.d.ts.map +0 -1
- package/dist/types/capability.js +0 -36
- package/dist/types/capability.js.map +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -18
- package/dist/types/index.js.map +0 -1
- package/dist/types/objects.d.ts +0 -692
- package/dist/types/objects.d.ts.map +0 -1
- package/dist/types/objects.js +0 -837
- package/dist/types/objects.js.map +0 -1
- package/dist/types/storage.d.ts +0 -603
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/storage.js +0 -191
- package/dist/types/storage.js.map +0 -1
- package/dist/types/worker-loader.d.ts +0 -60
- package/dist/types/worker-loader.d.ts.map +0 -1
- package/dist/types/worker-loader.js +0 -62
- package/dist/types/worker-loader.js.map +0 -1
- package/dist/utils/hash.d.ts +0 -197
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/hash.js +0 -268
- package/dist/utils/hash.js.map +0 -1
- package/dist/utils/sha1.d.ts +0 -290
- package/dist/utils/sha1.d.ts.map +0 -1
- package/dist/utils/sha1.js +0 -582
- package/dist/utils/sha1.js.map +0 -1
- package/dist/wire/capabilities.d.ts +0 -1044
- package/dist/wire/capabilities.d.ts.map +0 -1
- package/dist/wire/capabilities.js +0 -941
- package/dist/wire/capabilities.js.map +0 -1
- package/dist/wire/path-security.d.ts +0 -157
- package/dist/wire/path-security.d.ts.map +0 -1
- package/dist/wire/path-security.js +0 -307
- package/dist/wire/path-security.js.map +0 -1
- package/dist/wire/pkt-line.d.ts +0 -345
- package/dist/wire/pkt-line.d.ts.map +0 -1
- package/dist/wire/pkt-line.js +0 -381
- package/dist/wire/pkt-line.js.map +0 -1
- package/dist/wire/receive-pack.d.ts +0 -1059
- package/dist/wire/receive-pack.d.ts.map +0 -1
- package/dist/wire/receive-pack.js +0 -1414
- package/dist/wire/receive-pack.js.map +0 -1
- package/dist/wire/smart-http.d.ts +0 -799
- package/dist/wire/smart-http.d.ts.map +0 -1
- package/dist/wire/smart-http.js +0 -945
- package/dist/wire/smart-http.js.map +0 -1
- package/dist/wire/upload-pack.d.ts +0 -727
- package/dist/wire/upload-pack.d.ts.map +0 -1
- package/dist/wire/upload-pack.js +0 -1138
- package/dist/wire/upload-pack.js.map +0 -1
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview gitx add command
|
|
3
|
-
*
|
|
4
|
-
* This module implements the `gitx add` command which adds files to the
|
|
5
|
-
* staging area (index). It supports:
|
|
6
|
-
* - Adding single files
|
|
7
|
-
* - Adding multiple files
|
|
8
|
-
* - Adding directories recursively
|
|
9
|
-
* - Glob pattern matching
|
|
10
|
-
* - Adding all files (-A or --all)
|
|
11
|
-
* - Updating tracked files only (-u or --update)
|
|
12
|
-
* - Dry run mode (-n or --dry-run)
|
|
13
|
-
* - Verbose output (-v or --verbose)
|
|
14
|
-
*
|
|
15
|
-
* @module cli/commands/add
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* // Add a single file
|
|
19
|
-
* await addFiles(cwd, ['file.txt'])
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // Add all files
|
|
23
|
-
* await addAll(cwd)
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* // Dry run to see what would be added
|
|
27
|
-
* await addDryRun(cwd, ['*.ts'])
|
|
28
|
-
*/
|
|
29
|
-
import type { CommandContext } from '../index';
|
|
30
|
-
/**
|
|
31
|
-
* Options for the add command.
|
|
32
|
-
*
|
|
33
|
-
* @description Configuration options that control the behavior
|
|
34
|
-
* of the add command.
|
|
35
|
-
*/
|
|
36
|
-
export interface AddOptions {
|
|
37
|
-
/** Force add ignored files */
|
|
38
|
-
force?: boolean;
|
|
39
|
-
/** Show what would be added without actually adding */
|
|
40
|
-
dryRun?: boolean;
|
|
41
|
-
/** Show verbose output */
|
|
42
|
-
verbose?: boolean;
|
|
43
|
-
/** Record only the fact that the path will be added later */
|
|
44
|
-
intentToAdd?: boolean;
|
|
45
|
-
/** Update tracked files only (like git add -u) */
|
|
46
|
-
update?: boolean;
|
|
47
|
-
/** Add all files including untracked (like git add -A) */
|
|
48
|
-
all?: boolean;
|
|
49
|
-
/** Exclude patterns */
|
|
50
|
-
exclude?: string[];
|
|
51
|
-
/** Refresh index stat information */
|
|
52
|
-
refresh?: boolean;
|
|
53
|
-
/** Interactive patch mode */
|
|
54
|
-
patch?: boolean;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Result of an add operation.
|
|
58
|
-
*
|
|
59
|
-
* @description Contains lists of files that were added, deleted,
|
|
60
|
-
* or unchanged, plus detailed file information.
|
|
61
|
-
*/
|
|
62
|
-
export interface AddResult {
|
|
63
|
-
/** Files that were successfully added to the index */
|
|
64
|
-
added: string[];
|
|
65
|
-
/** Files that were staged for deletion */
|
|
66
|
-
deleted: string[];
|
|
67
|
-
/** Files that were already staged with no changes */
|
|
68
|
-
unchanged: string[];
|
|
69
|
-
/** Files that would be added (for dry-run mode) */
|
|
70
|
-
wouldAdd: string[];
|
|
71
|
-
/** Files marked as intent-to-add */
|
|
72
|
-
intentToAdd: string[];
|
|
73
|
-
/** Detailed file information */
|
|
74
|
-
files: FileToAdd[];
|
|
75
|
-
/** Total count of files affected */
|
|
76
|
-
count: number;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Information about a file to be added.
|
|
80
|
-
*
|
|
81
|
-
* @description Contains the path, computed SHA, and file mode
|
|
82
|
-
* for a file being staged.
|
|
83
|
-
*/
|
|
84
|
-
export interface FileToAdd {
|
|
85
|
-
/** File path relative to repository root */
|
|
86
|
-
path: string;
|
|
87
|
-
/** SHA-1 hash of the file content */
|
|
88
|
-
sha: string;
|
|
89
|
-
/** File mode (100644 for regular, 100755 for executable, 120000 for symlink) */
|
|
90
|
-
mode: number;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Handler for the gitx add command.
|
|
94
|
-
*
|
|
95
|
-
* @description Processes command-line arguments and adds files to the staging area.
|
|
96
|
-
*
|
|
97
|
-
* @param ctx - Command context with cwd, args, options
|
|
98
|
-
* @throws Error if not in a git repository or files not found
|
|
99
|
-
*/
|
|
100
|
-
export declare function addCommand(ctx: CommandContext): Promise<void>;
|
|
101
|
-
/**
|
|
102
|
-
* Add specified files to the staging area.
|
|
103
|
-
*
|
|
104
|
-
* @description Adds the given files or patterns to the git index.
|
|
105
|
-
* Supports glob patterns and directories.
|
|
106
|
-
*
|
|
107
|
-
* @param cwd - Working directory (repository root)
|
|
108
|
-
* @param paths - File paths or patterns to add
|
|
109
|
-
* @param options - Add options
|
|
110
|
-
* @returns AddResult with added files information
|
|
111
|
-
* @throws Error if not in a git repository or files not found
|
|
112
|
-
*/
|
|
113
|
-
export declare function addFiles(cwd: string, paths: string[], options?: AddOptions): Promise<AddResult>;
|
|
114
|
-
/**
|
|
115
|
-
* Add all files to the staging area (like git add -A).
|
|
116
|
-
*
|
|
117
|
-
* @description Adds all untracked, modified, and deleted files
|
|
118
|
-
* to the staging area.
|
|
119
|
-
*
|
|
120
|
-
* @param cwd - Working directory (repository root)
|
|
121
|
-
* @param options - Add options
|
|
122
|
-
* @returns AddResult with added files information
|
|
123
|
-
* @throws Error if not in a git repository
|
|
124
|
-
*/
|
|
125
|
-
export declare function addAll(cwd: string, options?: AddOptions): Promise<AddResult>;
|
|
126
|
-
/**
|
|
127
|
-
* Update tracked files only (like git add -u).
|
|
128
|
-
*
|
|
129
|
-
* @description Stages modifications and deletions of tracked files only.
|
|
130
|
-
* Does not add untracked files.
|
|
131
|
-
*
|
|
132
|
-
* @param cwd - Working directory (repository root)
|
|
133
|
-
* @param options - Add options
|
|
134
|
-
* @returns AddResult with updated files information
|
|
135
|
-
* @throws Error if not in a git repository
|
|
136
|
-
*/
|
|
137
|
-
export declare function addUpdate(cwd: string, options?: AddOptions): Promise<AddResult>;
|
|
138
|
-
/**
|
|
139
|
-
* Dry run to show what would be added.
|
|
140
|
-
*
|
|
141
|
-
* @description Shows what files would be added without actually
|
|
142
|
-
* modifying the index.
|
|
143
|
-
*
|
|
144
|
-
* @param cwd - Working directory (repository root)
|
|
145
|
-
* @param paths - File paths or patterns to check
|
|
146
|
-
* @param options - Add options
|
|
147
|
-
* @returns AddResult with wouldAdd populated
|
|
148
|
-
* @throws Error if not in a git repository
|
|
149
|
-
*/
|
|
150
|
-
export declare function addDryRun(cwd: string, paths: string[], options?: AddOptions): Promise<AddResult>;
|
|
151
|
-
/**
|
|
152
|
-
* Get list of files that would be added for given paths.
|
|
153
|
-
*
|
|
154
|
-
* @description Resolves paths and glob patterns to a list of files
|
|
155
|
-
* that would be added to the index.
|
|
156
|
-
*
|
|
157
|
-
* @param cwd - Working directory (repository root)
|
|
158
|
-
* @param paths - File paths or patterns
|
|
159
|
-
* @param options - Add options including exclude patterns
|
|
160
|
-
* @returns Array of FileToAdd objects
|
|
161
|
-
* @throws Error if not in a git repository
|
|
162
|
-
*/
|
|
163
|
-
export declare function getFilesToAdd(cwd: string, paths: string[], options?: AddOptions): Promise<FileToAdd[]>;
|
|
164
|
-
/**
|
|
165
|
-
* Match a file path against a glob pattern.
|
|
166
|
-
*
|
|
167
|
-
* @description Utility function to test if a path matches a glob pattern.
|
|
168
|
-
*
|
|
169
|
-
* @param filePath - File path to test
|
|
170
|
-
* @param pattern - Glob pattern to match against
|
|
171
|
-
* @returns true if the path matches the pattern
|
|
172
|
-
*/
|
|
173
|
-
export declare function matchGlobPattern(filePath: string, pattern: string): boolean;
|
|
174
|
-
//# sourceMappingURL=add.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAM9C;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,sDAAsD;IACtD,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,0CAA0C;IAC1C,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,qDAAqD;IACrD,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,oCAAoC;IACpC,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,gCAAgC;IAChC,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAA;CACb;AAMD;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE;AAMD;;;;;;;;;;;GAWG;AACH,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,SAAS,CAAC,CAEpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,MAAM,CAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,SAAS,CAAC,CAEpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,SAAS,CAAC,CAEpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,SAAS,CAAC,CAEpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,SAAS,EAAE,CAAC,CAEtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE3E"}
|
package/dist/cli/commands/add.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview gitx add command
|
|
3
|
-
*
|
|
4
|
-
* This module implements the `gitx add` command which adds files to the
|
|
5
|
-
* staging area (index). It supports:
|
|
6
|
-
* - Adding single files
|
|
7
|
-
* - Adding multiple files
|
|
8
|
-
* - Adding directories recursively
|
|
9
|
-
* - Glob pattern matching
|
|
10
|
-
* - Adding all files (-A or --all)
|
|
11
|
-
* - Updating tracked files only (-u or --update)
|
|
12
|
-
* - Dry run mode (-n or --dry-run)
|
|
13
|
-
* - Verbose output (-v or --verbose)
|
|
14
|
-
*
|
|
15
|
-
* @module cli/commands/add
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* // Add a single file
|
|
19
|
-
* await addFiles(cwd, ['file.txt'])
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // Add all files
|
|
23
|
-
* await addAll(cwd)
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* // Dry run to see what would be added
|
|
27
|
-
* await addDryRun(cwd, ['*.ts'])
|
|
28
|
-
*/
|
|
29
|
-
// ============================================================================
|
|
30
|
-
// Command Handler
|
|
31
|
-
// ============================================================================
|
|
32
|
-
/**
|
|
33
|
-
* Handler for the gitx add command.
|
|
34
|
-
*
|
|
35
|
-
* @description Processes command-line arguments and adds files to the staging area.
|
|
36
|
-
*
|
|
37
|
-
* @param ctx - Command context with cwd, args, options
|
|
38
|
-
* @throws Error if not in a git repository or files not found
|
|
39
|
-
*/
|
|
40
|
-
export async function addCommand(ctx) {
|
|
41
|
-
throw new Error('Not implemented: addCommand');
|
|
42
|
-
}
|
|
43
|
-
// ============================================================================
|
|
44
|
-
// Core Functions
|
|
45
|
-
// ============================================================================
|
|
46
|
-
/**
|
|
47
|
-
* Add specified files to the staging area.
|
|
48
|
-
*
|
|
49
|
-
* @description Adds the given files or patterns to the git index.
|
|
50
|
-
* Supports glob patterns and directories.
|
|
51
|
-
*
|
|
52
|
-
* @param cwd - Working directory (repository root)
|
|
53
|
-
* @param paths - File paths or patterns to add
|
|
54
|
-
* @param options - Add options
|
|
55
|
-
* @returns AddResult with added files information
|
|
56
|
-
* @throws Error if not in a git repository or files not found
|
|
57
|
-
*/
|
|
58
|
-
export async function addFiles(cwd, paths, options = {}) {
|
|
59
|
-
throw new Error('Not implemented: addFiles');
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Add all files to the staging area (like git add -A).
|
|
63
|
-
*
|
|
64
|
-
* @description Adds all untracked, modified, and deleted files
|
|
65
|
-
* to the staging area.
|
|
66
|
-
*
|
|
67
|
-
* @param cwd - Working directory (repository root)
|
|
68
|
-
* @param options - Add options
|
|
69
|
-
* @returns AddResult with added files information
|
|
70
|
-
* @throws Error if not in a git repository
|
|
71
|
-
*/
|
|
72
|
-
export async function addAll(cwd, options = {}) {
|
|
73
|
-
throw new Error('Not implemented: addAll');
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Update tracked files only (like git add -u).
|
|
77
|
-
*
|
|
78
|
-
* @description Stages modifications and deletions of tracked files only.
|
|
79
|
-
* Does not add untracked files.
|
|
80
|
-
*
|
|
81
|
-
* @param cwd - Working directory (repository root)
|
|
82
|
-
* @param options - Add options
|
|
83
|
-
* @returns AddResult with updated files information
|
|
84
|
-
* @throws Error if not in a git repository
|
|
85
|
-
*/
|
|
86
|
-
export async function addUpdate(cwd, options = {}) {
|
|
87
|
-
throw new Error('Not implemented: addUpdate');
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Dry run to show what would be added.
|
|
91
|
-
*
|
|
92
|
-
* @description Shows what files would be added without actually
|
|
93
|
-
* modifying the index.
|
|
94
|
-
*
|
|
95
|
-
* @param cwd - Working directory (repository root)
|
|
96
|
-
* @param paths - File paths or patterns to check
|
|
97
|
-
* @param options - Add options
|
|
98
|
-
* @returns AddResult with wouldAdd populated
|
|
99
|
-
* @throws Error if not in a git repository
|
|
100
|
-
*/
|
|
101
|
-
export async function addDryRun(cwd, paths, options = {}) {
|
|
102
|
-
throw new Error('Not implemented: addDryRun');
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Get list of files that would be added for given paths.
|
|
106
|
-
*
|
|
107
|
-
* @description Resolves paths and glob patterns to a list of files
|
|
108
|
-
* that would be added to the index.
|
|
109
|
-
*
|
|
110
|
-
* @param cwd - Working directory (repository root)
|
|
111
|
-
* @param paths - File paths or patterns
|
|
112
|
-
* @param options - Add options including exclude patterns
|
|
113
|
-
* @returns Array of FileToAdd objects
|
|
114
|
-
* @throws Error if not in a git repository
|
|
115
|
-
*/
|
|
116
|
-
export async function getFilesToAdd(cwd, paths, options = {}) {
|
|
117
|
-
throw new Error('Not implemented: getFilesToAdd');
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Match a file path against a glob pattern.
|
|
121
|
-
*
|
|
122
|
-
* @description Utility function to test if a path matches a glob pattern.
|
|
123
|
-
*
|
|
124
|
-
* @param filePath - File path to test
|
|
125
|
-
* @param pattern - Glob pattern to match against
|
|
126
|
-
* @returns true if the path matches the pattern
|
|
127
|
-
*/
|
|
128
|
-
export function matchGlobPattern(filePath, pattern) {
|
|
129
|
-
throw new Error('Not implemented: matchGlobPattern');
|
|
130
|
-
}
|
|
131
|
-
//# sourceMappingURL=add.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAyEH,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAmB;IAClD,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;AAChD,CAAC;AAED,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,GAAW,EACX,KAAe,EACf,UAAsB,EAAE;IAExB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;AAC9C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,GAAW,EACX,UAAsB,EAAE;IAExB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;AAC5C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GAAW,EACX,UAAsB,EAAE;IAExB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;AAC/C,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GAAW,EACX,KAAe,EACf,UAAsB,EAAE;IAExB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;AAC/C,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,KAAe,EACf,UAAsB,EAAE;IAExB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;AACnD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,OAAe;IAChE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Git Blame Command
|
|
3
|
-
*
|
|
4
|
-
* This module implements the `gitx blame` command which shows what revision
|
|
5
|
-
* and author last modified each line of a file. Features include:
|
|
6
|
-
* - Line-by-line attribution to commits and authors
|
|
7
|
-
* - Line range filtering
|
|
8
|
-
* - Rename tracking (-C flag)
|
|
9
|
-
* - Syntax highlighting support via Shiki
|
|
10
|
-
* - Binary file detection
|
|
11
|
-
*
|
|
12
|
-
* @module cli/commands/blame
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* // Blame entire file
|
|
16
|
-
* const result = await getBlame(adapter, 'src/index.ts')
|
|
17
|
-
* for (const line of result.lines) {
|
|
18
|
-
* console.log(formatBlameLine(line))
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // Blame specific line range
|
|
23
|
-
* const result = await getBlame(adapter, 'src/index.ts', { lineRange: '10,20' })
|
|
24
|
-
*/
|
|
25
|
-
import type { CommandContext } from '../index';
|
|
26
|
-
import type { FSAdapter } from '../fs-adapter';
|
|
27
|
-
/**
|
|
28
|
-
* Options for the blame command.
|
|
29
|
-
*
|
|
30
|
-
* @description Configuration options that control blame output and behavior.
|
|
31
|
-
*
|
|
32
|
-
* @property lineRange - Line range to blame (e.g., '10,20' or '10,+5')
|
|
33
|
-
* @property followRenames - Track file across renames (-C flag)
|
|
34
|
-
* @property highlight - Enable syntax highlighting with Shiki
|
|
35
|
-
* @property theme - Shiki theme name for highlighting
|
|
36
|
-
*/
|
|
37
|
-
export interface BlameOptions {
|
|
38
|
-
/** Line range in format "start,end" or "start,+count" */
|
|
39
|
-
lineRange?: string;
|
|
40
|
-
/** Follow file renames (-C flag) */
|
|
41
|
-
followRenames?: boolean;
|
|
42
|
-
/** Enable syntax highlighting with Shiki */
|
|
43
|
-
highlight?: boolean;
|
|
44
|
-
/** Syntax highlighting theme */
|
|
45
|
-
theme?: string;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Blame annotation for a single line.
|
|
49
|
-
*
|
|
50
|
-
* @description Contains all attribution information for a single line of code,
|
|
51
|
-
* including the commit that last modified it, author info, and line numbers.
|
|
52
|
-
*
|
|
53
|
-
* @property commitSha - Full 40-character commit SHA
|
|
54
|
-
* @property shortSha - Abbreviated 8-character SHA
|
|
55
|
-
* @property author - Author name
|
|
56
|
-
* @property authorEmail - Author email address
|
|
57
|
-
* @property date - Commit date
|
|
58
|
-
* @property lineNumber - Current line number in file
|
|
59
|
-
* @property originalLineNumber - Line number in the originating commit
|
|
60
|
-
* @property content - Line content
|
|
61
|
-
* @property originalPath - Original file path if file was renamed
|
|
62
|
-
*/
|
|
63
|
-
export interface BlameLineAnnotation {
|
|
64
|
-
/** Full commit SHA */
|
|
65
|
-
commitSha: string;
|
|
66
|
-
/** Short commit SHA (8 chars) */
|
|
67
|
-
shortSha: string;
|
|
68
|
-
/** Author name */
|
|
69
|
-
author: string;
|
|
70
|
-
/** Author email */
|
|
71
|
-
authorEmail: string;
|
|
72
|
-
/** Commit date */
|
|
73
|
-
date: Date;
|
|
74
|
-
/** Current line number in file */
|
|
75
|
-
lineNumber: number;
|
|
76
|
-
/** Original line number in the commit that introduced this line */
|
|
77
|
-
originalLineNumber: number;
|
|
78
|
-
/** Line content */
|
|
79
|
-
content: string;
|
|
80
|
-
/** Original file path (if different due to rename) */
|
|
81
|
-
originalPath?: string;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Commit information for binary files.
|
|
85
|
-
*
|
|
86
|
-
* @description For binary files that cannot be blamed line-by-line,
|
|
87
|
-
* this provides file-level commit information.
|
|
88
|
-
*/
|
|
89
|
-
export interface BlameFileCommit {
|
|
90
|
-
/** Commit SHA */
|
|
91
|
-
sha: string;
|
|
92
|
-
/** Author name */
|
|
93
|
-
author: string;
|
|
94
|
-
/** Commit date */
|
|
95
|
-
date: Date;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Complete result of a blame operation.
|
|
99
|
-
*
|
|
100
|
-
* @description Contains all blame information for a file, including
|
|
101
|
-
* line annotations, binary file handling, and optional syntax highlighting.
|
|
102
|
-
*
|
|
103
|
-
* @property path - File path that was blamed
|
|
104
|
-
* @property originalPath - Original path if file was renamed
|
|
105
|
-
* @property lines - Array of line annotations
|
|
106
|
-
* @property isBinary - True if file is binary
|
|
107
|
-
* @property message - Message for binary or error cases
|
|
108
|
-
* @property fileCommit - Commit info for binary files
|
|
109
|
-
* @property highlighted - Syntax-highlighted line content
|
|
110
|
-
* @property language - Detected programming language
|
|
111
|
-
* @property theme - Shiki theme used for highlighting
|
|
112
|
-
*/
|
|
113
|
-
export interface BlameResult {
|
|
114
|
-
/** File path being blamed */
|
|
115
|
-
path: string;
|
|
116
|
-
/** Original file path if renamed */
|
|
117
|
-
originalPath?: string;
|
|
118
|
-
/** Line annotations */
|
|
119
|
-
lines: BlameLineAnnotation[];
|
|
120
|
-
/** Whether file is binary */
|
|
121
|
-
isBinary: boolean;
|
|
122
|
-
/** Message for binary/error cases */
|
|
123
|
-
message?: string;
|
|
124
|
-
/** File-level commit info (for binary files) */
|
|
125
|
-
fileCommit?: BlameFileCommit;
|
|
126
|
-
/** Syntax highlighted lines (if highlight option enabled) */
|
|
127
|
-
highlighted?: string[];
|
|
128
|
-
/** Detected language */
|
|
129
|
-
language?: string;
|
|
130
|
-
/** Theme used for highlighting */
|
|
131
|
-
theme?: string;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Represents a line range for filtering blame output.
|
|
135
|
-
*
|
|
136
|
-
* @property start - Starting line number (1-indexed)
|
|
137
|
-
* @property end - Ending line number (1-indexed, inclusive)
|
|
138
|
-
*/
|
|
139
|
-
export interface LineRange {
|
|
140
|
-
/** Starting line number (1-indexed) */
|
|
141
|
-
start: number;
|
|
142
|
-
/** Ending line number (1-indexed, inclusive) */
|
|
143
|
-
end: number;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Execute the blame command from the CLI.
|
|
147
|
-
*
|
|
148
|
-
* @description Parses command-line arguments and displays blame annotations
|
|
149
|
-
* for the specified file. This is the entry point for the `gitx blame` command.
|
|
150
|
-
*
|
|
151
|
-
* @param ctx - Command context containing cwd, args, options, and output functions
|
|
152
|
-
* @returns Promise that resolves when output is complete
|
|
153
|
-
* @throws {Error} Always throws "Not implemented" - command not yet implemented
|
|
154
|
-
*
|
|
155
|
-
* @example
|
|
156
|
-
* // CLI usage
|
|
157
|
-
* // gitx blame src/index.ts
|
|
158
|
-
* // gitx blame -L 10,20 src/index.ts
|
|
159
|
-
* // gitx blame -C src/renamed-file.ts
|
|
160
|
-
*/
|
|
161
|
-
export declare function blameCommand(ctx: CommandContext): Promise<void>;
|
|
162
|
-
/**
|
|
163
|
-
* Get blame annotations for a file.
|
|
164
|
-
*
|
|
165
|
-
* @description Computes blame annotations for each line of a file by walking
|
|
166
|
-
* the commit history. For each line, identifies the commit and author that
|
|
167
|
-
* last modified it. Supports line range filtering and rename tracking.
|
|
168
|
-
*
|
|
169
|
-
* The algorithm:
|
|
170
|
-
* 1. Gets the current file content at HEAD
|
|
171
|
-
* 2. Initializes all lines as attributed to HEAD
|
|
172
|
-
* 3. Walks backward through commit history
|
|
173
|
-
* 4. Uses LCS (Longest Common Subsequence) to map lines between commits
|
|
174
|
-
* 5. Updates line attribution when a line exists in a parent commit
|
|
175
|
-
*
|
|
176
|
-
* @param adapter - Filesystem adapter for reading git objects
|
|
177
|
-
* @param filePath - Path to the file to blame (relative to repo root)
|
|
178
|
-
* @param options - Blame options for filtering and behavior
|
|
179
|
-
* @returns Promise resolving to blame result with line annotations
|
|
180
|
-
* @throws {Error} If file path contains null character
|
|
181
|
-
* @throws {Error} If HEAD cannot be resolved (empty repository)
|
|
182
|
-
* @throws {Error} If HEAD commit cannot be read
|
|
183
|
-
* @throws {Error} If file does not exist in repository
|
|
184
|
-
* @throws {Error} If line range is invalid (end before start, exceeds file length)
|
|
185
|
-
*
|
|
186
|
-
* @example
|
|
187
|
-
* // Blame entire file
|
|
188
|
-
* const result = await getBlame(adapter, 'src/index.ts')
|
|
189
|
-
* console.log(`File has ${result.lines.length} lines`)
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* // Blame specific line range
|
|
193
|
-
* const result = await getBlame(adapter, 'src/index.ts', { lineRange: '10,20' })
|
|
194
|
-
*
|
|
195
|
-
* @example
|
|
196
|
-
* // Blame with rename tracking
|
|
197
|
-
* const result = await getBlame(adapter, 'src/new-name.ts', { followRenames: true })
|
|
198
|
-
* if (result.originalPath) {
|
|
199
|
-
* console.log(`File was renamed from ${result.originalPath}`)
|
|
200
|
-
* }
|
|
201
|
-
*
|
|
202
|
-
* @example
|
|
203
|
-
* // Handle binary files
|
|
204
|
-
* const result = await getBlame(adapter, 'assets/image.png')
|
|
205
|
-
* if (result.isBinary) {
|
|
206
|
-
* console.log(result.message) // "binary file - cannot show line-by-line blame"
|
|
207
|
-
* console.log(`Last modified by: ${result.fileCommit?.author}`)
|
|
208
|
-
* }
|
|
209
|
-
*/
|
|
210
|
-
export declare function getBlame(adapter: FSAdapter, filePath: string, options?: BlameOptions): Promise<BlameResult>;
|
|
211
|
-
/**
|
|
212
|
-
* Format a blame line annotation for display.
|
|
213
|
-
*
|
|
214
|
-
* @description Formats a single blame line in a human-readable format similar
|
|
215
|
-
* to git blame output: `<sha> (<author> <date>) <content>`
|
|
216
|
-
*
|
|
217
|
-
* @param annotation - The blame line annotation to format
|
|
218
|
-
* @param options - Formatting options
|
|
219
|
-
* @param options.showOriginalLineNumber - If true, shows both original and current line numbers
|
|
220
|
-
* @returns Formatted string for display
|
|
221
|
-
*
|
|
222
|
-
* @example
|
|
223
|
-
* const formatted = formatBlameLine(annotation)
|
|
224
|
-
* // Output: "abc12345 (John Doe 2024-01-15) const x = 1"
|
|
225
|
-
*
|
|
226
|
-
* @example
|
|
227
|
-
* // With original line numbers (for renamed files)
|
|
228
|
-
* const formatted = formatBlameLine(annotation, { showOriginalLineNumber: true })
|
|
229
|
-
* // Output: "abc12345 (John Doe 2024-01-15 10 12) const x = 1"
|
|
230
|
-
*/
|
|
231
|
-
export declare function formatBlameLine(annotation: BlameLineAnnotation, options?: {
|
|
232
|
-
showOriginalLineNumber?: boolean;
|
|
233
|
-
}): string;
|
|
234
|
-
/**
|
|
235
|
-
* Parse a line range string into start and end values.
|
|
236
|
-
*
|
|
237
|
-
* @description Parses line range specifications used with the -L flag.
|
|
238
|
-
* Supports two formats:
|
|
239
|
-
* - Absolute: "start,end" (e.g., "10,20" for lines 10-20)
|
|
240
|
-
* - Relative: "start,+count" (e.g., "10,+5" for lines 10-15)
|
|
241
|
-
*
|
|
242
|
-
* @param rangeStr - Line range string in "start,end" or "start,+count" format
|
|
243
|
-
* @returns Parsed line range with start and end (1-indexed, inclusive)
|
|
244
|
-
* @throws {Error} If format is invalid (not two comma-separated values)
|
|
245
|
-
* @throws {Error} If start line is not a valid number
|
|
246
|
-
* @throws {Error} If end line or offset is not a valid number
|
|
247
|
-
*
|
|
248
|
-
* @example
|
|
249
|
-
* // Absolute range
|
|
250
|
-
* const range = parseLineRange('10,20')
|
|
251
|
-
* console.log(range) // { start: 10, end: 20 }
|
|
252
|
-
*
|
|
253
|
-
* @example
|
|
254
|
-
* // Relative range
|
|
255
|
-
* const range = parseLineRange('10,+5')
|
|
256
|
-
* console.log(range) // { start: 10, end: 15 }
|
|
257
|
-
*/
|
|
258
|
-
export declare function parseLineRange(rangeStr: string): LineRange;
|
|
259
|
-
//# sourceMappingURL=blame.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blame.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/blame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,eAAe,CAAA;AAOxD;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oCAAoC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,mBAAmB;IAClC,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,kBAAkB;IAClB,IAAI,EAAE,IAAI,CAAA;IACV,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,mEAAmE;IACnE,kBAAkB,EAAE,MAAM,CAAA;IAC1B,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,iBAAiB;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,kBAAkB;IAClB,IAAI,EAAE,IAAI,CAAA;CACX;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,WAAW;IAC1B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uBAAuB;IACvB,KAAK,EAAE,mBAAmB,EAAE,CAAA;IAC5B,6BAA6B;IAC7B,QAAQ,EAAE,OAAO,CAAA;IACjB,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gDAAgD;IAChD,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;CACZ;AAoQD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,CA4OtB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,mBAAmB,EAC/B,OAAO,GAAE;IAAE,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAO,GACjD,MAAM,CAkBR;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CA2B1D"}
|