just playing with tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

config: Allow hiding the 'how to resolve conflicts' hint

This only deals with a single hint for now to resolve any discussions
around naming and approach.

+76 -9
+3
CHANGELOG.md
··· 20 20 21 21 ### New features 22 22 23 + * The 'how to resolve conflicts' hint that is shown when conflicts appear can 24 + be hidden by setting `hints.resolving-conflicts = false`. 25 + 23 26 ### Fixed bugs 24 27 25 28 ## [0.27.0] - 2025-03-05
+4
cli/src/cli_util.rs
··· 2283 2283 repo: &ReadonlyRepo, 2284 2284 conflicted_commits: Vec<CommitId>, 2285 2285 ) -> Result<(), CommandError> { 2286 + if !self.settings().get_bool("hints.resolving-conflicts")? { 2287 + return Ok(()); 2288 + } 2289 + 2286 2290 let only_one_conflicted_commit = conflicted_commits.len() == 1; 2287 2291 let root_conflicts_revset = RevsetExpression::commits(conflicted_commits) 2288 2292 .roots()
+7
cli/src/config-schema.json
··· 695 695 "default": false 696 696 } 697 697 } 698 + }, 699 + "hints": { 700 + "type": "object", 701 + "description": "Various hints in jj's UI that can be disabled", 702 + "additionalProperties": { 703 + "type": "boolean" 704 + } 698 705 } 699 706 } 700 707 }
+1
cli/src/config.rs
··· 490 490 let parse = |text: &'static str| ConfigLayer::parse(ConfigSource::Default, text).unwrap(); 491 491 let mut layers = vec![ 492 492 parse(include_str!("config/colors.toml")), 493 + parse(include_str!("config/hints.toml")), 493 494 parse(include_str!("config/merge_tools.toml")), 494 495 parse(include_str!("config/misc.toml")), 495 496 parse(include_str!("config/revsets.toml")),
+2
cli/src/config/hints.toml
··· 1 + [hints] 2 + resolving-conflicts = true
+37
cli/tests/test_repo_change_report.rs
··· 224 224 [EOF] 225 225 "); 226 226 } 227 + 228 + #[test] 229 + fn test_report_conflicts_with_resolving_conflicts_hint_disabled() { 230 + let test_env = TestEnvironment::default(); 231 + test_env.run_jj_in(".", ["git", "init", "repo"]).success(); 232 + let repo_path = test_env.env_root().join("repo"); 233 + 234 + std::fs::write(repo_path.join("file"), "A\n").unwrap(); 235 + test_env.run_jj_in(&repo_path, ["commit", "-m=A"]).success(); 236 + std::fs::write(repo_path.join("file"), "B\n").unwrap(); 237 + test_env.run_jj_in(&repo_path, ["commit", "-m=B"]).success(); 238 + std::fs::write(repo_path.join("file"), "C\n").unwrap(); 239 + test_env.run_jj_in(&repo_path, ["commit", "-m=C"]).success(); 240 + 241 + let output = test_env.run_jj_in( 242 + &repo_path, 243 + [ 244 + "rebase", 245 + "-s=description(B)", 246 + "-d=root()", 247 + "--config=hints.resolving-conflicts=false", 248 + ], 249 + ); 250 + insta::assert_snapshot!(output, @r" 251 + ------- stderr ------- 252 + Rebased 3 commits onto destination 253 + Working copy now at: zsuskuln f8a2c4e0 (conflict) (empty) (no description set) 254 + Parent commit : kkmpptxz 2271a49e (conflict) C 255 + Added 0 files, modified 1 files, removed 0 files 256 + Warning: There are unresolved conflicts at these paths: 257 + file 2-sided conflict including 1 deletion 258 + New conflicts appeared in these commits: 259 + kkmpptxz 2271a49e (conflict) C 260 + rlvkpnrz b7d83633 (conflict) B 261 + [EOF] 262 + "); 263 + }
+22 -9
cli/tests/test_status_command.rs
··· 254 254 [EOF] 255 255 "); 256 256 257 + let output = test_env.run_jj_in( 258 + &repo_path, 259 + ["status", "--config=hints.resolving-conflicts=false"], 260 + ); 261 + insta::assert_snapshot!(output, @r" 262 + The working copy has no changes. 263 + Working copy : yqosqzyt dcb25635 (conflict) (empty) boom-cont-2 264 + Parent commit: royxmykx 664a4c6c (conflict) (empty) boom-cont 265 + Warning: There are unresolved conflicts at these paths: 266 + conflicted.txt 2-sided conflict 267 + [EOF] 268 + "); 269 + 257 270 // Resolve conflict 258 271 test_env 259 272 .run_jj_in(&repo_path, ["new", "--message", "fixed 1"]) ··· 270 283 let output = test_env.run_jj_in(&repo_path, ["log", "-r", "::"]); 271 284 272 285 insta::assert_snapshot!(output, @r" 273 - @ kmkuslsw test.user@example.com 2001-02-03 08:05:19 caa7e9d5 286 + @ wqnwkozp test.user@example.com 2001-02-03 08:05:20 c4a6dbc2 274 287 │ fixed 2 275 - ○ kpqxywon test.user@example.com 2001-02-03 08:05:18 26bf6863 288 + ○ kmkuslsw test.user@example.com 2001-02-03 08:05:19 fcebf6ee 276 289 │ fixed 1 277 290 × yqosqzyt test.user@example.com 2001-02-03 08:05:13 dcb25635 conflict 278 291 │ (empty) boom-cont-2 ··· 295 308 insta::assert_snapshot!(output, @r" 296 309 Working copy changes: 297 310 M conflicted.txt 298 - Working copy : kmkuslsw caa7e9d5 fixed 2 299 - Parent commit: kpqxywon 26bf6863 fixed 1 311 + Working copy : wqnwkozp c4a6dbc2 fixed 2 312 + Parent commit: kmkuslsw fcebf6ee fixed 1 300 313 [EOF] 301 314 "); 302 315 ··· 306 319 let output = test_env.run_jj_in(&repo_path, ["log", "-r", "::"]); 307 320 308 321 insta::assert_snapshot!(output, @r" 309 - ○ kmkuslsw test.user@example.com 2001-02-03 08:05:19 caa7e9d5 322 + ○ wqnwkozp test.user@example.com 2001-02-03 08:05:20 c4a6dbc2 310 323 │ fixed 2 311 - @ kpqxywon test.user@example.com 2001-02-03 08:05:18 26bf6863 324 + @ kmkuslsw test.user@example.com 2001-02-03 08:05:19 fcebf6ee 312 325 │ fixed 1 313 326 × yqosqzyt test.user@example.com 2001-02-03 08:05:13 dcb25635 conflict 314 327 │ (empty) boom-cont-2 ··· 331 344 insta::assert_snapshot!(output, @r" 332 345 Working copy changes: 333 346 M conflicted.txt 334 - Working copy : kpqxywon 26bf6863 fixed 1 347 + Working copy : kmkuslsw fcebf6ee fixed 1 335 348 Parent commit: yqosqzyt dcb25635 (conflict) (empty) boom-cont-2 336 349 Hint: Conflict in parent commit has been resolved in working copy 337 350 [EOF] ··· 346 359 let output = test_env.run_jj_in(&repo_path, ["log", "-r", "::"]); 347 360 348 361 insta::assert_snapshot!(output, @r" 349 - ○ kmkuslsw test.user@example.com 2001-02-03 08:05:19 caa7e9d5 362 + ○ wqnwkozp test.user@example.com 2001-02-03 08:05:20 c4a6dbc2 350 363 │ fixed 2 351 - ○ kpqxywon test.user@example.com 2001-02-03 08:05:18 26bf6863 364 + ○ kmkuslsw test.user@example.com 2001-02-03 08:05:19 fcebf6ee 352 365 │ fixed 1 353 366 × yqosqzyt test.user@example.com 2001-02-03 08:05:13 dcb25635 conflict 354 367 │ (empty) boom-cont-2