File tree 3 files changed +30
-0
lines changed
3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
38
38
39
39
* New ` signed ` revset function to filter for cryptographically signed commits.
40
40
41
+ * ` jj git push ` now shows a hint to use ` --deleted ` if the only changed bookmarks
42
+ are deleted ones.
43
+
41
44
### Fixed bugs
42
45
43
46
* Fixed crash on change-delete conflict resolution.
Original file line number Diff line number Diff line change @@ -395,6 +395,25 @@ pub fn cmd_git_push(
395
395
) ;
396
396
}
397
397
if bookmark_updates. is_empty ( ) {
398
+ let deleted_bookmarks = tx
399
+ . repo ( )
400
+ . view ( )
401
+ . local_remote_bookmarks ( remote)
402
+ . filter ( |( _, targets) | {
403
+ !targets. local_target . is_present ( )
404
+ && matches ! ( classify_bookmark_push_action( * targets) ,
405
+ BookmarkPushAction :: Update ( update) if update. new_target. is_none( ) )
406
+ } )
407
+ . count ( ) ;
408
+
409
+ if deleted_bookmarks > 0 {
410
+ writeln ! (
411
+ ui. hint_default( ) ,
412
+ "You can push {deleted_bookmarks} deleted bookmark{s} with `--deleted`" ,
413
+ s = if deleted_bookmarks > 1 { "s" } else { "" }
414
+ ) ?;
415
+ }
416
+
398
417
writeln ! ( ui. status( ) , "Nothing changed." ) ?;
399
418
return Ok ( ( ) ) ;
400
419
}
Original file line number Diff line number Diff line change @@ -1961,6 +1961,14 @@ fn test_git_push_deleted(subprocess: bool) {
1961
1961
work_dir
1962
1962
. run_jj ( [ "bookmark" , "delete" , "bookmark1" ] )
1963
1963
. success ( ) ;
1964
+ let output = work_dir. run_jj ( [ "git" , "push" ] ) ;
1965
+ insta:: assert_snapshot!( output, @r"
1966
+ ------- stderr -------
1967
+ Warning: No bookmarks found in the default push revset: remote_bookmarks(remote=origin)..@
1968
+ Hint: You can push 1 deleted bookmark with `--deleted`
1969
+ Nothing changed.
1970
+ [EOF]
1971
+ " ) ;
1964
1972
let output = work_dir. run_jj ( [ "git" , "push" , "--deleted" ] ) ;
1965
1973
insta:: allow_duplicates! {
1966
1974
insta:: assert_snapshot!( output, @r"
You can’t perform that action at this time.
0 commit comments