Conversation
Reviewer's GuideEnhances the git-helper script with versioning, optional installation of UI dependencies, a GitHub-based update checker, improved text UI checklist behavior, and additional branch management commands, wiring them into the existing menus. Sequence diagram for the GitHub-based update checksequenceDiagram
actor User
participant Menu as menu_utils
participant Script as git_helper
participant GitHub as github_raw
User->>Menu: select check_updates
Menu->>Script: cmd_check_updates
Script->>Script: echo Checking for updates
Script->>Script: fetch_latest_version
Script->>GitHub: HTTP GET raw git-helper.sh
GitHub-->>Script: script contents
Script->>Script: extract SCRIPT_VERSION from response
Script->>Script: compare_versions current SCRIPT_VERSION, latest_version
Script->>Script: evaluate comparison result
alt versions equal
Script->>User: ui_message latest version already installed
else current older
Script->>User: ui_message new version available and manual git pull instructions
else current newer
Script->>User: ui_message running development version newer than latest release
end
Flow diagram for UI detection and optional installationflowchart TD
A[start script] --> B[detect_ui]
B --> C{whiptail available?}
C -->|yes| D[set UI_TOOL to whiptail]
C -->|no| E{dialog available?}
E -->|yes| F[set UI_TOOL to dialog]
E -->|no| G[set UI_TOOL to text]
G --> H{NEVER_INSTALL_FILE exists?}
H -->|yes| I[keep UI_TOOL as text and return]
H -->|no| J[prompt_ui_choice]
J --> K{user choice}
K -->|no| I
K -->|never| L[create CONFIG_DIR and NEVER_INSTALL_FILE]
L --> I
K -->|yes| M[select_ui_tool]
M --> N{selected_tool is whiptail or dialog?}
N -->|invalid| I
N -->|valid| O[install_ui_package selected_tool]
O --> P{installation success?}
P -->|no| Q[print message and continue in text mode]
Q --> I
P -->|yes| R[set UI_TOOL to selected_tool]
R --> S[print success message and return]
D --> T[continue script]
F --> T
I --> T
S --> T
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `git_helpers/git-helper.sh:860-861` </location>
<code_context>
+ print_info "Renamed branch" "$b → $new_name"
+
+ # Check if branch existed on remote
+ if git ls-remote --heads origin "$b" >/dev/null; then
+ if ui_yesno "$TITLE" "Push rename to remote (delete old '$b' and push new '$new_name')?"; then
+ git push origin -u "$new_name" 2>&1
+ git push origin --delete "$b" 2>&1 || true
</code_context>
<issue_to_address>
**issue (bug_risk):** Remote-branch existence check with `git ls-remote` will always succeed if `origin` exists, even when the branch doesn’t.
`git ls-remote --heads origin "$b"` returns 0 as long as `origin` is reachable, even if no matching ref exists, so this condition will be true for purely local branches.
To only prompt when the branch actually exists on `origin`, test for output instead of exit code, e.g.:
```bash
if git ls-remote --heads origin "$b" | grep -qE "refs/heads/$b$"; then
# branch exists on remote
fi
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| if git ls-remote --heads origin "$b" >/dev/null; then | ||
| if ui_yesno "$TITLE" "Push rename to remote (delete old '$b' and push new '$new_name')?"; then |
There was a problem hiding this comment.
issue (bug_risk): Remote-branch existence check with git ls-remote will always succeed if origin exists, even when the branch doesn’t.
git ls-remote --heads origin "$b" returns 0 as long as origin is reachable, even if no matching ref exists, so this condition will be true for purely local branches.
To only prompt when the branch actually exists on origin, test for output instead of exit code, e.g.:
if git ls-remote --heads origin "$b" | grep -qE "refs/heads/$b$"; then
# branch exists on remote
fi
Summary by Sourcery
Introduce versioning, update checks, and enhanced branch and UI management to the git-helper script.
New Features:
Enhancements: