zapdev 1.13.0 → 1.14.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/README.md +4 -4
- package/dist/cli.js +16 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ Stages all changes, scans them with Gitleaks when installed, generates Conventio
|
|
|
114
114
|
- **Unified review:** generates messages in parallel, then presents every message with its repository name and branch. Repositories with pending changes are shown in bold when terminal styling is enabled.
|
|
115
115
|
- **Actions:** commit all, commit only a named repository, edit a named repository's message, or cancel. Editing returns to the review menu.
|
|
116
116
|
|
|
117
|
-
Repositories with no new changes can still send existing commits. Unselected or cancelled changes remain staged; failed or unselected commit drafts are not pushed. The branch is chosen before committing, never when pushing. Push confirmation is asked once, only for repositories with a
|
|
117
|
+
Repositories with no new changes can still send existing commits. Unselected or cancelled changes remain staged; failed or unselected commit drafts are not pushed. The branch is chosen before committing, never when pushing. Push confirmation is asked once, only for repositories with a configured upstream remote; it is omitted when none have one.
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
zapdev commit
|
|
@@ -127,7 +127,7 @@ zapdev commit
|
|
|
127
127
|
| `--effort <effort>` | Override the reasoning effort |
|
|
128
128
|
| `-t, --type <type>` | Force an exact lowercase Conventional Commit type (`feat`, `fix`, `chore`, etc.) |
|
|
129
129
|
| `-p, --push` | Skip push confirmation and push the current branch |
|
|
130
|
-
| `--pull` | Pull fast-forward updates in
|
|
130
|
+
| `--pull` | Pull fast-forward updates in repositories with an upstream remote before staging or message generation |
|
|
131
131
|
| `-s, --staged` | Commit only changes that are already staged |
|
|
132
132
|
| `-y, --yes` | Skip commit review; still confirm push unless `--push` is set |
|
|
133
133
|
|
|
@@ -143,13 +143,13 @@ Before contacting the LLM endpoint, zapdev runs `gitleaks git --staged --verbose
|
|
|
143
143
|
|
|
144
144
|
Preparation and commit failures are reported per repository while the others continue. A push failure stops all remaining sends. Any failure produces a nonzero exit code.
|
|
145
145
|
|
|
146
|
-
With `--pull`, repositories are pulled one at a time before any staging, secret scan, or message generation. Git uses each current branch's configured upstream.
|
|
146
|
+
With `--pull`, repositories are pulled one at a time before any staging, secret scan, or message generation. Git uses each current branch's configured upstream. Repositories without a configured upstream remote are skipped with a warning, even if they have a single remote. Divergent history, a missing upstream branch, or conflicting local changes stop the entire flow before staging; no rebase, merge commit, or automatic stash is performed. Earlier successful pulls remain applied.
|
|
147
147
|
|
|
148
148
|
In a terminal, commit, pull, and push output is streamed into Clack task logs; silent commands create no output block. Git keeps terminal input, but stdout/stderr are pipes: hooks requiring a TTY on those streams are not supported. Git controls hook stdin; hooks can read from `/dev/tty`, although prompts written there appear outside the blocks. `--yes` skips commit review, not native prompts. Without a terminal, stdout/stderr are streamed directly. Each hook has a 60-second deadline, including time spent answering prompts; override it with `ZD_HOOK_TIMEOUT=120 zapdev commit`.
|
|
149
149
|
|
|
150
150
|
Immediately before each selected commit, zapdev asks for a local branch only when the current name exactly matches `main`, `master`, `principal`, `dev`, or `development`, including with `--yes`. The first prompt starts empty; subsequent prompts reuse the previous input across repositories. Press Enter to accept the prefilled name; an empty or cleared input keeps the current branch and leaves the next prompt empty. A different name switches to the existing local branch or creates it from HEAD, without forcing or discarding pending changes. Other branches and repositories with nothing to commit never trigger this prompt. Cancelling stops the remaining commits and all pushes; earlier commits remain local.
|
|
151
151
|
|
|
152
|
-
Pushes always target a remote branch with the current local branch's name, with no destination input. They use the current branch's upstream remote
|
|
152
|
+
Pushes always target a remote branch with the current local branch's name, with no destination input. They use only the current branch's configured upstream remote and run `git push <remote> HEAD:refs/heads/<current-branch>`. Repositories without a configured upstream remote are skipped with a warning, even if they have a single remote. Pushes run directly, without a preliminary fetch or history comparison; Git handles up-to-date branches and rejects non-fast-forward updates. A missing destination branch can be created even without new changes. No rebase, merge, retry, or force-push.
|
|
153
153
|
|
|
154
154
|
Without a TTY, zapdev commits prepared repositories on nonprotected branches automatically; protected-branch commits are refused and changes remain staged. `--push` can publish without a TTY; without it, commits stay local. Repositories without new changes do not trigger an LLM call, branch prompt, or new commit.
|
|
155
155
|
|
package/dist/cli.js
CHANGED
|
@@ -1854,7 +1854,7 @@ function _getBuiltinFlags(long, short, userNames, userAliases) {
|
|
|
1854
1854
|
// package.json
|
|
1855
1855
|
var package_default = {
|
|
1856
1856
|
name: "zapdev",
|
|
1857
|
-
version: "1.
|
|
1857
|
+
version: "1.14.0",
|
|
1858
1858
|
description: "Fast, performant and lightweight git chores and dev tools using your terminal and an OpenAI-compatible LLM endpoint.",
|
|
1859
1859
|
type: "module",
|
|
1860
1860
|
bin: {
|
|
@@ -2440,11 +2440,10 @@ async function getRepoStatus(repo) {
|
|
|
2440
2440
|
hasChanges: lines.some((line) => !line.startsWith("#"))
|
|
2441
2441
|
};
|
|
2442
2442
|
}
|
|
2443
|
-
async function
|
|
2443
|
+
async function getUpstreamRemote(repo, branch) {
|
|
2444
2444
|
const remotes = (await git(["remote"], repo)).trim().split("\n").filter(Boolean);
|
|
2445
2445
|
const upstream = (await git(["for-each-ref", "--format=%(upstream:remotename)", `refs/heads/${branch}`], repo)).trim();
|
|
2446
|
-
|
|
2447
|
-
return remotes.length === 1 ? remotes[0] : null;
|
|
2446
|
+
return remotes.includes(upstream) ? upstream : null;
|
|
2448
2447
|
}
|
|
2449
2448
|
async function push(repo, remote, branch, onHook, onOutput) {
|
|
2450
2449
|
await git(["check-ref-format", "--branch", branch], repo);
|
|
@@ -2689,6 +2688,17 @@ var commitCommand = defineCommand({
|
|
|
2689
2688
|
if (args.pull) {
|
|
2690
2689
|
for (const repo of repos) {
|
|
2691
2690
|
const label = basename(repo);
|
|
2691
|
+
try {
|
|
2692
|
+
const branch = await currentBranch(repo);
|
|
2693
|
+
if (!await getUpstreamRemote(repo, branch)) {
|
|
2694
|
+
log.warn(`${label}: no configured upstream remote. Skipping pull.`);
|
|
2695
|
+
continue;
|
|
2696
|
+
}
|
|
2697
|
+
} catch (error) {
|
|
2698
|
+
reportGitFailure(`${label}: pull failed`, error);
|
|
2699
|
+
process.exitCode = 1;
|
|
2700
|
+
return;
|
|
2701
|
+
}
|
|
2692
2702
|
if (!await runGitTask(label, "pull", `${label}: pulled`, (onHook, onOutput) => git(["pull", "--ff-only", "--no-rebase", "--no-autostash"], repo, onHook, onOutput))) {
|
|
2693
2703
|
process.exitCode = 1;
|
|
2694
2704
|
return;
|
|
@@ -2780,9 +2790,9 @@ var commitCommand = defineCommand({
|
|
|
2780
2790
|
for (const { repo, label } of toSend) {
|
|
2781
2791
|
try {
|
|
2782
2792
|
const branch = await currentBranch(repo);
|
|
2783
|
-
const remote = await
|
|
2793
|
+
const remote = await getUpstreamRemote(repo, branch);
|
|
2784
2794
|
if (remote) destinations.push({ repo, label, branch, remote });
|
|
2785
|
-
else log.warn(`${label}: no
|
|
2795
|
+
else log.warn(`${label}: no configured upstream remote. Skipping push; commit remains local.`);
|
|
2786
2796
|
} catch (error) {
|
|
2787
2797
|
reportGitFailure(`${label}: push failed`, error);
|
|
2788
2798
|
process.exitCode = 1;
|