Skip to content

[bugfix/git_helper-20] Fixed Git Switch#22

Merged
justinkumpe merged 1 commit intomainfrom
dev
Jan 6, 2026
Merged

[bugfix/git_helper-20] Fixed Git Switch#22
justinkumpe merged 1 commit intomainfrom
dev

Conversation

@justinkumpe
Copy link
Member

@justinkumpe justinkumpe commented Jan 6, 2026

Summary by Sourcery

Update git helper script UI dimensions and fix branch switching for remote branches.

Bug Fixes:

  • Correct remote branch switching by creating a local tracking branch when checking out branches in the form remote/branch.

Enhancements:

  • Adjust git helper dialog dimensions to better fit the interface layout.

Chores:

  • Bump git helper script version to 1.0.2.

@justinkumpe justinkumpe self-assigned this Jan 6, 2026
@justinkumpe justinkumpe added the bug Something isn't working label Jan 6, 2026
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 6, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts git-helper UI dimensions and fixes the branch switch logic so checking out remote branches correctly creates local tracking branches, along with a patch version bump.

File-Level Changes

Change Details Files
Updated script version and UI layout dimensions for the Git Helper dialog interface.
  • Bumped SCRIPT_VERSION from 1.0.1 to 1.0.2 to reflect the bugfix release.
  • Reduced default HEIGHT from 20 to 12 for the dialog UI.
  • Adjusted default WIDTH from 78 to 70 for better layout fit.
  • Increased MENU_HEIGHT from 12 to 15 so more menu items are visible at once.
git_helpers/git-helper.sh
Fixed branch switching for remote branches to correctly create a local tracking branch from a remote ref.
  • Modified cmd_branch_switch to parse the selected branch string into remote and branch components when it contains a slash.
  • Extracted remote_name using parameter expansion ${b%%/} and branch_name using ${b#/}.
  • Changed the checkout command for remote branches to use 'git checkout --track -b "${branch_name}" "${b}"' so a local branch is created that tracks the remote ref.
  • Kept existing behavior for non-remote branch names, still using 'git checkout "$b"' for local branches.
git_helpers/git-helper.sh

Possibly linked issues

  • #bugfix/git_helper: PR changes git checkout to use -b with full path, matching issue’s branch path preservation requirement.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@justinkumpe justinkumpe merged commit c17d778 into main Jan 6, 2026
2 of 3 checks passed
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In cmd_branch_switch, remote_name is computed but never used; consider removing it to avoid dead code and potential confusion about its purpose.
  • The UI sizing change sets HEIGHT=12 and MENU_HEIGHT=15, which may cause dialog/menu rendering issues if the menu is taller than the container; double-check these values are consistent with the UI tool’s expectations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `cmd_branch_switch`, `remote_name` is computed but never used; consider removing it to avoid dead code and potential confusion about its purpose.
- The UI sizing change sets `HEIGHT=12` and `MENU_HEIGHT=15`, which may cause dialog/menu rendering issues if the menu is taller than the container; double-check these values are consistent with the UI tool’s expectations.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant