File tree 4 files changed +19
-0
lines changed
gitoxide-core/src/repository/merge
4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ pub fn commit(
18
18
format,
19
19
file_favor,
20
20
in_memory,
21
+ debug,
21
22
} : Options ,
22
23
) -> anyhow:: Result < ( ) > {
23
24
if format != OutputFormat :: Human {
@@ -63,6 +64,9 @@ pub fn commit(
63
64
writeln ! ( out, "{tree_id} (wrote {written} trees)" ) ?;
64
65
}
65
66
67
+ if debug {
68
+ writeln ! ( err, "{:#?}" , & res. conflicts) ?;
69
+ }
66
70
if !has_conflicts {
67
71
writeln ! ( err, "{} possibly resolved conflicts" , res. conflicts. len( ) ) ?;
68
72
}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ pub struct Options {
4
4
pub format : OutputFormat ,
5
5
pub file_favor : Option < gix:: merge:: tree:: FileFavor > ,
6
6
pub in_memory : bool ,
7
+ pub debug : bool ,
7
8
}
8
9
9
10
pub ( super ) mod function {
@@ -29,6 +30,7 @@ pub(super) mod function {
29
30
format,
30
31
file_favor,
31
32
in_memory,
33
+ debug,
32
34
} : Options ,
33
35
) -> anyhow:: Result < ( ) > {
34
36
if format != OutputFormat :: Human {
@@ -77,6 +79,9 @@ pub(super) mod function {
77
79
writeln ! ( out, "{tree_id} (wrote {written} trees)" ) ?;
78
80
}
79
81
82
+ if debug {
83
+ writeln ! ( err, "{:#?}" , & res. conflicts) ?;
84
+ }
80
85
if !has_conflicts {
81
86
writeln ! ( err, "{} possibly resolved conflicts" , res. conflicts. len( ) ) ?;
82
87
}
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ pub fn main() -> Result<()> {
174
174
merge:: SubCommands :: Tree {
175
175
in_memory,
176
176
file_favor,
177
+ debug,
177
178
ours,
178
179
base,
179
180
theirs,
@@ -196,13 +197,15 @@ pub fn main() -> Result<()> {
196
197
format,
197
198
file_favor : file_favor. map ( Into :: into) ,
198
199
in_memory,
200
+ debug,
199
201
} ,
200
202
)
201
203
} ,
202
204
) ,
203
205
merge:: SubCommands :: Commit {
204
206
in_memory,
205
207
file_favor,
208
+ debug,
206
209
ours,
207
210
theirs,
208
211
} => prepare_and_run (
@@ -223,6 +226,7 @@ pub fn main() -> Result<()> {
223
226
format,
224
227
file_favor : file_favor. map ( Into :: into) ,
225
228
in_memory,
229
+ debug,
226
230
} ,
227
231
)
228
232
} ,
Original file line number Diff line number Diff line change @@ -420,6 +420,9 @@ pub mod merge {
420
420
/// Decide how to resolve content conflicts in files. If unset, write conflict markers and fail.
421
421
#[ clap( long, short = 'f' ) ]
422
422
file_favor : Option < FileFavor > ,
423
+ /// Print additional information about conflicts for debugging.
424
+ #[ clap( long, short = 'd' ) ]
425
+ debug : bool ,
423
426
424
427
/// A revspec to our treeish.
425
428
#[ clap( value_name = "OURS" , value_parser = crate :: shared:: AsBString ) ]
@@ -441,6 +444,9 @@ pub mod merge {
441
444
/// Decide how to resolve content conflicts in files. If unset, write conflict markers and fail.
442
445
#[ clap( long, short = 'f' ) ]
443
446
file_favor : Option < FileFavor > ,
447
+ /// Print additional information about conflicts for debugging.
448
+ #[ clap( long, short = 'd' ) ]
449
+ debug : bool ,
444
450
445
451
/// A revspec to our committish.
446
452
#[ clap( value_name = "OURS" , value_parser = crate :: shared:: AsBString ) ]
You can’t perform that action at this time.
0 commit comments