Repository navigation
feat: show progress for long-running actions (pull, fetch, push, checkout, AI) - #84
Merged
Merged
Conversation
- Fast-forward now runs through stream_or_capture_git with --progress, so git's "Updating files" checkout progress appears once it outlives the quiet window. --no-stat keeps a streamed run from dumping the raw diffstat; the stat is printed from old_head..HEAD instead. - print_changes_stat colors in a single awk pass instead of spawning three sed processes per line (a 2000-file pull spent ~20s here with no output). It takes an optional row limit (pull/merge use 100) and collapses the rest into "... and N more files". - Hyphens in file names are no longer colored red; trailing "create mode" rows from git merge stay after the summary line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FijY3tAxpvX9dgMwau3u7T
- New common.sh helpers: a spinner with elapsed seconds (appears after
~1s, so quick commands stay quiet), run_with_spinner for non-git work,
strip_git_progress, and readable labels ("Fetching", "Checking out
files", ...).
- stream_or_capture_git now spins during its quiet window and still
hands over to git's native progress after ~10s; captured output has
progress meters stripped so callers parse the same text as before.
- Route fetch/push in branch, config, fetch, merge, pull (dry/upd), sync,
tag, edit, squash, wip and worktree through it, plus switch/checkout,
merge, stash and worktree add, which can take long on big trees.
- AI requests (HTTP and claude CLI, commit grouping) show "Waiting for
AI response" / "Grouping changes with AI".
- Spinner is off without a TTY, with GITBASHER_NO_SPINNER=1, and for
network commands that may prompt for credentials so the prompt is not
overwritten.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FijY3tAxpvX9dgMwau3u7T
|
🎉 This PR is included in version 5.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
print_changes_statstarted 3sedprocesses per stat line, so 2000 changed files took about 20s with no output. It now does oneawkpass (about 0.04s). Pull and merge cap the list at 100 rows and add... and N more files. Hyphens in file names are no longer colored red.git merge --ff-only --no-stat --progressruns throughstream_or_capture_git. The stat is printed fromold_head..HEAD, so a streamed run doesn't dump the raw diffstat a second time.common.sh:⠋ Fetching (3s), that appears after ~1s, so quick commands print nothing extra;stream_or_capture_gitshows that spinner during its quiet window, then hands over to git's own progress after ~10s. Progress meters are stripped from the captured text, so callers parse the same output as before;run_with_spinnerfor work that isn't git, and readable labels ("Fetching", "Pushing", "Checking out files", "Applying stash", …).branch,config,fetch,merge,pull(dry and upd),sync,tag,edit,squash,wip,worktree;switchandcheckout,merge, stash push/pop/apply/drop,worktree add;GITBASHER_NO_SPINNER=1, and for network commands where git may prompt for credentials (HTTPS with no credential helper or askpass, SSH with no agent). The spinner redraws its line, so it would otherwise wipe the prompt.Linked issue
None. This came from a user report: a large
gitb pullshowed no progress.Type of change
Test plan
bats tests/run: 946 pass. The 37 failures are identical on unmodifiedmainin this environment (columnis not installed); none are new.shellcheck— not available in this environmentbash -nscript -qc):New BATS tests:
print_changes_stat: limit,create moderows, hyphen coloring, empty input;pullend-to-end;strip_git_progress,_progress_label,run_with_spinnerpassthrough, no spinner without a TTY, and the credential-prompt heuristic.Compatibility
sed '\r', nohead -n 0, and colors reach awk throughENVIRON.tests/bash32_compat_check.shpasses)Checklist
gitinvocations are quotedxargs -r/ GNU-only patterns🤖 Generated with Claude Code
https://claude.ai/code/session_01FijY3tAxpvX9dgMwau3u7T