Problem
When running git-all-crystal with flags from inside a git repository, the flags get passed directly to git instead of being parsed by git-all.
Steps to reproduce:
cd /some/git-repo
git-all-crystal -n 8 status
Expected: git-all parses -n 8 as workers flag, runs status on sibling repos
Actual:
unknown option: -n
usage: git [-v | --version] [-h | --help] [-C <path>] ...
Cause
In crystal/src/git-all.cr, the is_inside_git_repo? check happens before argument parsing:
def main
if Meta.dispatch(ARGV)
exit 0
end
if is_inside_git_repo?
passthrough_to_git(ARGV) # passes raw ARGV including -n flag
end
options = parse_args(ARGV) # never reached when inside a repo
...
end
Fix
Either:
- Parse args before the git repo check
- Check if the first non-flag arg is a known git-all command before passing through
- Match Rust/Zig behavior (need to verify how they handle this)
Problem
When running
git-all-crystalwith flags from inside a git repository, the flags get passed directly to git instead of being parsed by git-all.Steps to reproduce:
cd /some/git-repo git-all-crystal -n 8 statusExpected: git-all parses
-n 8as workers flag, runs status on sibling reposActual:
Cause
In
crystal/src/git-all.cr, theis_inside_git_repo?check happens before argument parsing:Fix
Either: