jj-octo 0.7.1 → 0.7.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/dist/jj-octo.js +28 -7
- package/package.json +1 -1
package/dist/jj-octo.js
CHANGED
|
@@ -18239,7 +18239,7 @@ var layer14 = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed6(fetch)
|
|
|
18239
18239
|
// package.json
|
|
18240
18240
|
var package_default = {
|
|
18241
18241
|
name: "jj-octo",
|
|
18242
|
-
version: "0.7.
|
|
18242
|
+
version: "0.7.2",
|
|
18243
18243
|
description: "A jj subcommand for GitHub that supports stacked pull requests and works in Claude Code cloud sessions",
|
|
18244
18244
|
license: "MIT",
|
|
18245
18245
|
repository: {
|
|
@@ -18449,6 +18449,10 @@ var anyOf = (revsets) => ["none()", ...revsets].join(" | ");
|
|
|
18449
18449
|
var bookmarkRevset = (bookmark) => `bookmarks(exact:"${bookmark}")`;
|
|
18450
18450
|
var lines2 = (output) => output.split(`
|
|
18451
18451
|
`).filter((line) => line !== "");
|
|
18452
|
+
var parseDescription = (json) => {
|
|
18453
|
+
const parsed = JSON.parse(json);
|
|
18454
|
+
return typeof parsed === "string" ? parsed : "";
|
|
18455
|
+
};
|
|
18452
18456
|
var readLog = (revset, template) => gen2(function* () {
|
|
18453
18457
|
const jj = yield* Jj;
|
|
18454
18458
|
return yield* jj.read(["log", "--no-graph", "--reversed", "-r", revset, "-T", template]);
|
|
@@ -18496,8 +18500,7 @@ var loggedChanges = (revset) => logLines(revset, CHANGE).pipe(map7((logged) => l
|
|
|
18496
18500
|
bookmarks = "",
|
|
18497
18501
|
json = '""'
|
|
18498
18502
|
] = line.split("\t");
|
|
18499
|
-
const
|
|
18500
|
-
const description = typeof parsed === "string" ? parsed : "";
|
|
18503
|
+
const description = parseDescription(json);
|
|
18501
18504
|
return {
|
|
18502
18505
|
bookmarks: bookmarks === "" ? [] : bookmarks.split(" "),
|
|
18503
18506
|
changeId,
|
|
@@ -18981,10 +18984,24 @@ var ignoreClaudeCodeFooterKey = "jj-octo.ignore-claude-code-footer";
|
|
|
18981
18984
|
var ignoresClaudeCodeFooter = jjFlag(ignoreClaudeCodeFooterKey);
|
|
18982
18985
|
var descriptionsOf = (commits) => commits.length === 0 ? succeed6(new Map) : readLog(commits.join(" | "), String.raw`commit_id ++ "\t" ++ description.escape_json() ++ "\n"`).pipe(map7((output) => new Map(lines2(output).map((line) => {
|
|
18983
18986
|
const [commit = "", json = '""'] = line.split("\t");
|
|
18984
|
-
|
|
18985
|
-
return [commit, typeof parsed === "string" ? parsed : ""];
|
|
18987
|
+
return [commit, parseDescription(json)];
|
|
18986
18988
|
}))));
|
|
18987
|
-
var
|
|
18989
|
+
var ownDescriptions = (bookmark, changeId) => gen2(function* () {
|
|
18990
|
+
const jj = yield* Jj;
|
|
18991
|
+
const output = yield* jj.read([
|
|
18992
|
+
"evolog",
|
|
18993
|
+
"--no-graph",
|
|
18994
|
+
"-r",
|
|
18995
|
+
bookmarkRevset(bookmark),
|
|
18996
|
+
"-T",
|
|
18997
|
+
String.raw`commit.change_id() ++ "\t" ++ commit.description().escape_json() ++ "\n"`
|
|
18998
|
+
]);
|
|
18999
|
+
return lines2(output).flatMap((line) => {
|
|
19000
|
+
const [change = "", json = '""'] = line.split("\t");
|
|
19001
|
+
return change === changeId ? [parseDescription(json)] : [];
|
|
19002
|
+
});
|
|
19003
|
+
});
|
|
19004
|
+
var syncDescription = ({ bookmark, changeId, description }, pullRequest, { ignoreClaudeCodeFooter, overwriteDescriptions, pushedDescription }) => gen2(function* () {
|
|
18988
19005
|
const git = yield* Git;
|
|
18989
19006
|
const jj = yield* Jj;
|
|
18990
19007
|
const describe = (text) => jj.run(["describe", "-r", bookmarkRevset(bookmark), "-m", text]);
|
|
@@ -18993,6 +19010,10 @@ var syncDescription = ({ bookmark, description }, pullRequest, { ignoreClaudeCod
|
|
|
18993
19010
|
ignoreClaudeCodeFooter
|
|
18994
19011
|
});
|
|
18995
19012
|
const pushed = normalizedDescription(pushedDescription, { ignoreClaudeCodeFooter });
|
|
19013
|
+
const isOwnEarlier = local !== onGitHub && onGitHub !== pushed && (yield* ownDescriptions(bookmark, changeId)).some((text) => normalizedDescription(text, { ignoreClaudeCodeFooter }) === onGitHub);
|
|
19014
|
+
if (isOwnEarlier) {
|
|
19015
|
+
return some2(local);
|
|
19016
|
+
}
|
|
18996
19017
|
return yield* value4(descriptionSyncFor({ local, onGitHub, pushed })).pipe(tag3("InSync", () => succeed6(none2())), tag3("TakeGitHub", () => describe(onGitHub).pipe(andThen2(error(`took the description of #${pullRequest.number} from GitHub`)), as2(none2()))), tag3("SendLocal", () => succeed6(some2(local))), tag3("Merge", () => gen2(function* () {
|
|
18997
19018
|
if (overwriteDescriptions) {
|
|
18998
19019
|
return some2(local);
|
|
@@ -19472,7 +19493,7 @@ var submitCommand = make31("submit", {
|
|
|
19472
19493
|
overwriteDescriptions: Boolean6("overwrite-descriptions").pipe(withDefault5(false), withDescription2("Where a description changed both locally and on GitHub, send the local one instead of merging the two")),
|
|
19473
19494
|
publish: Boolean6("publish").pipe(withDefault5(false), withDescription2("Open new pull requests ready for review, instead of as drafts")),
|
|
19474
19495
|
revision: revisionFlag("The top change to submit")
|
|
19475
|
-
}, ({ overwriteDescriptions, publish, revision }) => asUserError(submit(revision, { draft: !publish, overwriteDescriptions }).pipe(provide3(GitHubFromOrigin)))).pipe(withHelp("Push a change and the ones below it, and open their pull requests", "Pushes the bookmark of each of those changes. An empty working copy means the change below it, so from the top of a stack this submits all of it. Opens a pull request for each branch that has none, with the title and body from the change's description. Points each pull request at the branch below it, and the bottom one at the default branch.", "New pull requests are opened as drafts, or ready for review with `--publish`. The flag doesn't change a pull request that already exists.", "Keeps each pull request's title and body the same as its change's description. A description edited on GitHub is written into the change, one edited locally is sent to the pull request, and edits on both sides are merged line by line. Edits to the same lines stop the submit before anything is pushed.", "First, where any of those changes' pull requests merged or any of their branches changed on GitHub, syncs their stack as `jj gh sync` does, and leaves other stacks alone. That drops the merged changes, takes what GitHub added to the branches, and rebases the rest onto the trunk, so the push doesn't undo GitHub's work.", "Stops before changing anything where one of their branches was deleted on GitHub and their change doesn't count as merged: no pull request from it merged, another commit merged, or the change was edited since. It says how to push the change again, or drop it.", "Registers the pull requests as one GitHub stack. A stack of one change is a single pull request, which GitHub has no stack for.", "If changes were reordered, inserted or dropped since the last submit, the GitHub stack is dissolved and registered again under a new number. The pull requests stay open, including the one of a dropped change."));
|
|
19496
|
+
}, ({ overwriteDescriptions, publish, revision }) => asUserError(submit(revision, { draft: !publish, overwriteDescriptions }).pipe(provide3(GitHubFromOrigin)))).pipe(withHelp("Push a change and the ones below it, and open their pull requests", "Pushes the bookmark of each of those changes. An empty working copy means the change below it, so from the top of a stack this submits all of it. Opens a pull request for each branch that has none, with the title and body from the change's description. Points each pull request at the branch below it, and the bottom one at the default branch.", "New pull requests are opened as drafts, or ready for review with `--publish`. The flag doesn't change a pull request that already exists.", "Keeps each pull request's title and body the same as its change's description. A description edited on GitHub is written into the change, one edited locally is sent to the pull request, and edits on both sides are merged line by line. A local edit pushed with `jj git push` from this repository is sent too, unless the pull request was also edited on GitHub since the last submit. Edits to the same lines stop the submit before anything is pushed.", "First, where any of those changes' pull requests merged or any of their branches changed on GitHub, syncs their stack as `jj gh sync` does, and leaves other stacks alone. That drops the merged changes, takes what GitHub added to the branches, and rebases the rest onto the trunk, so the push doesn't undo GitHub's work.", "Stops before changing anything where one of their branches was deleted on GitHub and their change doesn't count as merged: no pull request from it merged, another commit merged, or the change was edited since. It says how to push the change again, or drop it.", "Registers the pull requests as one GitHub stack. A stack of one change is a single pull request, which GitHub has no stack for.", "If changes were reordered, inserted or dropped since the last submit, the GitHub stack is dissolved and registered again under a new number. The pull requests stay open, including the one of a dropped change."));
|
|
19476
19497
|
|
|
19477
19498
|
// src/cli/gh/command.ts
|
|
19478
19499
|
var jjGhCommand = make31("jj gh").pipe(withSubcommands([
|