File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ pub enum Subcommands {
147
147
/// As StackIDs are going away, BranchDetails would be the part that remains.
148
148
StackDetails {
149
149
/// The ID of the stack to list details for.
150
- id : StackId ,
150
+ id : Option < StackId > ,
151
151
} ,
152
152
/// Returns detailed
153
153
BranchDetails {
Original file line number Diff line number Diff line change @@ -196,15 +196,19 @@ pub mod stacks {
196
196
}
197
197
}
198
198
199
- pub fn details ( id : StackId , current_dir : & Path , v3 : bool ) -> anyhow:: Result < ( ) > {
199
+ pub fn details ( id : Option < StackId > , current_dir : & Path , v3 : bool ) -> anyhow:: Result < ( ) > {
200
200
let project = project_from_path ( current_dir) ?;
201
201
let ctx = CommandContext :: open ( & project, AppSettings :: default ( ) ) ?;
202
202
let details = if v3 {
203
203
let meta = ref_metadata_toml ( ctx. project ( ) ) ?;
204
204
let repo = ctx. gix_repo_for_merging_non_persisting ( ) ?;
205
- but_workspace:: stack_details_v3 ( id. into ( ) , & repo, & meta)
205
+ but_workspace:: stack_details_v3 ( id, & repo, & meta)
206
206
} else {
207
- but_workspace:: stack_details ( & project. gb_dir ( ) , id, & ctx)
207
+ but_workspace:: stack_details (
208
+ & project. gb_dir ( ) ,
209
+ id. context ( "a StackID is needed for the old implementation" ) ?,
210
+ & ctx,
211
+ )
208
212
} ?;
209
213
debug_print ( details)
210
214
}
Original file line number Diff line number Diff line change @@ -441,14 +441,18 @@ pub fn stack_details_v3(
441
441
. into_iter ( )
442
442
. find_map ( |( id, stack) | ( id == stack_id) . then_some ( stack) ) )
443
443
}
444
- let ref_info_options = ref_info:: Options {
444
+ let mut ref_info_options = ref_info:: Options {
445
445
// TODO(perf): make this so it can be enabled for a specific stack-id.
446
446
expensive_commit_info : true ,
447
447
traversal : meta. graph_options ( ) ,
448
448
} ;
449
449
let mut stack = match stack_id {
450
450
None => {
451
451
// assume single-branch mode.
452
+ // Make sure the UI isn't overwhelmed, this currently happens easily on some repos where a lot of commits
453
+ // would otherwise be returned. The problem is that then the workspace might not be correct, but there isn't
454
+ // another way that still allows to extend the range via gas-stations. Maybe one day we won't need this.
455
+ ref_info_options. traversal . hard_limit = Some ( 500 ) ;
452
456
let mut info = head_info ( repo, meta, ref_info_options) ?;
453
457
if info. stacks . len ( ) != 1 {
454
458
bail ! (
You can’t perform that action at this time.
0 commit comments