git-chopstick-core 0.1.10 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.13] — 2026-06-13
4
+
5
+ ### Added
6
+ - **`getRepositories(rootPath, options?)`**: New `src/git/discover.ts` module for discovering git repos in a directory tree. Walks directories using `fs.opendir` with depth control (default 5), skips `node_modules`/`.git`/`.yarn`/etc., handles symlinks and worktree `.git` files. Returns `Repository[]`.
7
+ - **`WorkingDirectoryFileChangeSummary`** type: Like `WorkingDirectoryChangeSummary` but includes `selectionType` and `selection` for staging decisions.
8
+ - **`getWorkingDirectoryChangesDetailed(repository)`**: Selection-aware variant of `getWorkingDirectoryChanges` that returns `WorkingDirectoryFileChangeSummary[]` with `DiffSelection` objects.
9
+ - **`fileChangeSummaryToWorkingDirectoryFile(summary)`**: Lossy roundtrip helper to convert a `WorkingDirectoryFileChangeSummary` back to `WorkingDirectoryFileChange` for use with `stageFiles()`.
10
+ - **Integration tests**: 8 new tests covering `getWorkingDirectoryChangesDetailed` (3), `fileChangeSummaryToWorkingDirectoryFile` roundtrip (2), and `getRepositories` (5). Total: 56 tests.
11
+
12
+ ### Changed
13
+ - **README Known Limitations**: Removed stale "Integration Tests" item from Known Limitations section (not a limitation). Cleaned up section.
14
+ - **README API reference**: Added `discover` module, `getWorkingDirectoryChangesDetailed`, `fileChangeSummaryToWorkingDirectoryFile`, `WorkingDirectoryChangeSummary`, and `WorkingDirectoryFileChangeSummary` to tables.
15
+ - **`src/git/index.ts`**: Added `discover.js` to barrel exports.
16
+ - **`src/git/status.ts`**: Re-exports `DiffSelectionType` and `DiffSelection` at module level for convenient imports.
17
+
18
+ ---
19
+
20
+ ## [0.1.11] — 2026-06-13
21
+
22
+ ### Added
23
+ - **`getTags(path)`**: New path-based helper in `tag.ts` returning `ReadonlyArray<TagEntry>` (`{name, sha}[]`). Uses `git show-ref --tags -d` with annotated-tag normalization. Returns `[]` for tag-less repos and non-repo paths.
24
+ - **`getStashesByPath(path)`**: Path-based stash listing in `stash.ts`. `getStashes(repository)` delegates to it internally. `StashResult` type now exported.
25
+ - **`getFileAtCommit(repoPath, sha, file)`**: New helper in `show.ts` returning file content as `string` via `git show ${sha}:${file}`. Throws with descriptive message for non-existent files.
26
+ - **`appFileStatusToString(status)`**: New helper in `models/status.ts` converting `AppFileStatus` to human-readable strings (Added, Modified, Deleted, Renamed, Copied, Conflicted, Untracked).
27
+ - **`getChangedFilesFlat(repository, sha)`**: New helper in `log.ts` returning `ReadonlyArray<FlatFileChange>` (`{path, statusKind, oldPath?}`). Wraps `getChangedFiles` and flattens the `CommittedFileChange.status` union.
28
+ - **`examples/commit-file-browser.ts`**: CLI demo walking through the "Browse file tree at any commit" feature using `getFileAtCommit`, `getChangedFilesFlat`, and `getCommits`.
29
+ - **Integration tests**: 14 new tests covering `getTags` (3), `getFileAtCommit` (4), `getChangedFilesFlat` (3), `getStashesByPath` (3), and `appFileStatusToString` (1). Total: 45 tests.
30
+
31
+ ### Fixed
32
+ - **`show.js` missing from git barrel**: `src/git/index.ts` now exports `show.js`, making `getFileAtCommit` (and `getBlobContents`/`getPartialBlobContents`) available through the root barrel.
33
+ - **`getTags` exit code 128**: Non-repo paths now return `[]` instead of throwing, by adding exit code 128 to `successExitCodes`.
34
+
35
+ ### Changed
36
+ - **README**: Updated API reference for `tag.ts`, `stash.ts`, `show.ts`, `log.ts`, and domain models table.
37
+
38
+ ---
39
+
3
40
  ## [0.1.10] — 2026-06-13
