Skip to content

Commit

Permalink
Make force-with-lease the default (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
kephas authored Dec 26, 2023
1 parent 998403c commit 311e035
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ available [on GitHub][2].

<!-- Add new changes here -->

### Changed
- [#31](https://github.com/chshersh/zbg/pull/31):
Command `zbg push -f` now uses git's `--force-with-lease` because it's a safer default
(by [@kephas])

## [0.2.0] — 2023-12-17 🎄

### Added
Expand Down Expand Up @@ -44,6 +49,7 @@ Initial release prepared by [@chshersh].
[@paulpatault]: https://github.com/paulpatault
[@sloboegen]: https://github.com/sloboegen
[@tekknoid]: https://github.com/tekknoid
[@kephas]: https://github.com/kephas

<!-- Header links -->

Expand Down
2 changes: 1 addition & 1 deletion lib/cli.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let cmd_new =
let cmd_push =
Command.basic ~summary:"Push the current branch to origin"
(let%map_open.Command force =
flag "f" ~aliases:[ "--force" ] no_arg
flag "f" ~aliases:[ "--force-with-lease" ] no_arg
~doc:"Push forcefully and override changes"
in
fun () -> Git.push (to_force_flag force))
Expand Down
2 changes: 1 addition & 1 deletion lib/git.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ let push force =
let flag_option =
match force with
| NoForce -> ""
| Force -> "--force"
| Force -> "--force-with-lease"
in
Process.proc
@@ Printf.sprintf "git push --set-upstream origin %s %s" current_branch
Expand Down

0 comments on commit 311e035

Please sign in to comment.