-
Notifications
You must be signed in to change notification settings - Fork 925
simplify status base line #12290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplify status base line #12290
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
|
@@ -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) [{}] {} {}{}", | ||
| "{} {} [{}] {} {}", | ||
| if upstream_state.is_some() { "├╯" } else { "┴" }, | ||
| common_merge_base_data.common_merge_base.dimmed(), | ||
|
Comment on lines
368
to
372
|
||
| 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
|
||
|
|
||
| let not_on_workspace = matches!(mode, gitbutler_operating_modes::OperatingMode::OutsideWorkspace(_)); | ||
|
|
||
There was a problem hiding this comment.
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.