geeto 0.1.0-beta.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/LICENSE +21 -0
- package/README.md +152 -0
- package/lib/api/copilot-adapter.d.ts +11 -0
- package/lib/api/copilot-adapter.d.ts.map +1 -0
- package/lib/api/copilot-adapter.js +41 -0
- package/lib/api/copilot-adapter.js.map +1 -0
- package/lib/api/copilot-sdk.d.ts +48 -0
- package/lib/api/copilot-sdk.d.ts.map +1 -0
- package/lib/api/copilot-sdk.js +451 -0
- package/lib/api/copilot-sdk.js.map +1 -0
- package/lib/api/copilot.d.ts +21 -0
- package/lib/api/copilot.d.ts.map +1 -0
- package/lib/api/copilot.js +87 -0
- package/lib/api/copilot.js.map +1 -0
- package/lib/api/gemini-sdk.d.ts +24 -0
- package/lib/api/gemini-sdk.d.ts.map +1 -0
- package/lib/api/gemini-sdk.js +245 -0
- package/lib/api/gemini-sdk.js.map +1 -0
- package/lib/api/gemini.d.ts +21 -0
- package/lib/api/gemini.d.ts.map +1 -0
- package/lib/api/gemini.js +87 -0
- package/lib/api/gemini.js.map +1 -0
- package/lib/api/openrouter-sdk.d.ts +58 -0
- package/lib/api/openrouter-sdk.d.ts.map +1 -0
- package/lib/api/openrouter-sdk.js +341 -0
- package/lib/api/openrouter-sdk.js.map +1 -0
- package/lib/api/openrouter.d.ts +17 -0
- package/lib/api/openrouter.d.ts.map +1 -0
- package/lib/api/openrouter.js +111 -0
- package/lib/api/openrouter.js.map +1 -0
- package/lib/api/trello.d.ts +17 -0
- package/lib/api/trello.d.ts.map +1 -0
- package/lib/api/trello.js +72 -0
- package/lib/api/trello.js.map +1 -0
- package/lib/cli/input.d.ts +39 -0
- package/lib/cli/input.d.ts.map +1 -0
- package/lib/cli/input.js +119 -0
- package/lib/cli/input.js.map +1 -0
- package/lib/cli/menu.d.ts +9 -0
- package/lib/cli/menu.d.ts.map +1 -0
- package/lib/cli/menu.js +201 -0
- package/lib/cli/menu.js.map +1 -0
- package/lib/core/constants.d.ts +22 -0
- package/lib/core/constants.d.ts.map +1 -0
- package/lib/core/constants.js +24 -0
- package/lib/core/constants.js.map +1 -0
- package/lib/core/copilot-setup.d.ts +13 -0
- package/lib/core/copilot-setup.d.ts.map +1 -0
- package/lib/core/copilot-setup.js +447 -0
- package/lib/core/copilot-setup.js.map +1 -0
- package/lib/core/gemini-setup.d.ts +8 -0
- package/lib/core/gemini-setup.d.ts.map +1 -0
- package/lib/core/gemini-setup.js +84 -0
- package/lib/core/gemini-setup.js.map +1 -0
- package/lib/core/menu-constants.d.ts +24 -0
- package/lib/core/menu-constants.d.ts.map +1 -0
- package/lib/core/menu-constants.js +22 -0
- package/lib/core/menu-constants.js.map +1 -0
- package/lib/core/openrouter-setup.d.ts +8 -0
- package/lib/core/openrouter-setup.d.ts.map +1 -0
- package/lib/core/openrouter-setup.js +73 -0
- package/lib/core/openrouter-setup.js.map +1 -0
- package/lib/core/setup.d.ts +21 -0
- package/lib/core/setup.d.ts.map +1 -0
- package/lib/core/setup.js +88 -0
- package/lib/core/setup.js.map +1 -0
- package/lib/core/trello-setup.d.ts +8 -0
- package/lib/core/trello-setup.d.ts.map +1 -0
- package/lib/core/trello-setup.js +107 -0
- package/lib/core/trello-setup.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +250 -0
- package/lib/index.js.map +1 -0
- package/lib/types/index.d.ts +78 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utils/branch-naming.d.ts +11 -0
- package/lib/utils/branch-naming.d.ts.map +1 -0
- package/lib/utils/branch-naming.js +396 -0
- package/lib/utils/branch-naming.js.map +1 -0
- package/lib/utils/colors.d.ts +14 -0
- package/lib/utils/colors.d.ts.map +1 -0
- package/lib/utils/colors.js +14 -0
- package/lib/utils/colors.js.map +1 -0
- package/lib/utils/commit-helpers.d.ts +53 -0
- package/lib/utils/commit-helpers.d.ts.map +1 -0
- package/lib/utils/commit-helpers.js +177 -0
- package/lib/utils/commit-helpers.js.map +1 -0
- package/lib/utils/config.d.ts +87 -0
- package/lib/utils/config.d.ts.map +1 -0
- package/lib/utils/config.js +326 -0
- package/lib/utils/config.js.map +1 -0
- package/lib/utils/display.d.ts +27 -0
- package/lib/utils/display.d.ts.map +1 -0
- package/lib/utils/display.js +116 -0
- package/lib/utils/display.js.map +1 -0
- package/lib/utils/error-helpers.d.ts +27 -0
- package/lib/utils/error-helpers.d.ts.map +1 -0
- package/lib/utils/error-helpers.js +102 -0
- package/lib/utils/error-helpers.js.map +1 -0
- package/lib/utils/exec.d.ts +18 -0
- package/lib/utils/exec.d.ts.map +1 -0
- package/lib/utils/exec.js +96 -0
- package/lib/utils/exec.js.map +1 -0
- package/lib/utils/git-ai-errors.d.ts +10 -0
- package/lib/utils/git-ai-errors.d.ts.map +1 -0
- package/lib/utils/git-ai-errors.js +71 -0
- package/lib/utils/git-ai-errors.js.map +1 -0
- package/lib/utils/git-ai.d.ts +26 -0
- package/lib/utils/git-ai.d.ts.map +1 -0
- package/lib/utils/git-ai.js +603 -0
- package/lib/utils/git-ai.js.map +1 -0
- package/lib/utils/git-commands.d.ts +21 -0
- package/lib/utils/git-commands.d.ts.map +1 -0
- package/lib/utils/git-commands.js +58 -0
- package/lib/utils/git-commands.js.map +1 -0
- package/lib/utils/git-errors.d.ts +76 -0
- package/lib/utils/git-errors.d.ts.map +1 -0
- package/lib/utils/git-errors.js +565 -0
- package/lib/utils/git-errors.js.map +1 -0
- package/lib/utils/git.d.ts +61 -0
- package/lib/utils/git.d.ts.map +1 -0
- package/lib/utils/git.js +245 -0
- package/lib/utils/git.js.map +1 -0
- package/lib/utils/logging.d.ts +25 -0
- package/lib/utils/logging.d.ts.map +1 -0
- package/lib/utils/logging.js +71 -0
- package/lib/utils/logging.js.map +1 -0
- package/lib/utils/menu-builders.d.ts +47 -0
- package/lib/utils/menu-builders.d.ts.map +1 -0
- package/lib/utils/menu-builders.js +34 -0
- package/lib/utils/menu-builders.js.map +1 -0
- package/lib/utils/platform.d.ts +13 -0
- package/lib/utils/platform.d.ts.map +1 -0
- package/lib/utils/platform.js +32 -0
- package/lib/utils/platform.js.map +1 -0
- package/lib/utils/spinner-wrapper.d.ts +16 -0
- package/lib/utils/spinner-wrapper.d.ts.map +1 -0
- package/lib/utils/spinner-wrapper.js +56 -0
- package/lib/utils/spinner-wrapper.js.map +1 -0
- package/lib/utils/state.d.ts +22 -0
- package/lib/utils/state.d.ts.map +1 -0
- package/lib/utils/state.js +75 -0
- package/lib/utils/state.js.map +1 -0
- package/lib/utils/time.d.ts +4 -0
- package/lib/utils/time.d.ts.map +1 -0
- package/lib/utils/time.js +29 -0
- package/lib/utils/time.js.map +1 -0
- package/lib/utils/type-guards.d.ts +10 -0
- package/lib/utils/type-guards.d.ts.map +1 -0
- package/lib/utils/type-guards.js +29 -0
- package/lib/utils/type-guards.js.map +1 -0
- package/lib/workflows/ai-provider.d.ts +13 -0
- package/lib/workflows/ai-provider.d.ts.map +1 -0
- package/lib/workflows/ai-provider.js +55 -0
- package/lib/workflows/ai-provider.js.map +1 -0
- package/lib/workflows/author.d.ts +4 -0
- package/lib/workflows/author.d.ts.map +1 -0
- package/lib/workflows/author.js +80 -0
- package/lib/workflows/author.js.map +1 -0
- package/lib/workflows/branch-helpers.d.ts +9 -0
- package/lib/workflows/branch-helpers.d.ts.map +1 -0
- package/lib/workflows/branch-helpers.js +406 -0
- package/lib/workflows/branch-helpers.js.map +1 -0
- package/lib/workflows/branch-utils.d.ts +9 -0
- package/lib/workflows/branch-utils.d.ts.map +1 -0
- package/lib/workflows/branch-utils.js +61 -0
- package/lib/workflows/branch-utils.js.map +1 -0
- package/lib/workflows/branch.d.ts +12 -0
- package/lib/workflows/branch.d.ts.map +1 -0
- package/lib/workflows/branch.js +555 -0
- package/lib/workflows/branch.js.map +1 -0
- package/lib/workflows/cleanup.d.ts +10 -0
- package/lib/workflows/cleanup.d.ts.map +1 -0
- package/lib/workflows/cleanup.js +287 -0
- package/lib/workflows/cleanup.js.map +1 -0
- package/lib/workflows/commit.d.ts +10 -0
- package/lib/workflows/commit.d.ts.map +1 -0
- package/lib/workflows/commit.js +771 -0
- package/lib/workflows/commit.js.map +1 -0
- package/lib/workflows/main-steps.d.ts +12 -0
- package/lib/workflows/main-steps.d.ts.map +1 -0
- package/lib/workflows/main-steps.js +407 -0
- package/lib/workflows/main-steps.js.map +1 -0
- package/lib/workflows/main.d.ts +8 -0
- package/lib/workflows/main.d.ts.map +1 -0
- package/lib/workflows/main.js +720 -0
- package/lib/workflows/main.js.map +1 -0
- package/lib/workflows/security-gate.d.ts +8 -0
- package/lib/workflows/security-gate.d.ts.map +1 -0
- package/lib/workflows/security-gate.js +447 -0
- package/lib/workflows/security-gate.js.map +1 -0
- package/lib/workflows/settings.d.ts +15 -0
- package/lib/workflows/settings.d.ts.map +1 -0
- package/lib/workflows/settings.js +438 -0
- package/lib/workflows/settings.js.map +1 -0
- package/lib/workflows/trello-menu.d.ts +16 -0
- package/lib/workflows/trello-menu.d.ts.map +1 -0
- package/lib/workflows/trello-menu.js +361 -0
- package/lib/workflows/trello-menu.js.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comprehensive git error handling utilities
|
|
3
|
+
* Handles common git operation failures with user-friendly recovery options
|
|
4
|
+
*/
|
|
5
|
+
import { colors } from './colors.js';
|
|
6
|
+
import { exec, execAsync, execSilent } from './exec.js';
|
|
7
|
+
import { log } from './logging.js';
|
|
8
|
+
import { confirm } from '../cli/input.js';
|
|
9
|
+
import { select } from '../cli/menu.js';
|
|
10
|
+
/**
|
|
11
|
+
* Check if there are uncommitted changes in the working directory
|
|
12
|
+
*/
|
|
13
|
+
export const hasUncommittedChanges = () => {
|
|
14
|
+
try {
|
|
15
|
+
const status = execSilent('git status --porcelain');
|
|
16
|
+
return status.trim().length > 0;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Check if there's a merge in progress
|
|
24
|
+
*/
|
|
25
|
+
export const isMergeInProgress = () => {
|
|
26
|
+
try {
|
|
27
|
+
execSilent('git rev-parse -q --verify MERGE_HEAD');
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Check if there's a rebase in progress
|
|
36
|
+
*/
|
|
37
|
+
export const isRebaseInProgress = () => {
|
|
38
|
+
try {
|
|
39
|
+
const gitDir = execSilent('git rev-parse --git-dir');
|
|
40
|
+
const rebaseDir = `${gitDir}/rebase-merge`;
|
|
41
|
+
const rebaseApply = `${gitDir}/rebase-apply`;
|
|
42
|
+
execSilent(`test -d "${rebaseDir}" || test -d "${rebaseApply}"`);
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Handle uncommitted changes before checkout
|
|
51
|
+
* Offers user options: stash, commit, force checkout, or cancel
|
|
52
|
+
*/
|
|
53
|
+
export const handleUncommittedChangesBeforeCheckout = async (context) => {
|
|
54
|
+
if (!hasUncommittedChanges()) {
|
|
55
|
+
return 'proceed';
|
|
56
|
+
}
|
|
57
|
+
console.log('');
|
|
58
|
+
log.warn('You have uncommitted changes that would be overwritten by checkout.');
|
|
59
|
+
if (context) {
|
|
60
|
+
console.log('');
|
|
61
|
+
log.info(context);
|
|
62
|
+
}
|
|
63
|
+
console.log('');
|
|
64
|
+
// Show list of uncommitted files
|
|
65
|
+
const status = execSilent('git status --porcelain');
|
|
66
|
+
const files = status.split('\n').filter(Boolean).slice(0, 10);
|
|
67
|
+
console.log(`${colors.cyan}Uncommitted files:${colors.reset}`);
|
|
68
|
+
for (const file of files) {
|
|
69
|
+
console.log(` ${file}`);
|
|
70
|
+
}
|
|
71
|
+
if (status.split('\n').filter(Boolean).length > 10) {
|
|
72
|
+
console.log(` ... and ${status.split('\n').filter(Boolean).length - 10} more`);
|
|
73
|
+
}
|
|
74
|
+
console.log('');
|
|
75
|
+
const choice = await select('How would you like to proceed?', [
|
|
76
|
+
{ label: 'Stash changes and checkout', value: 'stash' },
|
|
77
|
+
{ label: 'Commit changes first', value: 'commit' },
|
|
78
|
+
{ label: 'Force checkout (discard changes)', value: 'force' },
|
|
79
|
+
{ label: 'Cancel checkout', value: 'cancel' },
|
|
80
|
+
]);
|
|
81
|
+
switch (choice) {
|
|
82
|
+
case 'stash': {
|
|
83
|
+
try {
|
|
84
|
+
exec('git stash push -m "Geeto auto-stash before checkout"');
|
|
85
|
+
log.success('Changes stashed. You can restore them later with: git stash pop');
|
|
86
|
+
return 'proceed';
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
log.error('Failed to stash changes');
|
|
90
|
+
return 'cancel';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
case 'commit': {
|
|
94
|
+
// Stage all changes and signal that commit workflow should be triggered
|
|
95
|
+
try {
|
|
96
|
+
exec('git add -A');
|
|
97
|
+
log.info('Changes staged. Entering commit workflow...');
|
|
98
|
+
return 'commit-needed';
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
log.error('Failed to stage changes');
|
|
102
|
+
return 'cancel';
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
case 'force': {
|
|
106
|
+
const confirmForce = confirm(`${colors.red}Warning: This will discard all uncommitted changes. Continue?${colors.reset}`);
|
|
107
|
+
if (confirmForce) {
|
|
108
|
+
return 'proceed';
|
|
109
|
+
}
|
|
110
|
+
return 'cancel';
|
|
111
|
+
}
|
|
112
|
+
default: {
|
|
113
|
+
log.info('Checkout cancelled');
|
|
114
|
+
return 'cancel';
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Safe git checkout with error handling
|
|
120
|
+
*/
|
|
121
|
+
export const safeCheckout = async (branchName, options) => {
|
|
122
|
+
try {
|
|
123
|
+
// For creating new branch or force checkout, proceed directly
|
|
124
|
+
if (options?.create || options?.force) {
|
|
125
|
+
const cmd = options.create
|
|
126
|
+
? `git checkout -b "${branchName}"`
|
|
127
|
+
: `git checkout -f "${branchName}"`;
|
|
128
|
+
exec(cmd);
|
|
129
|
+
return { success: true };
|
|
130
|
+
}
|
|
131
|
+
// Try checkout first - git will allow it if changes don't conflict
|
|
132
|
+
try {
|
|
133
|
+
exec(`git checkout "${branchName}"`);
|
|
134
|
+
return { success: true };
|
|
135
|
+
}
|
|
136
|
+
catch (checkoutError) {
|
|
137
|
+
const checkoutErrMsg = checkoutError instanceof Error ? checkoutError.message : String(checkoutError);
|
|
138
|
+
// If checkout failed due to uncommitted changes that would be overwritten, ask user
|
|
139
|
+
if (checkoutErrMsg.includes('would be overwritten') ||
|
|
140
|
+
checkoutErrMsg.includes('Your local changes')) {
|
|
141
|
+
// Try checkout with -m flag (three-way merge) first
|
|
142
|
+
console.log('');
|
|
143
|
+
log.info('Trying checkout with merge (-m flag)...');
|
|
144
|
+
try {
|
|
145
|
+
exec(`git checkout -m "${branchName}"`, true);
|
|
146
|
+
// Check if merge resulted in conflicts
|
|
147
|
+
const status = execSilent('git status --porcelain');
|
|
148
|
+
const hasConflicts = status.includes('UU ') || status.includes('AA ') || status.includes('DD ');
|
|
149
|
+
if (hasConflicts) {
|
|
150
|
+
// Conflicts detected - ask user what to do
|
|
151
|
+
console.log('');
|
|
152
|
+
log.warn('Checkout with merge resulted in conflicts.');
|
|
153
|
+
console.log('');
|
|
154
|
+
// Show conflicted files
|
|
155
|
+
const conflictedFiles = status
|
|
156
|
+
.split('\n')
|
|
157
|
+
.filter((line) => line.includes('UU ') || line.includes('AA ') || line.includes('DD '))
|
|
158
|
+
.slice(0, 10);
|
|
159
|
+
console.log(`${colors.red}Conflicted files:${colors.reset}`);
|
|
160
|
+
for (const file of conflictedFiles) {
|
|
161
|
+
console.log(` ${file}`);
|
|
162
|
+
}
|
|
163
|
+
console.log('');
|
|
164
|
+
const conflictChoice = await select('What would you like to do?', [
|
|
165
|
+
{ label: 'Resolve conflicts manually (stay on this branch)', value: 'resolve' },
|
|
166
|
+
{ label: 'Abort and go back to selection', value: 'abort' },
|
|
167
|
+
]);
|
|
168
|
+
if (conflictChoice === 'abort') {
|
|
169
|
+
// Abort the merge checkout
|
|
170
|
+
try {
|
|
171
|
+
exec('git merge --abort', true);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
// If merge --abort fails, try checkout --merge --abort
|
|
175
|
+
try {
|
|
176
|
+
exec('git checkout --merge --abort', true);
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
// Last resort: hard reset to clean state
|
|
180
|
+
exec('git reset --merge', true);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
log.info('Merge checkout aborted');
|
|
184
|
+
return { success: false, error: 'Merge conflict - aborted by user' };
|
|
185
|
+
}
|
|
186
|
+
// User chose to resolve manually
|
|
187
|
+
log.info('Resolve conflicts and commit when ready.');
|
|
188
|
+
log.info(' 1. Edit conflicted files');
|
|
189
|
+
log.info(' 2. Stage resolved files: git add <files>');
|
|
190
|
+
log.info(' 3. Commit: git commit');
|
|
191
|
+
return { success: true }; // Consider it successful since user is on target branch
|
|
192
|
+
}
|
|
193
|
+
// No conflicts - checkout with merge succeeded
|
|
194
|
+
log.success(`Checked out to ${branchName} with uncommitted changes merged`);
|
|
195
|
+
return { success: true };
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
// -m flag failed for reasons other than conflict (e.g., can't three-way merge)
|
|
199
|
+
// Fall back to original menu
|
|
200
|
+
log.warn('Checkout with merge not possible');
|
|
201
|
+
console.log('');
|
|
202
|
+
}
|
|
203
|
+
// Show the interactive menu for handling uncommitted changes
|
|
204
|
+
const canProceed = await handleUncommittedChangesBeforeCheckout(options?.context);
|
|
205
|
+
if (canProceed === 'cancel') {
|
|
206
|
+
return { success: false, error: 'Cancelled by user' };
|
|
207
|
+
}
|
|
208
|
+
if (canProceed === 'commit-needed') {
|
|
209
|
+
return { success: false, commitNeeded: true, error: 'Commit required before checkout' };
|
|
210
|
+
}
|
|
211
|
+
// User chose stash or force - retry checkout
|
|
212
|
+
exec(`git checkout "${branchName}"`);
|
|
213
|
+
return { success: true };
|
|
214
|
+
}
|
|
215
|
+
// Other checkout errors - propagate them
|
|
216
|
+
throw checkoutError;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
221
|
+
// Parse specific error types
|
|
222
|
+
if (errMsg.includes('did not match any file(s) known to git')) {
|
|
223
|
+
return { success: false, error: `Branch '${branchName}' does not exist` };
|
|
224
|
+
}
|
|
225
|
+
if (errMsg.includes('already exists')) {
|
|
226
|
+
return { success: false, error: `Branch '${branchName}' already exists` };
|
|
227
|
+
}
|
|
228
|
+
return { success: false, error: errMsg };
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Handle merge conflicts
|
|
233
|
+
*/
|
|
234
|
+
export const handleMergeConflicts = async () => {
|
|
235
|
+
console.log('');
|
|
236
|
+
log.error('Merge conflict detected!');
|
|
237
|
+
console.log('');
|
|
238
|
+
// List conflicted files
|
|
239
|
+
try {
|
|
240
|
+
const conflicted = execSilent('git diff --name-only --diff-filter=U');
|
|
241
|
+
const files = conflicted.split('\n').filter(Boolean);
|
|
242
|
+
console.log(`${colors.red}Conflicted files:${colors.reset}`);
|
|
243
|
+
for (const file of files) {
|
|
244
|
+
console.log(` ${colors.red}✗${colors.reset} ${file}`);
|
|
245
|
+
}
|
|
246
|
+
console.log('');
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
// Ignore error in listing conflicts
|
|
250
|
+
}
|
|
251
|
+
const choice = await select('How would you like to resolve the conflict?', [
|
|
252
|
+
{ label: 'Abort merge (go back to previous state)', value: 'abort' },
|
|
253
|
+
{ label: 'Resolve manually (I will fix conflicts and continue)', value: 'manual' },
|
|
254
|
+
]);
|
|
255
|
+
if (choice === 'abort') {
|
|
256
|
+
try {
|
|
257
|
+
exec('git merge --abort');
|
|
258
|
+
log.info('Merge aborted. Repository restored to previous state.');
|
|
259
|
+
return 'abort';
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
log.error('Failed to abort merge');
|
|
263
|
+
return 'manual';
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return 'manual';
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Safe git merge with error handling
|
|
270
|
+
*/
|
|
271
|
+
export const safeMerge = async (sourceBranch, options) => {
|
|
272
|
+
try {
|
|
273
|
+
// Check if merge/rebase is already in progress
|
|
274
|
+
if (isMergeInProgress()) {
|
|
275
|
+
log.error('A merge is already in progress. Please resolve it first.');
|
|
276
|
+
return { success: false, error: 'Merge already in progress' };
|
|
277
|
+
}
|
|
278
|
+
if (isRebaseInProgress()) {
|
|
279
|
+
log.error('A rebase is in progress. Please finish it first.');
|
|
280
|
+
return { success: false, error: 'Rebase in progress' };
|
|
281
|
+
}
|
|
282
|
+
// Build merge command
|
|
283
|
+
let cmd = `git merge ${sourceBranch}`;
|
|
284
|
+
if (options?.noFf) {
|
|
285
|
+
cmd += ' --no-ff';
|
|
286
|
+
}
|
|
287
|
+
if (options?.squash) {
|
|
288
|
+
cmd += ' --squash';
|
|
289
|
+
}
|
|
290
|
+
exec(cmd);
|
|
291
|
+
return { success: true };
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
295
|
+
// Check if it's a merge conflict
|
|
296
|
+
if (errMsg.includes('CONFLICT') ||
|
|
297
|
+
errMsg.includes('Automatic merge failed') ||
|
|
298
|
+
isMergeInProgress()) {
|
|
299
|
+
const resolution = await handleMergeConflicts();
|
|
300
|
+
if (resolution === 'abort') {
|
|
301
|
+
return { success: false, conflict: true, error: 'Merge conflict - aborted by user' };
|
|
302
|
+
}
|
|
303
|
+
// User chose manual resolution
|
|
304
|
+
log.info('Waiting for you to resolve conflicts...');
|
|
305
|
+
log.info('After resolving:');
|
|
306
|
+
log.info(' 1. Stage resolved files: git add <files>');
|
|
307
|
+
log.info(' 2. Complete merge: git commit');
|
|
308
|
+
log.info(' 3. Or abort: git merge --abort');
|
|
309
|
+
return { success: false, conflict: true, error: 'Merge conflict - manual resolution needed' };
|
|
310
|
+
}
|
|
311
|
+
return { success: false, error: errMsg };
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* Handle push authentication errors
|
|
316
|
+
*/
|
|
317
|
+
const handlePushAuthError = async () => {
|
|
318
|
+
console.log('');
|
|
319
|
+
log.error('Authentication failed for push operation');
|
|
320
|
+
console.log('');
|
|
321
|
+
log.info('Common solutions:');
|
|
322
|
+
log.info(' 1. Check your git credentials (username/password or SSH key)');
|
|
323
|
+
log.info(' 2. For HTTPS: Ensure your PAT/password is correct');
|
|
324
|
+
log.info(' 3. For SSH: Ensure your SSH key is added to your git provider');
|
|
325
|
+
log.info(' 4. Check network connectivity');
|
|
326
|
+
console.log('');
|
|
327
|
+
const choice = await select('What would you like to do?', [
|
|
328
|
+
{ label: 'Retry push', value: 'retry' },
|
|
329
|
+
{ label: 'Cancel push', value: 'cancel' },
|
|
330
|
+
]);
|
|
331
|
+
return choice;
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* Handle push rejected (non-fast-forward) errors
|
|
335
|
+
*/
|
|
336
|
+
const handlePushRejected = async () => {
|
|
337
|
+
console.log('');
|
|
338
|
+
log.error(`Push rejected: Updates were rejected because the remote contains work you don't have.`);
|
|
339
|
+
console.log('');
|
|
340
|
+
log.info('This usually happens when:');
|
|
341
|
+
log.info(' • Someone else pushed to the same branch');
|
|
342
|
+
log.info(' • You rebased or amended commits that were already pushed');
|
|
343
|
+
console.log('');
|
|
344
|
+
const choice = await select('How would you like to proceed?', [
|
|
345
|
+
{ label: 'Pull and merge remote changes first', value: 'pull' },
|
|
346
|
+
{ label: 'Force push (overwrite remote - dangerous!)', value: 'force' },
|
|
347
|
+
{ label: 'Cancel push', value: 'cancel' },
|
|
348
|
+
]);
|
|
349
|
+
if (choice === 'force') {
|
|
350
|
+
const confirmForce = confirm(`${colors.red}Warning: Force push will overwrite remote history. Continue?${colors.reset}`);
|
|
351
|
+
if (!confirmForce) {
|
|
352
|
+
return 'cancel';
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return choice;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Safe git push with comprehensive error handling
|
|
359
|
+
*/
|
|
360
|
+
export const safePush = async (branchName, options) => {
|
|
361
|
+
const branch = branchName ?? execSilent('git branch --show-current');
|
|
362
|
+
let cmd = `git push`;
|
|
363
|
+
if (options?.setUpstream) {
|
|
364
|
+
cmd += ` -u origin "${branch}"`;
|
|
365
|
+
}
|
|
366
|
+
if (options?.force) {
|
|
367
|
+
cmd += ' --force';
|
|
368
|
+
}
|
|
369
|
+
let retries = 0;
|
|
370
|
+
const maxRetries = 3;
|
|
371
|
+
while (retries < maxRetries) {
|
|
372
|
+
try {
|
|
373
|
+
await execAsync(cmd, false);
|
|
374
|
+
return { success: true };
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
378
|
+
// Authentication error
|
|
379
|
+
if (errMsg.includes('Authentication failed') ||
|
|
380
|
+
errMsg.includes('Permission denied') ||
|
|
381
|
+
errMsg.includes('Could not read from remote') ||
|
|
382
|
+
errMsg.includes('fatal: unable to access')) {
|
|
383
|
+
const action = await handlePushAuthError();
|
|
384
|
+
if (action === 'cancel') {
|
|
385
|
+
return { success: false, error: 'Authentication failed - cancelled by user' };
|
|
386
|
+
}
|
|
387
|
+
retries++;
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
// Push rejected (non-fast-forward)
|
|
391
|
+
if (errMsg.includes('rejected') ||
|
|
392
|
+
errMsg.includes('non-fast-forward') ||
|
|
393
|
+
errMsg.includes('Updates were rejected')) {
|
|
394
|
+
const action = await handlePushRejected();
|
|
395
|
+
if (action === 'cancel') {
|
|
396
|
+
return { success: false, error: 'Push rejected - cancelled by user' };
|
|
397
|
+
}
|
|
398
|
+
if (action === 'force') {
|
|
399
|
+
return safePush(branchName, { ...options, force: true });
|
|
400
|
+
}
|
|
401
|
+
if (action === 'pull') {
|
|
402
|
+
try {
|
|
403
|
+
// Try to pull with rebase
|
|
404
|
+
log.info('Pulling remote changes...');
|
|
405
|
+
exec(`git pull --rebase origin "${branch}"`);
|
|
406
|
+
log.success('Successfully pulled and rebased');
|
|
407
|
+
// Retry push after successful pull
|
|
408
|
+
retries++;
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
log.error('Failed to pull remote changes');
|
|
413
|
+
return { success: false, error: 'Pull failed after rejected push' };
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
// Network error
|
|
418
|
+
if (errMsg.includes('Could not resolve host') ||
|
|
419
|
+
errMsg.includes('Failed to connect') ||
|
|
420
|
+
errMsg.includes('Connection timed out')) {
|
|
421
|
+
log.error('Network error during push');
|
|
422
|
+
const retry = confirm('Network error. Retry push?');
|
|
423
|
+
if (!retry) {
|
|
424
|
+
return { success: false, error: 'Network error - cancelled by user' };
|
|
425
|
+
}
|
|
426
|
+
retries++;
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
// No upstream branch
|
|
430
|
+
if (errMsg.includes('no upstream branch') || errMsg.includes('has no upstream branch')) {
|
|
431
|
+
log.info('No upstream branch configured. Setting up...');
|
|
432
|
+
return safePush(branchName, { ...options, setUpstream: true });
|
|
433
|
+
}
|
|
434
|
+
// Unknown error
|
|
435
|
+
log.error(`Push failed: ${errMsg}`);
|
|
436
|
+
return { success: false, error: errMsg };
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return { success: false, error: 'Push failed after maximum retries' };
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* Safe git commit with error handling
|
|
443
|
+
*/
|
|
444
|
+
export const safeCommit = async (message, options) => {
|
|
445
|
+
try {
|
|
446
|
+
// Check if there's a merge in progress
|
|
447
|
+
if (isMergeInProgress()) {
|
|
448
|
+
// For merge commits, allow commit without message check
|
|
449
|
+
let cmd = 'git commit';
|
|
450
|
+
if (options?.noVerify) {
|
|
451
|
+
cmd += ' --no-verify';
|
|
452
|
+
}
|
|
453
|
+
if (!message || message.trim() === '') {
|
|
454
|
+
cmd += ' --no-edit';
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
const escapedMessage = message.replaceAll('"', String.raw `\\"`);
|
|
458
|
+
cmd += ` -m "${escapedMessage}"`;
|
|
459
|
+
}
|
|
460
|
+
exec(cmd);
|
|
461
|
+
return { success: true };
|
|
462
|
+
}
|
|
463
|
+
// Check if there are staged changes
|
|
464
|
+
const stagedFiles = execSilent('git diff --name-only --cached');
|
|
465
|
+
if (!stagedFiles.trim() && !options?.amend) {
|
|
466
|
+
log.warn('No staged changes to commit');
|
|
467
|
+
const choice = await select('What would you like to do?', [
|
|
468
|
+
{ label: 'Stage all changes and commit', value: 'stage-all' },
|
|
469
|
+
{ label: 'Cancel commit', value: 'cancel' },
|
|
470
|
+
]);
|
|
471
|
+
if (choice === 'cancel') {
|
|
472
|
+
return { success: false, error: 'No staged changes - cancelled by user' };
|
|
473
|
+
}
|
|
474
|
+
// Stage all changes
|
|
475
|
+
exec('git add -A');
|
|
476
|
+
}
|
|
477
|
+
// Build commit command
|
|
478
|
+
let cmd = 'git commit';
|
|
479
|
+
if (message && message.trim() !== '') {
|
|
480
|
+
const escapedMessage = message.replaceAll('"', String.raw `\\"`);
|
|
481
|
+
cmd += ` -m "${escapedMessage}"`;
|
|
482
|
+
}
|
|
483
|
+
if (options?.amend) {
|
|
484
|
+
cmd += ' --amend';
|
|
485
|
+
}
|
|
486
|
+
if (options?.noVerify) {
|
|
487
|
+
cmd += ' --no-verify';
|
|
488
|
+
}
|
|
489
|
+
exec(cmd);
|
|
490
|
+
return { success: true };
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
494
|
+
// Pre-commit hook failed
|
|
495
|
+
if (errMsg.includes('pre-commit hook failed') || errMsg.includes('hook declined')) {
|
|
496
|
+
log.error('Pre-commit hook failed');
|
|
497
|
+
const skipHook = confirm('Skip pre-commit hooks and commit anyway?');
|
|
498
|
+
if (skipHook) {
|
|
499
|
+
return safeCommit(message, { ...options, noVerify: true });
|
|
500
|
+
}
|
|
501
|
+
return { success: false, error: 'Pre-commit hook failed - cancelled by user' };
|
|
502
|
+
}
|
|
503
|
+
return { success: false, error: errMsg };
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* Safe git pull with error handling
|
|
508
|
+
*/
|
|
509
|
+
export const safePull = async (remote = 'origin', branch) => {
|
|
510
|
+
try {
|
|
511
|
+
// Check for uncommitted changes
|
|
512
|
+
if (hasUncommittedChanges()) {
|
|
513
|
+
log.warn('You have uncommitted changes');
|
|
514
|
+
const choice = await select('How would you like to proceed?', [
|
|
515
|
+
{ label: 'Stash changes and pull', value: 'stash' },
|
|
516
|
+
{ label: 'Cancel pull', value: 'cancel' },
|
|
517
|
+
]);
|
|
518
|
+
if (choice === 'cancel') {
|
|
519
|
+
return { success: false, error: 'Uncommitted changes - cancelled by user' };
|
|
520
|
+
}
|
|
521
|
+
exec('git stash push -m "Geeto auto-stash before pull"');
|
|
522
|
+
log.success('Changes stashed');
|
|
523
|
+
}
|
|
524
|
+
const branchArg = branch ? ` ${branch}` : '';
|
|
525
|
+
await execAsync(`git pull ${remote}${branchArg}`, false);
|
|
526
|
+
// If we stashed, ask if user wants to pop
|
|
527
|
+
try {
|
|
528
|
+
const stashList = execSilent('git stash list');
|
|
529
|
+
if (stashList.includes('Geeto auto-stash before pull')) {
|
|
530
|
+
const popStash = confirm('Pull complete. Pop stashed changes?');
|
|
531
|
+
if (popStash) {
|
|
532
|
+
exec('git stash pop');
|
|
533
|
+
log.success('Stashed changes restored');
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
catch {
|
|
538
|
+
// Ignore stash errors
|
|
539
|
+
}
|
|
540
|
+
return { success: true };
|
|
541
|
+
}
|
|
542
|
+
catch (error) {
|
|
543
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
544
|
+
// Merge conflict during pull
|
|
545
|
+
if (errMsg.includes('CONFLICT') || errMsg.includes('Automatic merge failed')) {
|
|
546
|
+
const resolution = await handleMergeConflicts();
|
|
547
|
+
if (resolution === 'abort') {
|
|
548
|
+
return { success: false, error: 'Pull conflict - aborted by user' };
|
|
549
|
+
}
|
|
550
|
+
return { success: false, error: 'Pull conflict - manual resolution needed' };
|
|
551
|
+
}
|
|
552
|
+
// Authentication error
|
|
553
|
+
if (errMsg.includes('Authentication failed') || errMsg.includes('Permission denied')) {
|
|
554
|
+
log.error('Authentication failed during pull');
|
|
555
|
+
return { success: false, error: 'Authentication failed' };
|
|
556
|
+
}
|
|
557
|
+
// Network error
|
|
558
|
+
if (errMsg.includes('Could not resolve host') || errMsg.includes('Failed to connect')) {
|
|
559
|
+
log.error('Network error during pull');
|
|
560
|
+
return { success: false, error: 'Network error' };
|
|
561
|
+
}
|
|
562
|
+
return { success: false, error: errMsg };
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
//# sourceMappingURL=git-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-errors.js","sourceRoot":"","sources":["../../src/utils/git-errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,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QAChB,IAAI,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;YACtF,GAAG,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;YACtC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,CAAA;QACnD,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;IAC1C,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Git helpers */
|
|
2
|
+
import { generateBranchNameWithProvider, getAIProviderDisplayName, getAIProviderShortName, getModelDisplayName, interactiveAIFallback, isContextLimitFailure, isTransientAIFailure } from './git-ai.js';
|
|
3
|
+
export { generateBranchNameWithProvider, getAIProviderDisplayName, getAIProviderShortName, getModelDisplayName, interactiveAIFallback, isTransientAIFailure, isContextLimitFailure, };
|
|
4
|
+
export { handleBranchNaming } from './branch-naming.js';
|
|
5
|
+
/**
|
|
6
|
+
* Check if branch exists locally
|
|
7
|
+
*/
|
|
8
|
+
export declare const branchExists: (branchName: string) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Check if remote branch exists
|
|
11
|
+
*/
|
|
12
|
+
export declare const remoteBranchExists: (branchName: string) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Validate branch name format
|
|
15
|
+
*/
|
|
16
|
+
export declare const validateBranchName: (branchName: string) => {
|
|
17
|
+
valid: boolean;
|
|
18
|
+
reason?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get the current branch name
|
|
22
|
+
*/
|
|
23
|
+
export declare const getCurrentBranch: () => string;
|
|
24
|
+
/**
|
|
25
|
+
* Get all local branches
|
|
26
|
+
*/
|
|
27
|
+
export declare const getLocalBranches: () => string[];
|
|
28
|
+
/**
|
|
29
|
+
* Get changed files (unstaged + untracked)
|
|
30
|
+
*/
|
|
31
|
+
export declare const getChangedFiles: () => string[];
|
|
32
|
+
/**
|
|
33
|
+
* Get staged files
|
|
34
|
+
*/
|
|
35
|
+
export declare const getStagedFiles: () => string[];
|
|
36
|
+
/**
|
|
37
|
+
* Get recommended prefix separator based on existing branches
|
|
38
|
+
*/
|
|
39
|
+
export declare const getRecommendedPrefixSeparator: () => "/" | "#";
|
|
40
|
+
/**
|
|
41
|
+
* Generate branch name suggestions based on staged files
|
|
42
|
+
*/
|
|
43
|
+
export declare const generateBranchSuggestions: (stagedFiles: string[], prefix: string) => string[];
|
|
44
|
+
/**
|
|
45
|
+
* Get branch prefix based on current branch (smart auto-detection)
|
|
46
|
+
*/
|
|
47
|
+
export declare const getBranchPrefix: (currentBranch: string) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Push wrapper with authentication retry loop.
|
|
50
|
+
* Keeps prompting the user to retry if authentication fails so the user can update credentials externally.
|
|
51
|
+
*/
|
|
52
|
+
export declare const pushWithRetry: (cmd: string, silent?: boolean) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Branch naming result interface
|
|
55
|
+
*/
|
|
56
|
+
export interface BranchNamingResult {
|
|
57
|
+
workingBranch: string;
|
|
58
|
+
shouldRestart: boolean;
|
|
59
|
+
cancelled: boolean;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAGlB,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAIpB,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,GACtB,CAAA;AAED,OAAO,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