Skip to content

Commit e54484a

Browse files
authored
Merge pull request #54 from mbpcoder/claude/brave-volta-jh0x86
Branch tree, branch menu, keyboard shortcuts, Activity panel, data-loss fixes
2 parents a0b965e + 4d5526d commit e54484a

32 files changed

Lines changed: 1663 additions & 345 deletions

‎README.md‎

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Branchi — a free, open-source git client for Windows, macOS and Linux
22

33
<p align="center">
4-
<img src="docs/branchi-demo.gif" width="820" alt="Branchi git client tour: update all repositories in a folder, activity reports, history, changes, editor and settings" />
4+
<img src="docs/branchi-demo.gif" width="820" alt="Branchi git client tour: update all repositories in a folder, activity reports, history with branch folders, the branch menu, activity log, changes, editor, terminal and keyboard shortcuts" />
55
</p>
66

77
**Branchi** is a free and open-source (MIT) desktop git client for Windows, macOS and Linux with a **Rust** core
@@ -39,6 +39,10 @@ That is what Branchi is being built for.
3939
## Features at a glance
4040

4141
- History with branches, commit search and file-by-file diffs
42+
- Branches grouped into folders (`feature/`, `hotfix/`, …) and a separate
43+
Remote section with each remote (`origin`, `upstream`, …) on its own
44+
- Merge, rebase, create and delete branches from a branch's right-click
45+
menu; deleting a branch with unmerged commits asks a second time
4246
- Stage, unstage, revert and commit — or commit and push in one step
4347
- Fetch, pull (fast-forward) and push, plus remote management
4448
- Auto-pull branch watcher that keeps the current branch up to date
@@ -48,6 +52,8 @@ That is what Branchi is being built for.
4852
- Custom date ranges, Gregorian or Jalali calendar
4953
- Built-in file browser and code editor
5054
- Built-in terminal with multiple terminal tabs
55+
- Activity log of every git action, grouped by day
56+
- Keyboard shortcuts for sections, panels and tabs, listed in Settings
5157
- Light and dark themes, accent colors, English, Persian and Arabic
5258
- No separate Git install needed for everyday work — the git engine is built in
5359

@@ -70,7 +76,14 @@ That is what Branchi is being built for.
7076
<img src="docs/screenshots/editor.png" width="400" alt="Branchi file editor" />
7177
</p>
7278
<p>
79+
<img src="docs/screenshots/branch-menu.png" width="400" alt="Branch menu: merge, rebase, new branch, push and delete" />
80+
<img src="docs/screenshots/activity.png" width="400" alt="Activity log of git actions, grouped by day" />
81+
</p>
82+
<p>
83+
<img src="docs/screenshots/settings-shortcuts.png" width="400" alt="Keyboard shortcuts in Settings" />
7384
<img src="docs/screenshots/settings.png" width="400" alt="Branchi branch watcher settings" />
85+
</p>
86+
<p>
7487
<img src="docs/screenshots/welcome.png" width="400" alt="Branchi start page" />
7588
</p>
7689

@@ -113,9 +126,23 @@ commits, and open any commit to see its diff file by file. The **Changes**
113126
view stages, unstages and reverts files and commits, or commits and pushes
114127
in one step. The **Files** view is a file tree with a built-in code editor.
115128

129+
### Branches
130+
Local branches are grouped into folders by their prefix (`feature/`,
131+
`hotfix/`, `release/`, …), and a separate **Remote** section lists every
132+
remote (`origin`, `upstream`, …) with its own branches, PhpStorm style. Each
133+
local branch shows how far it is ahead of or behind the base branch (`main`
134+
by default, or any branch you pick). Right-click a branch to check it out,
135+
update it, merge it into the current branch, rebase onto it, merge the base
136+
branch into it, start a new branch from it, push it or delete it. Deleting a
137+
remote branch deletes it on the server; deleting a local branch with commits
138+
that aren't in the base branch asks a second time and says how many commits
139+
would be lost.
140+
116141
### Pull, push and auto-pull
117142
Fetch, pull and push from the top bar. Pulls are fast-forward only, so your
118-
branch is never rewritten behind your back. The **branch watcher** can pull
143+
branch is never rewritten behind your back. Uncommitted changes are kept;
144+
if an incoming change would overwrite one, the pull stops and changes
145+
nothing. The **branch watcher** can pull
119146
the current branch on a schedule, only when the working tree is clean, and
120147
notify you when new commits arrive.
121148

@@ -149,6 +176,21 @@ uses each author's own local time, taken from their commits.
149176
Each repository tab has its own terminal panel with multiple terminal tabs,
150177
opened in the repository folder. Choose which shell to use in Settings.
151178

179+
### Activity and keyboard shortcuts
180+
The **Activity** panel lists every git action Branchi ran, grouped by day,
181+
with what it changed and why anything failed. Keyboard shortcuts (on macOS,
182+
⌘ instead of Ctrl for the sections and ⌥ for Alt):
183+
184+
| Action | Keys |
185+
| --- | --- |
186+
| History / Changes / Files / Report | Ctrl+1 / Ctrl+2 / Ctrl+3 / Ctrl+4 |
187+
| Show or hide the terminal | Alt+F12 |
188+
| Show or hide activity | Alt+F9 |
189+
| Next / previous tab | Ctrl+Tab / Ctrl+Shift+Tab |
190+
| Go to tab 1–9 | Alt+1 … Alt+9 |
191+
192+
The list is also in **Settings → Keyboard shortcuts**.
193+
152194
### Languages, RTL and calendars
153195
English, Persian and Arabic, with a full right-to-left layout. Dates follow
154196
the **Calendar** setting: automatic (Jalali for Persian), Gregorian or Jalali.

‎core/src/ffi.rs‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,28 @@ pub unsafe extern "C" fn branchi_delete_branch(
295295
result_to_c_string(result)
296296
}
297297

298+
/// Counts the commits on local branch `name` that `base` (a branch name,
299+
/// or null for the default branch) lacks, i.e. what deleting `name` would
300+
/// lose. Returns `{"ok": {"commits": n, "base": "origin/master"}}` or
301+
/// `{"error": "..."}`.
302+
///
303+
/// # Safety
304+
/// `path` and `name` must be valid, NUL-terminated UTF-8 C strings that
305+
/// outlive the call; `base` must be one too, or null.
306+
#[no_mangle]
307+
pub unsafe extern "C" fn branchi_unmerged_commits(
308+
path: *const c_char,
309+
name: *const c_char,
310+
base: *const c_char,
311+
) -> *mut c_char {
312+
let path = c_str_to_string(path);
313+
let name = c_str_to_string(name);
314+
let base = (!base.is_null()).then(|| c_str_to_string(base));
315+
let result =
316+
GitRepo::open(&path).and_then(|repo| repo.unmerged_commits(&name, base.as_deref()));
317+
result_to_json_c_string(result)
318+
}
319+
298320
/// Updates branch `name` in the repository at `path`. When `is_remote` is
299321
/// true, `name` must be a remote-tracking branch (e.g. `origin/feature`) and
300322
/// this just fetches its remote. Otherwise `name` is a local branch that is

0 commit comments

Comments
 (0)