Skip to content

Commit 02f8a51

Browse files
authored
v0.3.0: Latest OCaml support + Minor UX improvements (#36)
* Update GitHub Actions * Fix CI linters * Replace checkout with switch * Update version to 0.3.0, update changelog, use --force got zbg done
1 parent 9fa381b commit 02f8a51

File tree

7 files changed

+35
-37
lines changed

7 files changed

+35
-37
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
- macos-latest
1717
- ubuntu-latest
1818
ocaml-compiler:
19-
- 5.0.0
19+
- 5.3.0
2020

2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v5
2424

2525
- name: Use OCaml ${{ matrix.ocaml-compiler }}
26-
uses: ocaml/setup-ocaml@v2
26+
uses: ocaml/setup-ocaml@v3
2727
with:
2828
ocaml-compiler: ${{ matrix.ocaml-compiler }}
2929

@@ -33,38 +33,32 @@ jobs:
3333

3434
- run: opam exec -- dune runtest
3535

36-
- name: Upload the build artifact
37-
uses: actions/upload-artifact@v2
38-
with:
39-
name: ${{ matrix.os }}-${{ matrix.ocaml-version }}-world.exe
40-
path: _build/default/world.exe
41-
4236
lint-doc:
4337
runs-on: ubuntu-latest
4438
steps:
4539
- name: Checkout code
46-
uses: actions/checkout@v3
40+
uses: actions/checkout@v5
4741

48-
- name: Use OCaml 5.0.0
49-
uses: ocaml/setup-ocaml@v2
42+
- name: Setup OCaml
43+
uses: ocaml/setup-ocaml@v3
5044
with:
51-
ocaml-compiler: 5.0.0
45+
ocaml-compiler: 5.3.0
5246
dune-cache: true
5347

5448
- name: Lint doc
55-
uses: ocaml/setup-ocaml/lint-doc@v2
49+
uses: ocaml/setup-ocaml/lint-doc@v3
5650

5751
lint-fmt:
5852
runs-on: ubuntu-latest
5953
steps:
6054
- name: Checkout code
61-
uses: actions/checkout@v3
55+
uses: actions/checkout@v5
6256

63-
- name: Use OCaml 5.0.0
64-
uses: ocaml/setup-ocaml@v2
57+
- name: Setup OCaml
58+
uses: ocaml/setup-ocaml@v3
6559
with:
66-
ocaml-compiler: 5.0.0
60+
ocaml-compiler: 5.3.0
6761
dune-cache: true
6862

6963
- name: Lint fmt
70-
uses: ocaml/setup-ocaml/lint-fmt@v2
64+
uses: ocaml/setup-ocaml/lint-fmt@v3

.ocamlformat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 0.26.1
1+
version = 0.27.0
22
profile = default
33
break-cases = fit-or-vertical
4-
break-infix = wrap-or-vertical
4+
break-infix = wrap-or-vertical

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,28 @@ available [on GitHub][2].
99
## [Unreleased]
1010

1111
<!-- Add new changes here -->
12+
13+
## [0.3.0] - 2025-08-24 🧙‍♂️💀
14+
1215
### Fixed
1316

1417
- [#26](https://github.com/chshersh/zbg/issues/26):
1518
Set the `HOME` environment variable before calling external commands.
1619
(by [@etorreborre])
1720

1821
### Changed
22+
1923
- [#31](https://github.com/chshersh/zbg/pull/31):
2024
Command `zbg push -f` now uses git's `--force-with-lease` because it's a safer default
2125
(by [@kephas])
22-
-[#10](https://github.com/chshersh/zbg/issues/10):
26+
- [#10](https://github.com/chshersh/zbg/issues/10):
2327
Changed `fetch_main_branch` to get the base name using `Core.Filename.basename` rather than reading the output of the `basename` command.
2428
(by [@leedsjohn])
2529
- [#16](https://github.com/chshersh/zbg/issues/16):
2630
`zbg status` now highlights staged files by making the file name bold and green.
2731
(by [@leedsjohn])
32+
- Use `--delete --force` in `zbg done` instead of just `--delete`.
33+
(by [@chshersh])
2834

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

@@ -70,6 +76,7 @@ Initial release prepared by [@chshersh].
7076

7177
<!-- Versions -->
7278

73-
[Unreleased]: https://github.com/chshersh/zbg/compare/v0.2.0...HEAD
79+
[Unreleased]: https://github.com/chshersh/zbg/compare/v0.3.0...HEAD
80+
[0.3.0]: https://github.com/chshersh/zbg/releases/tag/v0.3.0
7481
[0.2.0]: https://github.com/chshersh/zbg/releases/tag/v0.2.0
7582
[0.1.0]: https://github.com/chshersh/zbg/releases/tag/v0.1.0

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ explanations.
122122
| ----- | ----- |
123123
| `zbg clear` | `git add .` <br /> `git reset --hard` |
124124
| `zbg commit My description` | `git add .` <br /> `git commit --message="My description"` |
125-
| `zbg done` | `git checkout main` <br /> `git branch -d <branch we're switching from>` |
125+
| `zbg done` | `git switch main` <br /> `git branch --delete --force <branch we're switching from>` |
126126
| `zbg log` | `git log <long custom formatting string>` |
127-
| `zbg new Branch name` | `git checkout -b my-github-username/Branch-name` |
127+
| `zbg new Branch name` | `git switch --create my-github-username/Branch-name` |
128128
| `zbg push` | `git push --set-upstream origin <current-branch>` |
129129
| `zbg rebase` | `git fetch origin main` <br /> `git rebase origin/main` |
130130
| `zbg stash` | `git stash push --include-untracked` |
131131
| `zbg status` | `git status` (but `zbg` is prettier) |
132-
| `zbg switch` | `git checkout main` <br /> `git pull --ff-only --prune` |
132+
| `zbg switch` | `git switch main` <br /> `git pull --ff-only --prune` |
133133
| `zbg sync` | `git pull --ff-only origin <current-branch>` |
134134
| `zbg sync -f` | `git fetch origin <current-branch>` <br /> `git reset --hard origin/<current-branch>` |
135135
| `zbg tag v0.1.0` | `git tag --annotate %s --message='Tag for the v0.1.0 release'` <br /> `git push origin --tags` |

lib/git.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ let log commit =
8484

8585
let new_ description =
8686
let create_branch branch_name =
87-
Process.proc @@ Printf.sprintf "git checkout -b %s" branch_name
87+
Process.proc @@ Printf.sprintf "git switch --create %s" branch_name
8888
in
8989
let branch_description = mk_branch_description description in
9090
let branch_name =
@@ -128,7 +128,7 @@ let status = Status.status
128128

129129
let switch branch_opt =
130130
let branch = branch_or_main branch_opt in
131-
Process.proc @@ Printf.sprintf "git checkout %s" branch;
131+
Process.proc @@ Printf.sprintf "git switch %s" branch;
132132
Process.proc "git pull --ff-only --prune"
133133

134134
let sync force =
@@ -165,4 +165,4 @@ let done_ () =
165165
let main_branch = fetch_main_branch () in
166166
switch (Some main_branch);
167167
if String.( <> ) prev_branch main_branch then
168-
Process.proc @@ Printf.sprintf "git branch --delete %s" prev_branch
168+
Process.proc @@ Printf.sprintf "git branch --delete --force %s" prev_branch

lib/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
let main () = Command_unix.run ~version:"0.2.0" ~build_info:"RWO" Cli.command
1+
let main () = Command_unix.run ~version:"0.3.0" ~build_info:"RWO" Cli.command

lib/process.mli

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
val proc : string -> unit
22
(** Run a given string as an external process with arguments.
33
4-
Redirect the called process stdout and stderr to the current process stdout.
4+
Redirect the called process stdout and stderr to the current process stdout.
55
6-
Also print the command with a pretty prompt.
7-
8-
*)
6+
Also print the command with a pretty prompt. *)
97

108
val proc_silent : string -> unit
119
(** Like [proc] but doesn't print the specified command. *)
1210

1311
val proc_stdout : string -> string
1412
(** Run a given string as an external process with arguments.
1513
16-
Return the process stdout as the result.
14+
Return the process stdout as the result.
1715
18-
Don't print the process output.
19-
*)
16+
Don't print the process output. *)

0 commit comments

Comments
 (0)