Skip to content

[feature] self update (gitui update)#2923

Open
shuppel wants to merge 6 commits into
gitui-org:masterfrom
shuppel:shuppel/feature/self-update
Open

[feature] self update (gitui update)#2923
shuppel wants to merge 6 commits into
gitui-org:masterfrom
shuppel:shuppel/feature/self-update

Conversation

@shuppel
Copy link
Copy Markdown

@shuppel shuppel commented May 11, 2026

This Pull Request closes any self-update-cli-command issue.

It changes the following:

  • Adds gitui update subcommand for self-updating via CLI (before opening TUI)
  • Supports updating via multiple package managers: cargo, dnf, apt, pacman, homebrew, scoop, chocolatey
  • Detects installation method automatically by examining binary path and querying system package managers
  • Supports --nightly / -n flag to include pre-release versions (nightly, rc, beta)
  • Filters stable vs pre-release versions so users can choose update stability
  • Adds short alias gitui -U for quick access to update command

I followed the checklist:

  • I added unittests
  • I ran make check without errors
  • I tested the overall application
  • I added an appropriate item to the changelog

Testing Performed

Tested on Fedora 42 with DNF-installed gitui:

  • ./target/release/gitui update - Detects DNF, checks versions, prompts for update
  • ./target/release/gitui update -n - Includes pre-release versions in update check
  • ./target/release/gitui -U - Short alias works correctly

Module Structure

Created modular update system in src/update/:

  • mod.rs - Orchestrates update flow, version checking, user interaction
  • detector.rs - Installation method detection
  • commands.rs - Update command execution using macro

Example Usage

# Update to latest stable
$ gitui update
gitui version: 0.28.1-nightly
Installation method: dnf
Update available: 0.28.1-nightly -> 0.28.1
Do you want to update gitui? [y/N]: y
Successfully updated via dnf!
# Update including pre-releases
$ gitui update -n
⚠️  Pre-release update available: 0.28.1-nightly -> 0.28.1-rc.1

shuppel added 6 commits May 11, 2026 10:32
…U" as well as nightly and pre-release support. Supports cargo, homerew, dnf, apt, pacman, scoop, scoop bucket, chocolatey and winodws UI.
…eam.

reduced noise by removing self comments
added high level comments for better identification of what code does
macroed the update_via feature into a function
removed duplicate feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant