Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions bashy
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ symbol_ahead="\x01\033[32m\x02↑" # green

delete=0; change=0; new=0; ahead=0; behind=0

for line in $gitstatus; do
[[ $line =~ ^D ]] && delete=1
[[ $line =~ ^M ]] && change=1
[[ $line =~ ^\?\? ]] && new=1
[[ $line =~ behind ]] && behind=1
[[ $line =~ ahead ]] && ahead=1
done
while IFS= read -r line; do
case "$line" in
'## '*)
[[ $line == *'behind '* ]] && behind=1
[[ $line == *'ahead '* ]] && ahead=1
;;
'?? '*)
new=1
;;
*)
status="${line:0:2}"
[[ $status == *D* ]] && delete=1
[[ $status == *M* ]] && change=1
;;
Comment on lines +37 to +41

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚑ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the file and inspect the relevant lines with context.
git ls-files | rg '(^|/)bashy$|bashy\.sh$|bashy$'
echo '---'
if [ -f bashy ]; then
  nl -ba bashy | sed -n '1,120p'
else
  fd -a '^bashy$|^bashy\.sh$' .
fi

Repository: pablopunk/bashy

Length of output: 203


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for status parsing around the cited logic.
rg -n --no-heading -C 3 'status="\$\{line:0:2\}"|new=1|delete=1|change=1|git status|porcelain' .

Repository: pablopunk/bashy

Length of output: 807


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the full script so the affected output path is clear.
awk '{printf "%4d  %s\n", NR, $0}' bashy | sed -n '1,140p'

Repository: pablopunk/bashy

Length of output: 1813


Handle A, R, and C status codes
git status --porcelain entries like A , R , and C fall through here with no symbol, so staged additions, renames, and copies are invisible. Conflict pairs such as AA and UU are also blank.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bashy` around lines 37 - 41, The status parsing in the bashy case branch only
marks deletions and modifications, so staged additions, renames, copies, and
conflict states are missed. Update the `status="${line:0:2}"` handling to
recognize `A`, `R`, and `C` symbols as changed entries, and also treat conflict
pairs like `AA` and `UU` as visible statuses. Keep the logic localized to the
existing status switch/branch so the rest of the parser continues to work
unchanged.

esac
done <<< "$gitstatus"

[ $delete -eq 1 ] && symbols="$symbols$symbol_delete"
[ $change -eq 1 ] && symbols="$symbols$symbol_change"
Expand Down
Loading