Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ the resolved app appearance automatically.
track, tag/commit detach, graph and reflog detached checkout, and stash
apply/pop/drop show a transient progress
pill; fetch / pull /
push with streaming progress and explicit
push with streaming progress; background auto-fetch of open repositories
(Settings → Git, default 10 minutes, per-repository opt-out) that updates
the behind-count and notices new upstream commits without merging; explicit
pull modes (merge, rebase, fast-forward only) plus a per-repo default; normal,
annotated-tag, all-tag, and guarded force-with-lease pushes; explicit push of
any local branch to a chosen remote destination; upstream set/change/unset;
Expand Down
16 changes: 16 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2184,6 +2184,9 @@ the audit does not mark these fixes or proposals shipped.
`Repo::lfs_action`); real Git fixtures and native dialog verification pass.
- ☑ GPG / SSH commit signing UI (repository/worktree settings and per-operation
choices; signed-tag creation and verification, 2026-09-06).
- ☑ **Auto-fetch** (DAN-89, 2026-10-19) — open repositories fetch on a timer
(Off / 5 / 10 / 30 min, default 10). Behind-count updates and a short toast
reports new upstream commits. Fetch only; no pull, merge, or credential prompt.
- ☑ **What's New dialog** (DAN-86, 2026-10-15) — Strand menu **What's New…**
lists `vX.Y.Z` app releases; What's Changed PRs expand in-app to the
cleaned PR description; Settings → Updates is unchanged
Expand Down Expand Up @@ -3259,6 +3262,19 @@ reason plus a Pull retry hint. `error_summary` keeps LFS explanation lines.
Fixtures in `clone_lfs.rs`. Live check against private Azure DevOps
`portal-setup` remains on Daniels' machine.

**Auto-fetch (2026-10-19, DAN-89):** Open repositories fetch in the background
on the Settings → Git interval. Daniels chose 10 minutes as the default
(Off, 5, and 30 remain available, and each open repository can opt out).
The active repository goes first and the others are staggered. A tick is
skipped when that repository already has a manual fetch, pull, or push, when
Strand is offline, or when a fetch is already running. The fetch honors the
repository's fetch-prune setting and never pulls, merges, rebases, or touches
the worktree or index. A remote with no cached credential fails once, quietly,
and backs off instead of opening a prompt. New commits on the current branch's
upstream update the behind-count and show a toast. Background fetches are
quiet activity-log entries. Git is spawned through `git_command`
(`CREATE_NO_WINDOW`), the same hidden-console path as DAN-83.

**Worktrees UI revision (2026-09-04):** Reworked PR 113's cramped table into
readable two-line rows: branch and directory together, working changes and
latest commit in separate columns, explicit current/locked indicators, and
Expand Down
9 changes: 9 additions & 0 deletions TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,15 @@ community plugins, performance and platform certification from Git feature gaps.
- ☑ Persist fetch-prune, pull-strategy, and pull-autostash defaults per
repository, with explicit one-operation overrides (`repoNetworkPreferences`,
`Repo::{fetch,pull,pull_branch}` explicit flags, topbar/palette actions).
- ☑ Auto-fetch open repositories on a timer (DAN-89). Settings → Git interval
Off / 5 / 10 / 30 min, default 10 (Daniels's choice), per-repo opt-out
(`repoAutoFetch`). Active repo first, others staggered. Skips a manual
fetch/pull/push, offline, and in-flight work. Fetch only, honoring
fetch-prune. Missing credentials fail quietly and back off
(`Repo::fetch_background`, `useAutoFetch`). New upstream commits update the
behind-count and toast “N new commits on origin/<branch>”. Quiet activity
log entries (`background-fetch`). Windows spawn stays on `git_command`
(`CREATE_NO_WINDOW`).
- ☑ Edit a remote's fetch and push URLs independently (`RemoteDialog`,
`repo_remote_set_urls`, native Git remote config).
- ☑ Credentials: inherit user's `git` config (helper, SSH agent) via
Expand Down
2 changes: 1 addition & 1 deletion crates/strand-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ libc = "0.2"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = [
"Win32_Foundation", "Win32_Security", "Win32_System_JobObjects",
"Win32_Foundation", "Win32_Security", "Win32_System_Console", "Win32_System_JobObjects",
"Win32_System_Diagnostics_ToolHelp", "Win32_System_Threading",
] }
59 changes: 57 additions & 2 deletions crates/strand-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,68 @@ pub fn init() {
/// Exception: `mergetool` keeps default flags — a console-based merge tool
/// needs a real console window to be usable.
pub(crate) fn git_command() -> std::process::Command {
#[cfg_attr(not(windows), allow(unused_mut))]
let mut cmd = std::process::Command::new("git");
hide_console(&mut cmd);
cmd
}

/// Apply `CREATE_NO_WINDOW` on Windows so a child of the GUI-subsystem build
/// does not flash a console. No-op elsewhere. Background fetch and every
/// other `git_command` spawn go through here — do not set the flag ad hoc.
pub(crate) fn hide_console(cmd: &mut std::process::Command) {
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
cmd.creation_flags(CREATE_NO_WINDOW);
}
cmd
#[cfg(not(windows))]
{
let _ = cmd;
}
}

#[cfg(all(test, windows))]
mod console_probe {
use super::hide_console;

/// Child side exits 0 when this process has no console window, 7 when it does.
#[test]
fn hidden_console_child_has_no_window() {
if std::env::var_os("STRAND_CONSOLE_PROBE").is_some() {
let hwnd = unsafe { windows_sys::Win32::System::Console::GetConsoleWindow() };
std::process::exit(if hwnd.is_null() { 0 } else { 7 });
}

let spawn = |hide: bool| {
let mut command = std::process::Command::new(std::env::current_exe().unwrap());
command
.args(["--exact", "console_probe::hidden_console_child_has_no_window", "--nocapture"])
.env("STRAND_CONSOLE_PROBE", "1")
.stdin(std::process::Stdio::null())
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null());
if hide {
hide_console(&mut command);
}
command.status().expect("spawn console probe")
};

let hidden = spawn(true);
assert!(
hidden.success(),
"CREATE_NO_WINDOW child still had a console window: {hidden}"
);
// A console parent (the usual Windows test host) would show a window
// for a bare spawn. Service sessions have no console at all; only
// assert the differential when the parent itself has one.
let parent = unsafe { windows_sys::Win32::System::Console::GetConsoleWindow() };
if !parent.is_null() {
let bare = spawn(false);
assert!(
!bare.success(),
"bare Command::new unexpectedly hid its console; the probe cannot tell CREATE_NO_WINDOW apart"
);
}
}
}
Loading
Loading