Skip to content

Lite: use branch operand as source/target for whole branch rather than just branch reference#13807

Open
OliverJAsh wants to merge 1 commit into
masterfrom
push-ytzmzynttowk
Open

Lite: use branch operand as source/target for whole branch rather than just branch reference#13807
OliverJAsh wants to merge 1 commit into
masterfrom
push-ytzmzynttowk

Conversation

@OliverJAsh
Copy link
Copy Markdown
Contributor

@OliverJAsh OliverJAsh commented May 14, 2026

Table of all permutations for future reference. In Jujutsu I believe all of these operations can be expressed as follows, using -r for commit sources and -b for branch sources:

  • above (after): jj rebase <source> -A <target>
  • onto: jj rebase <source> -o <target>
  • below (before): jj rebase <source> -B <target>
Source Target Side Function
Whole branch Whole branch above moveBranch
Whole branch Whole branch onto missing
Whole branch Whole branch below missing
Whole branch Branch reference above moveBranch
Whole branch Branch reference onto missing
Whole branch Branch reference below missing
Whole branch Commit above missing
Whole branch Commit onto missing
Whole branch Commit below missing
Commit Whole branch above commitMove with relativeTo: { type: "referenceBytes" }
Commit Whole branch onto missing
Commit Whole branch below missing
Commit Branch reference above commitMove with relativeTo: { type: "referenceBytes" }
Commit Branch reference onto missing
Commit Branch reference below commitMove with relativeTo: { type: "referenceBytes" }
Commit Commit above commitMove with relativeTo: { type: "commit" }
Commit Commit onto missing
Commit Commit below commitMove with relativeTo: { type: "commit" }

@OliverJAsh OliverJAsh marked this pull request as ready for review May 14, 2026 08:32
Copilot AI review requested due to automatic review settings May 14, 2026 08:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts Lite workspace outline operations so a branch operand represents the whole branch segment rather than only the branch reference.

Changes:

  • Wraps the full branch segment with OperandC so branch source/target behavior applies to the whole segment.
  • Limits referenceBytes relative moves to above branch targets to avoid treating “below branch” as below only the reference.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/lite/ui/src/routes/project/$id/workspace/OutlinePanel.tsx Moves branch operand wrapping from just BranchRow to the full branch TreeItem.
apps/lite/ui/src/operations/operation.ts Updates branch-target relative move matching to only allow above branch-reference moves.

Comment thread apps/lite/ui/src/operations/operation.ts Outdated
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: daee7a5508

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// contents. However, `RelativeTo` is interpreted to mean just the
// branch reference rather than the whole branch (reference + contents),
// meaning we `below` won't work as expected.
side: "above",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore below-reference moves onto branches

When a commit is moved onto a branch target with side: "below", this new branch match no longer produces a relativeTo, so getOperations() disables moveBelow entirely for branch operands. That removes the UI path for moving a commit onto an empty branch/branch header; the existing CLI/TUI implementations perform that exact operation as RelativeTo::Reference(...), InsertSide::Below in crates/but/src/command/legacy/status/tui/operations.rs:273-278 and crates/but/src/command/legacy/rub/mod.rs:709-714. Please keep a separate branch-reference target or allow the commit-to-branch below case to continue using referenceBytes.

Useful? React with 👍 / 👎.

@OliverJAsh OliverJAsh force-pushed the push-wnzspoqmqrmk branch from 7b94edf to f6a3694 Compare May 14, 2026 08:47
@OliverJAsh OliverJAsh force-pushed the push-ytzmzynttowk branch from daee7a5 to eb22290 Compare May 14, 2026 08:47
@OliverJAsh OliverJAsh force-pushed the push-ytzmzynttowk branch from eb22290 to 0c352ac Compare May 14, 2026 08:52
Copilot AI review requested due to automatic review settings May 14, 2026 08:53
@OliverJAsh OliverJAsh force-pushed the push-ytzmzynttowk branch from 0c352ac to 4b70a16 Compare May 14, 2026 08:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@OliverJAsh OliverJAsh force-pushed the push-wnzspoqmqrmk branch from 4fded45 to 9da0c0b Compare May 14, 2026 09:16
@OliverJAsh OliverJAsh force-pushed the push-ytzmzynttowk branch from 4b70a16 to 9700aea Compare May 14, 2026 09:16
@OliverJAsh OliverJAsh force-pushed the push-wnzspoqmqrmk branch from 9da0c0b to f00a6ac Compare May 14, 2026 09:31
@OliverJAsh OliverJAsh force-pushed the push-ytzmzynttowk branch from 9700aea to 355bf40 Compare May 14, 2026 09:31
Base automatically changed from push-wnzspoqmqrmk to master May 14, 2026 10:11
Copilot AI review requested due to automatic review settings May 14, 2026 11:31
@OliverJAsh OliverJAsh force-pushed the push-ytzmzynttowk branch from 355bf40 to 6329862 Compare May 14, 2026 11:31
@OliverJAsh OliverJAsh changed the base branch from master to push-wqlntwpnxlmt May 14, 2026 11:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Base automatically changed from push-wqlntwpnxlmt to master May 14, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants