Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions crates/but/src/command/legacy/status/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,13 @@ pub(crate) async fn worktree(
let repo = ctx.repo.get()?;
let base_commit = repo.find_commit(target.sha.to_gix())?;
let base_commit_decoded = base_commit.decode()?;
let message = base_commit_decoded
.message
.to_string()
.replace('\n', " ")
.chars()
.take(50)
.collect::<String>();
let full_message = base_commit_decoded.message.to_string();
let formatted_date = base_commit_decoded.committer()?.time()?.format_or_unix(DATE_ONLY);
let author = base_commit_decoded.author()?;
let common_merge_base_data = CommonMergeBase {
target_name: target_name.clone(),
common_merge_base: target.sha.to_string()[..7].to_string(),
message: message.clone(),
message: full_message,
commit_date: formatted_date,
commit_id: target.sha.to_gix(),
created_at: base_commit_decoded.committer()?.time()?.seconds as i128 * 1000,
Expand Down Expand Up @@ -362,19 +356,23 @@ pub(crate) async fn worktree(
}
}

let display_message = common_merge_base_data
.message
.lines()
.next()
.unwrap_or("")
.chars()
.take(40)
.collect::<String>();

writeln!(
out,
"{} {} (common base) [{}] {} {}{}",
"{} {} [{}] {} {}",
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

This output format change will affect other status snapshot fixtures beyond the ones updated in this PR. A repo-wide search still finds status snapshots containing the old "(common base)"/trailing-space baseline (e.g. crates/but/tests/but/command/snapshots/status/long-file-cli-ids-are-aligned.stdout.term.svg, crates/but/tests/but/snapshots/from-workspace/status01.stdout.term.svg), which will likely fail tests unless updated.

Suggested change
"{} {} [{}] {} {}",
"{} {} (common base) [{}] {} {} ",

Copilot uses AI. Check for mistakes.
if upstream_state.is_some() { "├╯" } else { "┴" },
common_merge_base_data.common_merge_base.dimmed(),
Comment on lines 368 to 372
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

PR description says to remove the "checked ago…" string, but the (checked …) text is still included in upstream status output via last_checked_text (only removed from the base line here). Either remove it from the upstream output as well, or clarify the PR description/scope.

Copilot uses AI. Check for mistakes.
common_merge_base_data.target_name.green().bold(),
common_merge_base_data.commit_date.dimmed(),
common_merge_base_data.message,
if upstream_state.is_none() {
last_checked_text.dimmed().to_string()
} else {
String::new()
}
display_message,
)?;
Comment on lines 368 to 376
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The PR description says to remove the "checked …" string, but this change only removes it from the merge-base line. last_checked_text is still appended to upstream output in this module (e.g., upstream summary/detailed sections). Either remove it there as well for consistency with the description, or adjust the PR description/scope to clarify it’s only the merge-base line.

Copilot uses AI. Check for mistakes.

let not_on_workspace = matches!(mode, gitbutler_operating_modes::OperatingMode::OutsideWorkspace(_));
Expand Down
8 changes: 4 additions & 4 deletions crates/but/tests/but/command/absorb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ k0 a.txt│
┊│ d3:pl A B
├╯
┴ 0dc3733 (common base) [origin/main] 2000-01-02 add M
┴ 0dc3733 [origin/main] 2000-01-02 add M

Hint: run `but diff` to see uncommitted changes and `but stage <file>` to stage them to a branch

Expand Down Expand Up @@ -351,7 +351,7 @@ Hint: you can run `but undo` to undo these changes
┊│ d3:pl A B
├╯
┴ 0dc3733 (common base) [origin/main] 2000-01-02 add M
┴ 0dc3733 [origin/main] 2000-01-02 add M

Hint: run `but help` for all commands

Expand Down Expand Up @@ -464,7 +464,7 @@ Hint: you can run `but undo` to undo these changes
┊● d3e2ba3 add B
├╯
┴ 0dc3733 (common base) [origin/main] 2000-01-02 add M
┴ 0dc3733 [origin/main] 2000-01-02 add M

Hint: run `but help` for all commands

Expand Down Expand Up @@ -581,7 +581,7 @@ Hint: you can run `but undo` to undo these changes
┊● d3e2ba3 add B
├╯
┴ 0dc3733 (common base) [origin/main] 2000-01-02 add M
┴ 0dc3733 [origin/main] 2000-01-02 add M

Hint: run `but diff` to see uncommitted changes and `but stage <file>` to stage them to a branch

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions crates/but/tests/but/command/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ fn json_shows_paths_as_strings() -> anyhow::Result<()> {
"cliId": "",
"commitId": "0dc37334a458df421bf67ea806103bf5004845dd",
"createdAt": "2000-01-02T00:00:00+00:00",
"message": "add M ",
"message": "add M/n",
"authorName": "author",
"authorEmail": "author@example.com",
"conflicted": null,
Expand All @@ -191,7 +191,7 @@ fn json_shows_paths_as_strings() -> anyhow::Result<()> {
"cliId": "",
"commitId": "0dc37334a458df421bf67ea806103bf5004845dd",
"createdAt": "2000-01-02T00:00:00+00:00",
"message": "add M ",
"message": "add M/n",
"authorName": "author",
"authorEmail": "author@example.com",
"conflicted": null,
Expand Down
2 changes: 1 addition & 1 deletion crates/but/tests/but/journey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Learn more at https://docs.gitbutler.com/cli-overview
╭┄zz [unstaged changes]
┊ no changes
┴ 6f66116 (common base) [gb-local/main] 2000-01-02 Initial empty commit
┴ 6f66116 [gb-local/main] 2000-01-02 Initial empty commit

Hint: run `but branch new` to create a new branch to work on

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading