upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/sub_commands/list.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-18 14:48:20 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-18 14:48:20 +0000
commitfcff4541e1f36b6575596c353637b25aeae9bdcf (patch)
treed897ce824ca49a8ffef9f55f5f36777687573aab /src/bin/ngit/sub_commands/list.rs
parente6bb9effa194fe63b5e969c090dbe6e93f13d312 (diff)
feat: handle missing optional patch tags for pr/ flow
- Add mbox_parser module to extract metadata from patch content - Extract author/committer from From: and Date: headers when tags missing - Extract commit message body as fallback for description tag - Implement best-guess parent commit logic using committer timestamps - Update patch_supports_commit_ids to accept mbox-parseable patches - Enable patches without optional tags to appear as pr/ branches
Diffstat (limited to 'src/bin/ngit/sub_commands/list.rs')
-rw-r--r--src/bin/ngit/sub_commands/list.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs
index 80eec21..133ac83 100644
--- a/src/bin/ngit/sub_commands/list.rs
+++ b/src/bin/ngit/sub_commands/list.rs
@@ -35,7 +35,7 @@ use crate::{
35 git::{Repo, RepoActions, str_to_sha1}, 35 git::{Repo, RepoActions, str_to_sha1},
36 git_events::{ 36 git_events::{
37 commit_msg_from_patch_oneliner, event_is_revision_root, event_to_cover_letter, 37 commit_msg_from_patch_oneliner, event_is_revision_root, event_to_cover_letter,
38 patch_supports_commit_ids, 38 get_parent_commit_from_patch, patch_supports_commit_ids,
39 }, 39 },
40 repo_ref::get_repo_coordinates_when_remote_unknown, 40 repo_ref::get_repo_coordinates_when_remote_unknown,
41}; 41};
@@ -703,15 +703,14 @@ async fn launch_interactive() -> Result<()> {
703 .get_checked_out_branch_name()? 703 .get_checked_out_branch_name()?
704 .eq(&cover_letter.get_branch_name_with_pr_prefix_and_shorthand_id()?); 704 .eq(&cover_letter.get_branch_name_with_pr_prefix_and_shorthand_id()?);
705 705
706 let proposal_base_commit = str_to_sha1(&tag_value( 706 let last_patch = most_recent_proposal_patch_chain_or_pr_or_pr_update
707 most_recent_proposal_patch_chain_or_pr_or_pr_update 707 .last()
708 .last() 708 .context(
709 .context( 709 "there should be at least one patch as we have already checked for this",
710 "there should be at least one patch as we have already checked for this", 710 )?;
711 )?, 711
712 "parent-commit", 712 let proposal_base_commit = str_to_sha1(&get_parent_commit_from_patch(last_patch, Some(&git_repo))?)
713 )?) 713 .context("failed to get valid parent commit id from patch")?;
714 .context("failed to get valid parent commit id from patch")?;
715 714
716 let (main_branch_name, master_tip) = git_repo.get_main_or_master_branch()?; 715 let (main_branch_name, master_tip) = git_repo.get_main_or_master_branch()?;
717 716