Remove dead array assignment that breaks .githelpers under dash#5
Merged
Conversation
switch_recent_branches_by_index assigns `local branches=(...)` but never
reads the variable — it was left behind when the function was rewired to
pipe list_branches_by_relative_commit straight into fzf.
The bash array literal is the only bashism that breaks *parsing* (not just
runtime). Since git runs `!`-prefixed aliases through /bin/sh, on systems
where /bin/sh is dash (Debian/Ubuntu default) dash parses the whole file
before running anything and aborts here with:
.githelpers: Syntax error: "(" unexpected
That takes down every alias that sources this file (`git l`, `git b`,
`git lb`, …), not just the fzf switcher. Deleting the dead line restores
them and removes the cruft.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nonreagent
added a commit
to nonreagent/dotfiles
that referenced
this pull request
Jun 16, 2026
Re-vendored from upstream main after nonrational/dotfiles#5 merged. Removes the dead `local branches=(...)` array assignment whose bash-only syntax made dash abort parsing the whole file — which broke every git alias that sources ~/.githelpers (l, b, lb, …) since /bin/sh is dash on this VM. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Delete one dead line from
switch_recent_branches_by_indexin.githelpers:switch_recent_branches_by_index() { - local branches=($(list_branches_by_relative_commit | awk '{print $NF}')) local current_branch=$(git branch --show-current)branchesis assigned and then never read — the function pipeslist_branches_by_relative_commitstraight intofzfa few lines down. It's leftover from a pre-fzf implementation.Why it matters
Git runs
!-prefixed aliases through/bin/sh. On Debian/Ubuntu (and the exe.dev VMs),/bin/shisdash. When an alias likegit ldoes!. ~/.githelpers && pretty_git_log, dash sources the file — and dash parses the entire file before executing anything. The bash array literalname=(...)is the one bit of syntax dash can't parse, so it aborts:That isn't isolated to the fzf switcher — it takes down every alias that sources this file (
l,b,bs,lb,opb,pb, …), since none of them get past the parse. Removing the dead line fixes all of them.The
[[ ]]uses elsewhere in the file parse fine under dash (they only fail at runtime, inside their own functions) — this array literal was the sole parse-level bashism.Verification
No behavior change on systems where
/bin/shis bash — the line was dead there too.🤖 Generated with Claude Code