@openvcs/git-plugin 0.2.0-edge.20260504.52 → 0.2.0-edge.20260506.55

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/ARCHITECTURE.md CHANGED
@@ -29,6 +29,14 @@ through `@openvcs/sdk/runtime` delegates and exposes a single VCS backend id:
29
29
  - For rename and copy records, the porcelain format includes two NUL-terminated
30
30
  paths: the original/source path first, then the new/destination path. The
31
31
  plugin assigns `path` to the new path and `old_path` to the original path.
32
+ - Unmerged porcelain states such as `UU`, `AA`, and `DD` are normalized to `U`
33
+ in status payloads so the client opens merge-conflict UI instead of a normal
34
+ diff view.
35
+ - File diffs first read worktree changes and fall back to `git diff --cached`
36
+ for staged-only files so selected staged changes still render textual hunks.
37
+ - Commit history uses the current `HEAD` or requested revision instead of
38
+ `git log --all`, so internal refs such as `refs/stash` are not shown as normal
39
+ history entries.
32
40
  - Network commands (`fetch`, `push`, `pull`) omit optional arguments (remote,
33
41
  refspec, branch) when not provided, allowing Git to use its defaults instead
34
42
  of receiving empty string arguments.
package/bin/git.js CHANGED
@@ -205,7 +205,7 @@ export class GitCommand {
205
205
  * history without hard-capping the result set.
206
206
  */
207
207
  listCommits(options = {}) {
208
- const args = ['log', '--all'];
208
+ const args = ['log'];
209
209
  if (options.topo_order) {
210
210
  args.push('--topo-order');
211
211
  }
@@ -356,7 +356,12 @@ export class GitCommand {
356
356
  }
357
357
  }
358
358
  diffFile(path) {
359
- return this.runChecked(['diff', '--no-ext-diff', '--', path], 'git-diff-failed').stdout;
359
+ const worktreeDiff = this.runChecked(['diff', '--no-ext-diff', '--', path], 'git-diff-failed')
360
+ .stdout;
361
+ if (worktreeDiff.trim().length > 0)
362
+ return worktreeDiff;
363
+ return this.runChecked(['diff', '--cached', '--no-ext-diff', '--', path], 'git-diff-failed')
364
+ .stdout;
360
365
  }
361
366
  diffCommit(commit) {
362
367
  return this.runChecked(['diff', `${commit}^`, commit], 'git-diff-failed').stdout;
@@ -113,14 +113,15 @@ export function parseStatusOutput(output) {
113
113
  oldPath = payloadPath;
114
114
  index += 1;
115
115
  }
116
+ const conflicted = x === 'U' ||
117
+ y === 'U' ||
118
+ (x === 'A' && y === 'A') ||
119
+ (x === 'D' && y === 'D');
116
120
  const staged = x !== ' ' && x !== '?';
117
121
  if (x === '?' || y === '?') {
118
122
  summary.untracked += 1;
119
123
  }
120
- else if (x === 'U' ||
121
- y === 'U' ||
122
- (x === 'A' && y === 'A') ||
123
- (x === 'D' && y === 'D')) {
124
+ else if (conflicted) {
124
125
  summary.conflicted += 1;
125
126
  }
126
127
  else {
@@ -134,7 +135,7 @@ export function parseStatusOutput(output) {
134
135
  files.push({
135
136
  path,
136
137
  old_path: oldPath,
137
- status: `${x}${y}`.trim() || 'M',
138
+ status: conflicted ? 'U' : `${x}${y}`.trim() || 'M',
138
139
  staged,
139
140
  resolved_conflict: false,
140
141
  hunks: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openvcs/git-plugin",
3
- "version": "0.2.0-edge.20260504.52",
3
+ "version": "0.2.0-edge.20260506.55",
4
4
  "description": "OpenVCS Git plugin - Node.js runtime",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "homepage": "https://github.com/Open-VCS/OpenVCS-Plugin-Git",
@@ -18,7 +18,7 @@
18
18
  "openvcs": {
19
19
  "id": "openvcs.git",
20
20
  "name": "Git",
21
- "version": "0.2.0-edge.20260504.52",
21
+ "version": "0.2.0-edge.20260506.55",
22
22
  "author": "OpenVCS Contributors",
23
23
  "description": "Git VCS backend plugin for OpenVCS",
24
24
  "default_enabled": true,
package/src/git.ts CHANGED
@@ -324,7 +324,7 @@ export class GitCommand {
324
324
  * history without hard-capping the result set.
325
325
  */
326
326
  listCommits(options: ListCommitsOptions = {}): { commits: CommitEntry[]; exitCode: number } {
327
- const args = ['log', '--all'];
327
+ const args = ['log'];
328
328
 
329
329
  if (options.topo_order) {
330
330
  args.push('--topo-order');
@@ -502,7 +502,12 @@ export class GitCommand {
502
502
  }
503
503
 
504
504
  diffFile(path: string): string {
505
- return this.runChecked(['diff', '--no-ext-diff', '--', path], 'git-diff-failed').stdout;
505
+ const worktreeDiff = this.runChecked(['diff', '--no-ext-diff', '--', path], 'git-diff-failed')
506
+ .stdout;
507
+ if (worktreeDiff.trim().length > 0) return worktreeDiff;
508
+
509
+ return this.runChecked(['diff', '--cached', '--no-ext-diff', '--', path], 'git-diff-failed')
510
+ .stdout;
506
511
  }
507
512
 
508
513
  diffCommit(commit: string): string {
@@ -147,16 +147,16 @@ export function parseStatusOutput(output: string): StatusParseResult {
147
147
  index += 1;
148
148
  }
149
149
 
150
+ const conflicted =
151
+ x === 'U' ||
152
+ y === 'U' ||
153
+ (x === 'A' && y === 'A') ||
154
+ (x === 'D' && y === 'D');
150
155
  const staged = x !== ' ' && x !== '?';
151
156
 
152
157
  if (x === '?' || y === '?') {
153
158
  summary.untracked += 1;
154
- } else if (
155
- x === 'U' ||
156
- y === 'U' ||
157
- (x === 'A' && y === 'A') ||
158
- (x === 'D' && y === 'D')
159
- ) {
159
+ } else if (conflicted) {
160
160
  summary.conflicted += 1;
161
161
  } else {
162
162
  if (staged) {
@@ -171,7 +171,7 @@ export function parseStatusOutput(output: string): StatusParseResult {
171
171
  files.push({
172
172
  path,
173
173
  old_path: oldPath,
174
- status: `${x}${y}`.trim() || 'M',
174
+ status: conflicted ? 'U' : `${x}${y}`.trim() || 'M',
175
175
  staged,
176
176
  resolved_conflict: false,
177
177
  hunks: [],