4
41
 
5
42
  ### Added
@@ -155,6 +192,8 @@
155
192
 
156
193
  ---
157
194
 
195
+ [0.1.13]: https://github.com/parkiyong/git-chopstick-core/releases/tag/v0.1.13
196
+ [0.1.11]: https://github.com/parkiyong/git-chopstick-core/releases/tag/v0.1.11
158
197
  [0.1.10]: https://github.com/parkiyong/git-chopstick-core/releases/tag/v0.1.10
159
198
  [0.1.9]: https://github.com/parkiyong/git-chopstick-core/releases/tag/v0.1.9
160
199
  [0.1.8]: https://github.com/parkiyong/git-chopstick-core/releases/tag/v0.1.8
@@ -166,4 +205,4 @@
166
205
  [0.1.2]: https://github.com/parkiyong/git-chopstick-core/releases/tag/v0.1.2
167
206
  [0.1.1]: https://github.com/parkiyong/git-chopstick-core/releases/tag/v0.1.1
168
207
  [0.1.0]: https://github.com/parkiyong/git-chopstick-core/releases/tag/v0.1.0
169
- [Unreleased]: https://github.com/parkiyong/git-chopstick-core/compare/v0.1.10...HEAD
208
+ [Unreleased]: https://github.com/parkiyong/git-chopstick-core/compare/v0.1.13...HEAD
package/README.md CHANGED
@@ -213,6 +213,7 @@ try {
213
213
  | `config` | `getConfigValue`, `getGlobalConfigValue`, `getBooleanConfigValue` | Read git config |
214
214
  | `diff` | `getWorkingDirectoryDiff`, `getCommitDiff`, `getBranchMergeBaseDiff`, `getCommitRangeDiff`, `getBinaryPaths` | Diff rendering |
215
215
  | `diff-index` | `getIndexChanges` | Compare index with tree |
216
+ | `discover` | `getRepositories` | Discover git repos in a directory tree (monorepo support) |
216
217
  | `fetch` | `fetch`, `fetchRefspec`, `fastForwardBranches` | Fetch from remotes |
217
218
  | `for-each-ref` | `getBranches`, `getBranchesDifferingFromUpstream` | List refs |
218
219
  | `format-patch` | `formatPatch` | Generate patch files |
@@ -220,7 +221,7 @@ try {
220
221
  | `init` | `initGitRepository` | Initialize a repo |
221
222
  | `interpret-trailers` | `parseRawUnfoldedTrailers`, `isCoAuthoredByTrailer`, `getTrailerSeparatorCharacters` | Git trailer parsing |
222
223
  | `lfs` | `installGlobalLFSFilters`, `isUsingLFS`, `isTrackedByLFS`, `filesNotTrackedByLFS` | Git LFS support |
223
- | `log` | `getCommits`, `getCommit`, `getChangedFiles`, `getAuthors` | Commit history |
224
+ | `log` | `getCommits`, `getCommit`, `getChangedFiles`, `getChangedFilesFlat`, `getAuthors` | Commit history |
224
225
  | `merge` | `merge`, `getMergeBase`, `abortMerge` | Merge branches |
225
226
  | `merge-tree` | `determineMergeability` | Test mergeability without merging |
226
227
  | `pull` | `pull` | Pull from remote |
@@ -237,10 +238,10 @@ try {
237
238
  | `rm` | `removeConflictedFile` | Remove files |
238
239
  | `squash` | `squash` | Interactive rebase squashing |
239
240
  | `stage` | `stageManualConflictResolution`, `stageResolvedConflictFiles` | Stage conflict resolutions |
240
- | `stash` | `getStashes`, `createStashEntry`, `popStashEntry`, `getStashedFiles`, `dropStashEntry` | Stash management |
241
- | `status` | `getStatus` | Repository status |
241
+ | `stash` | `getStashes`, `getStashesByPath`, `createStashEntry`, `popStashEntry`, `getStashedFiles`, `dropStashEntry` | Stash management |
242
+ | `status` | `getStatus`, `getWorkingDirectoryChanges`, `getWorkingDirectoryChangesDetailed`, `fileChangeSummaryToWorkingDirectoryFile` | Repository status + flat summaries + selection-aware variant with roundtrip |
242
243
  | `submodule` | `updateSubmodulesAfterOperation`, `listSubmodules`, `resetSubmodulePaths` | Submodule operations |
243
- | `tag` | `createTag`, `deleteTag`, `getAllTags` | Tag management |
244
+ | `tag` | `createTag`, `deleteTag`, `getTags`, `getAllTags` | Tag management |
244
245
  | `update-index` | `stageFiles` | Stage files |
245
246
  | `update-ref` | `updateRef`, `deleteRef` | Ref updates |
246
247
  | `var` | `getAuthorIdentity` | Git var queries |
@@ -257,10 +258,14 @@ try {
257
258
  | `Branch` | class | Branch with upstream tracking info |
258
259
  | `BranchType` | enum | `Local` or `Remote` |
259
260
  | `AppFileStatusKind` | enum | `New`, `Modified`, `Deleted`, `Renamed`, `Copied`, `Conflicted`, `Untracked` |
261
+ | `appFileStatusToString` | fn | Converts `AppFileStatus` to human-readable string |
262
+ | `FlatFileChange` | type | `{ path: string; statusKind: AppFileStatusKind; oldPath?: string }` |
260
263
  | `FileChange` | class | Base file change model |
261
264
  | `WorkingDirectoryFileChange` | class | Uncommitted file change with diff selection |
262
265
  | `CommittedFileChange` | class | File change from a commit |
263
266
  | `WorkingDirectoryStatus` | class | Container for working directory changes |
267
+ | `WorkingDirectoryChangeSummary` | type | `{ path: string; status: string; oldPath?: string }` — flattened working directory change |
268
+ | `WorkingDirectoryFileChangeSummary` | type | Like `WorkingDirectoryChangeSummary` but also includes `selectionType` + `selection` for staging decisions |
264
269
  | `DiffSelection` / `DiffSelectionType` | class/enum | Partial file staging |
265
270
  | `ComputedAction` | enum | `Clean`, `Conflicts`, `Invalid`, `Loading` |
266
271
  | `ManualConflictResolution` | enum | `theirs` / `ours` |
@@ -293,10 +298,6 @@ Note: `git revert` does not produce progress output, so `RevertProgressParser` s
293
298
 
294
299
  `withTrampolineEnv` is a **stub** that calls through without setting up the Git LFS trampoline environment. Git LFS operations may not work correctly as a result.
295
300
 
296
- ### 🟢 Integration Tests
297
-
298
- Integration tests are available in `src/__tests__/integration.test.ts` and run against real git repositories in temp directories. Run `npm test` to execute them.
299
-
300
301
  ---
301
302
 
302
303
  ## Architecture
@@ -0,0 +1,37 @@
1
+ import { Repository } from '../models/repository.js';
2
+ /**
3
+ * Options for {@link getRepositories}.
4
+ */
5
+ export interface GetRepositoriesOptions {
6
+ /**
7
+ * Maximum recursion depth. Defaults to 5.
8
+ * Set to `-1` for unlimited depth.
9
+ */
10
+ readonly depth?: number;
11
+ /**
12
+ * Directories to skip when walking the tree.
13
+ * Defaults to `['node_modules', '.git', '.hg', '.svn', '.yarn', '.pnp']`.
14
+ */
15
+ readonly skipDirs?: ReadonlySet<string>;
16
+ /**
17
+ * Whether to include bare repositories. Defaults to `false`.
18
+ * Bare repos have no working directory and `Repository.path` will
19
+ * point to the bare git directory.
20
+ */
21
+ readonly includeBare?: boolean;
22
+ }
23
+ /**
24
+ * Discover git repositories in a directory tree.
25
+ *
26
+ * Walks the directory tree under `rootPath`, looking for `.git` entries
27
+ * (directories for regular repos, or files for worktrees and submodules).
28
+ * Returns the discovered repositories as an array of `Repository` objects.
29
+ *
30
+ * @example
31
+ * // Find all repos up to 3 levels deep, excluding node_modules
32
+ * const repos = await getRepositories('/path/to/monorepo', { depth: 3 })
33
+ * for (const repo of repos) {
34
+ * console.log(repo.name, repo.path)
35
+ * }
36
+ */
37
+ export declare function getRepositories(rootPath: string, options?: GetRepositoriesOptions): Promise<ReadonlyArray<Repository>>;
@@ -0,0 +1,124 @@
1
+ import { opendir, stat } from 'fs/promises';
2
+ import { join, resolve } from 'path';
3
+ import { Repository } from '../models/repository.js';
4
+ import { directoryExists } from '../lib/directory-exists.js';
5
+ const defaultSkipDirs = new Set([
6
+ 'node_modules',
7
+ '.git',
8
+ '.hg',
9
+ '.svn',
10
+ '.yarn',
11
+ '.pnp',
12
+ '__pycache__',
13
+ '.cache',
14
+ '.next',
15
+ '.turbo',
16
+ 'dist',
17
+ 'build',
18
+ '.venv',
19
+ 'vendor',
20
+ '.tox',
21
+ ]);
22
+ /**
23
+ * Discover git repositories in a directory tree.
24
+ *
25
+ * Walks the directory tree under `rootPath`, looking for `.git` entries
26
+ * (directories for regular repos, or files for worktrees and submodules).
27
+ * Returns the discovered repositories as an array of `Repository` objects.
28
+ *
29
+ * @example
30
+ * // Find all repos up to 3 levels deep, excluding node_modules
31
+ * const repos = await getRepositories('/path/to/monorepo', { depth: 3 })
32
+ * for (const repo of repos) {
33
+ * console.log(repo.name, repo.path)
34
+ * }
35
+ */
36
+ export async function getRepositories(rootPath, options = {}) {
37
+ const { depth = 5, skipDirs = defaultSkipDirs, includeBare = false, } = options;
38
+ if (includeBare) {
39
+ throw new Error('Bare repository detection is not yet implemented. ' +
40
+ 'Set includeBare to false (default) or omit it.');
41
+ }
42
+ if (!(await directoryExists(rootPath))) {
43
+ return [];
44
+ }
45
+ const resolvedRoot = resolve(rootPath);
46
+ const repos = [];
47
+ const seen = new Set();
48
+ /**
49
+ * Check if a path contains a `.git` entry, indicating a git repository.
50
+ */
51
+ async function hasGitDir(dirPath) {
52
+ const gitPath = join(dirPath, '.git');
53
+ try {
54
+ const s = await stat(gitPath);
55
+ return s.isDirectory() || s.isFile();
56
+ }
57
+ catch {
58
+ return false;
59
+ }
60
+ }
61
+ /**
62
+ * Recursively walk a directory tree looking for repos.
63
+ */
64
+ async function walk(currentPath, currentDepth) {
65
+ // Check depth limit
66
+ if (depth !== -1 && currentDepth > depth) {
67
+ return;
68
+ }
69
+ // Resolve to avoid duplicate entries from symlinks
70
+ const resolved = resolve(currentPath);
71
+ // Skip if already seen (e.g., symlink loop)
72
+ if (seen.has(resolved)) {
73
+ return;
74
+ }
75
+ seen.add(resolved);
76
+ // Check if this directory is itself a repo
77
+ if (await hasGitDir(resolved)) {
78
+ repos.push(new Repository(resolved, repos.length));
79
+ // Continue recursing — the parent repo may contain nested repos
80
+ // (e.g. monorepo workspaces where the root is a repo AND packages
81
+ // have their own .git directories)
82
+ }
83
+ // Recurse into subdirectories
84
+ let dir;
85
+ try {
86
+ dir = await opendir(resolved);
87
+ }
88
+ catch {
89
+ return; // Permission denied, etc.
90
+ }
91
+ for await (const entry of dir) {
92
+ if (entry.name.startsWith('.')) {
93
+ // Skip hidden directories (except the root itself)
94
+ // But .gitignore, .github, etc. could have submodules
95
+ // Only skip .git, .hg, .svn
96
+ if (entry.name === '.git' || entry.name === '.hg' || entry.name === '.svn') {
97
+ continue;
98
+ }
99
+ }
100
+ if (skipDirs.has(entry.name)) {
101
+ continue;
102
+ }
103
+ if (entry.isDirectory()) {
104
+ await walk(join(resolved, entry.name), currentDepth + 1);
105
+ }
106
+ else if (entry.isSymbolicLink()) {
107
+ // Follow symlinks to directories
108
+ const linkPath = join(resolved, entry.name);
109
+ try {
110
+ const linkStat = await stat(linkPath);
111
+ if (linkStat.isDirectory()) {
112
+ await walk(linkPath, currentDepth + 1);
113
+ }
114
+ }
115
+ catch {
116
+ // Broken symlink, skip
117
+ }
118
+ }
119
+ }
120
+ }
121
+ await walk(resolvedRoot, 0);
122
+ return repos;
123
+ }
124
+ //# sourceMappingURL=discover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/git/discover.ts"],"names":[],"m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3E,SAAQ;gBACV,CAAC;YACH,CAAC;YAED,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7B,SAAQ;YACV,CAAC;YAED,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,CAAA;YAC1D,CAAC;iBAAM,IAAI,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC;gBAClC,iCAAiC;gBACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;gBAC3C,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAA;oBACrC,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;wBAC3B,MAAM,IAAI,CAAC,QAAQ,EAAE,YAAY,GAAG,CAAC,CAAC,CAAA;oBACxC,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,uBAAuB;gBACzB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAA;IAC3B,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -6,6 +6,7 @@ export * from './checkout.js';
6
6
  export * from './checkout-index.js';
7
7
  export * from './cherry-pick.js';
8
8
  export * from './clean.js';
9
+ export * from './discover.js';
9
10
  export * from './clone.js';
10
11
  export * from './commit.js';
11
12
  export * from './config.js';
@@ -34,6 +35,7 @@ export * from './reset.js';
34
35
  export * from './rev-list.js';
35
36
  export * from './rev-parse.js';
36
37
  export * from './rm.js';
38
+ export * from './show.js';
37
39
  export * from './squash.js';
38
40
  export * from './stage.js';
39
41
  export * from './stash.js';
package/dist/git/index.js CHANGED
@@ -8,6 +8,7 @@ export * from './checkout.js';
8
8
  export * from './checkout-index.js';
9
9
  export * from './cherry-pick.js';
10
10
  export * from './clean.js';
11
+ export * from './discover.js';
11
12
  export * from './clone.js';
12
13
  export * from './commit.js';
13
14
  export * from './config.js';
@@ -36,6 +37,7 @@ export * from './reset.js';
36
37
  export * from './rev-list.js';
37
38
  export * from './rev-parse.js';
38
39
  export * from './rm.js';
40
+ export * from './show.js';
39
41
  export * from './squash.js';
40
42
  export * from './stage.js';
41
43
  export * from './stash.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/git/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,4BAA4B,EAAE,SAAS,EAAyB,MAAM,WAAW,CAAC;AAEjH,uBAAuB;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,yBAAyB,CAAA;AACvC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAA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Ac,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA"}
package/dist/git/log.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CommittedFileChange } from '../models/status.js';
1
+ import { CommittedFileChange, AppFileStatusKind } from '../models/status.js';
2
2
  import { Repository } from '../models/repository.js';
3
3
  import { Commit } from '../models/commit.js';
4
4
  import { CommitIdentity } from '../models/commit-identity.js';
@@ -15,6 +15,22 @@ export interface IChangesetData {
15
15
  /** Number of lines deleted in the changeset. */
16
16
  readonly linesDeleted: number;
17
17
  }
18
+ /**
19
+ * A flattened file change record, suitable for serialization or UI lists.
20
+ */
21
+ export type FlatFileChange = {
22
+ path: string;
23
+ statusKind: AppFileStatusKind;
24
+ oldPath?: string;
25
+ };
26
+ /**
27
+ * A flattened variant of `getChangedFiles` that returns simple objects
28
+ * instead of `CommittedFileChange` class instances.
29
+ *
30
+ * Consumers that just need path + status kind + optional old path can use
31
+ * this instead of mapping `CommittedFileChange.status` themselves.
32
+ */
33
+ export declare function getChangedFilesFlat(repository: Repository, sha: string): Promise<ReadonlyArray<FlatFileChange>>;
18
34
  /** Get the files that were changed in the given commit. */
19
35
  export declare function getChangedFiles(repository: Repository, sha: string): Promise<IChangesetData>;
20
36
  /**
package/dist/git/log.js CHANGED
@@ -142,6 +142,23 @@ export async function getCommits(repository, revisionRange, limit, skip, additio
142
142
  parseRawUnfoldedTrailers(commit.trailers.toString(), ':'), tags);
143
143
  });
144
144
  }
145
+ /**
146
+ * A flattened variant of `getChangedFiles` that returns simple objects
147
+ * instead of `CommittedFileChange` class instances.
148
+ *
149
+ * Consumers that just need path + status kind + optional old path can use
150
+ * this instead of mapping `CommittedFileChange.status` themselves.
151
+ */
152
+ export async function getChangedFilesFlat(repository, sha) {
153
+ const { files } = await getChangedFiles(repository, sha);
154
+ return files.map(f => ({
155
+ path: f.path,
156
+ statusKind: f.status.kind,
157
+ ...('oldPath' in f.status && f.status.oldPath !== undefined
158
+ ? { oldPath: f.status.oldPath }
159
+ : {}),
160
+ }));
161
+ }
145
162
  /** Get the files that were changed in the given commit. */
146
163
  export async function getChangedFiles(repository, sha) {
147
164
  // opt-in for rename detection (-M) and copies detection (-C)
@@ -1 +1 @@
1
- {"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/git/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAMlB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,+DAA+D;AAC/D,0DAA0D;AAC1D,MAAM,iBAAiB,GAAG,QAAQ,CAA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O,OAAO,CAAA;AAChB,CAAC"}
@@ -16,6 +16,17 @@ import { Repository } from '../models/repository.js';
16
16
  * root from where to read the blob contents
17
17
  */
18
18
  export declare const getBlobContents: (repository: Repository, commitish: string, path: string) => Promise<Buffer<ArrayBufferLike>>;
19
+ /**
20
+ * Get the text contents of a file at a specific commit, using a path string.
21
+ *
22
+ * Returns the file contents as a string, or throws if the file doesn't
23
+ * exist in the given commit.
24
+ *
25
+ * @param repoPath - The repository path on disk
26
+ * @param sha - The commit SHA to read the file from
27
+ * @param file - The file path relative to the repository root
28
+ */
29
+ export declare function getFileAtCommit(repoPath: string, sha: string, file: string): Promise<string>;
19
30
  /**
20
31
  * Retrieve some or all binary contents of a blob from the repository
21
32
  * at a given reference, commit, or tree. This is almost identical
package/dist/git/show.js CHANGED
@@ -21,6 +21,23 @@ export const getBlobContents = (repository, commitish, path) => git(['show', `${
21
21
  successExitCodes: new Set([0, 1]),
22
22
  encoding: 'buffer',
23
23
  }).then(r => r.stdout);
24
+ /**
25
+ * Get the text contents of a file at a specific commit, using a path string.
26
+ *
27
+ * Returns the file contents as a string, or throws if the file doesn't
28
+ * exist in the given commit.
29
+ *
30
+ * @param repoPath - The repository path on disk
31
+ * @param sha - The commit SHA to read the file from
32
+ * @param file - The file path relative to the repository root
33
+ */
34
+ export async function getFileAtCommit(repoPath, sha, file) {
35
+ const result = await git(['show', `${sha}:${file}`], repoPath, 'getFileAtCommit', { successExitCodes: new Set([0, 1]) });
36
+ if (result.exitCode !== 0) {
37
+ throw new Error(`File '${file}' not found at commit ${sha}`);
38
+ }
39
+ return result.stdout;
40
+ }
24
41
  /**
25
42
  * Retrieve some or all binary contents of a blob from the repository
26
43
  * at a given reference, commit, or tree. This is almost identical
@@ -1 +1 @@
1
- {"version":3,"file":"show.js","sourceRoot":"","sources":["../../src/git/show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAGzD,OAAO,EAAE,QA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CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,yBAAyB,GAAG,EAAE,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAA;AACtB,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,UAAsB,EACtB,SAAiB,EACjB,IAAY,EACZ,MAAc;IAEd,OAAO,uCAAuC,CAC5C,UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,CACP,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uCAAuC,CAC3D,UAAsB,EACtB,SAAiB,EACjB,IAAY,EACZ,MAAc;IAEd,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC,CAAA;IAE7C,OAAO,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,yCAAyC,EAAE;QAC3E,SAAS,EAAE,MAAM;QACjB,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;QACzD,QAAQ,EAAE,QAAQ;KACnB,CAAC;SACC,IAAI,CAAC,CAAC,CAAC,EAAE,CACR,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAChE;SACA,KAAK,CAAC,CAAC,CAAC,EAAE,CACT,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAC3E,CAAA;AACL,CAAC"}
@@ -3,7 +3,8 @@ import { IStashEntry } from '../models/stash-entry.js';
3
3
  import { WorkingDirectoryFileChange, CommittedFileChange } from '../models/status.js';
4
4
  import { Branch } from '../models/branch.js';
5
5
  export declare const DesktopStashEntryMarker = "!!GitHub_Desktop";
6
- type StashResult = {
6
+ /** The result of listing stash entries. */
7
+ export type StashResult = {
7
8
  /** The stash entries created by Desktop */
8
9
  readonly desktopEntries: ReadonlyArray<IStashEntry>;
9
10
  /**
@@ -12,6 +13,12 @@ type StashResult = {
12
13
  */
13
14
  readonly stashEntryCount: number;
14
15
  };
16
+ /**
17
+ * Get the list of stash entries for a repository path.
18
+ * Uses the default ordering of refs (which is LIFO ordering),
19
+ * as well as the total amount of stash entries.
20
+ */
21
+ export declare function getStashesByPath(path: string): Promise<StashResult>;
15
22
  /**
16
23
  * Get the list of stash entries created by Desktop in the current repository
17
24
  * using the default ordering of refs (which is LIFO ordering),
@@ -50,4 +57,3 @@ export declare function dropDesktopStashEntry(repository: Repository, stashSha:
50
57
  export declare function popStashEntry(repository: Repository, stashSha: string): Promise<void>;
51
58
  /** Get the files that were changed in the given stash commit */
52
59
  export declare function getStashedFiles(repository: Repository, stashSha: string): Promise<ReadonlyArray<CommittedFileChange>>;
53
- export {};
package/dist/git/stash.js CHANGED
@@ -14,11 +14,11 @@ export const DesktopStashEntryMarker = '!!GitHub_Desktop';
14
14
  */
15
15
  const desktopStashEntryMessageRe = /!!GitHub_Desktop<(.+)>$/;
16
16
  /**
17
- * Get the list of stash entries created by Desktop in the current repository
18
- * using the default ordering of refs (which is LIFO ordering),
17
+ * Get the list of stash entries for a repository path.
18
+ * Uses the default ordering of refs (which is LIFO ordering),
19
19
  * as well as the total amount of stash entries.
20
20
  */
21
- export async function getStashes(repository) {
21
+ export async function getStashesByPath(path) {
22
22
  const { formatArgs, parse } = createLogParser({
23
23
  name: '%gD',
24
24
  stashSha: '%H',
@@ -26,9 +26,7 @@ export async function getStashes(repository) {
26
26
  tree: '%T',
27
27
  parents: '%P',
28
28
  });
29
- const result = await git(['log', '-g', ...formatArgs, 'refs/stash', '--'], repository.path, 'getStashEntries', { successExitCodes: new Set([0, 128]) });
30
- // There's no refs/stashes reflog in the repository or it's not
31
- // even a repository. In either case we don't care
29
+ const result = await git(['log', '-g', ...formatArgs, 'refs/stash', '--'], path, 'getStashEntries', { successExitCodes: new Set([0, 128]) });
32
30
  if (result.exitCode === 128) {
33
31
  return { desktopEntries: [], stashEntryCount: 0 };
34
32
  }
@@ -50,6 +48,14 @@ export async function getStashes(repository) {
50
48
  }
51
49
  return { desktopEntries, stashEntryCount: entries.length - 1 };
52
50
  }
51
+ /**
52
+ * Get the list of stash entries created by Desktop in the current repository
53
+ * using the default ordering of refs (which is LIFO ordering),
54
+ * as well as the total amount of stash entries.
55
+ */
56
+ export async function getStashes(repository) {
57
+ return getStashesByPath(repository.path);
58
+ }
53
59
  /**
54
60
  * Moves a stash entry to a different branch by means of creating
55
61
  * a new stash entry associated with the new branch and dropping the old
@@ -1 +1 @@
1
- {"version":3,"file":"stash.js","sourceRoot":"","sources":["../../src/git/stash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,OAAO,EAEL,wBAAwB,GAEzB,MAAM,0BAA0B,CAAA;AAKjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAA;AAEzD;;;;;GAKG;AACH,MAAM,0BAA0B,GAAG,yBAAyB,CAAA;AAa5D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,UAAsB;IACrD,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,eAAe,CAAC;QAC5C,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,IAAI;QACd,O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