test: Update 13 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Successful in 54s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been cancelled
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been cancelled
Build-Test-Publish / build (linux/arm64) (push) Has been cancelled

This commit is contained in:
Your Name
2025-07-20 13:49:08 +12:00
parent 0ba6227412
commit 1b03087c02
16 changed files with 250 additions and 29 deletions

72
gp/gp
View File

@ -225,19 +225,77 @@ show_status_and_confirm() {
# Show staged changes
if ! git diff --cached --quiet; then
print_info "Staged changes:"
git diff --cached --name-only -- | while IFS= read -r line; do echo " $line"; done
local staged_modified=""
local staged_deleted=""
local staged_added=""
# Get staged file status and categorize
while IFS=$'\t' read -r status file; do
[ -z "$status" ] && continue
case "${status:0:1}" in
A) staged_added="${staged_added}${file}\n" ;;
M) staged_modified="${staged_modified}${file}\n" ;;
D) staged_deleted="${staged_deleted}${file}\n" ;;
*) staged_modified="${staged_modified}${file}\n" ;; # Default to modified for other statuses
esac
done < <(git diff --cached --name-status)
# Show staged added files
if [ -n "$staged_added" ]; then
print_info "Staged new files:"
echo -e "$staged_added" | grep -v '^$' | while IFS= read -r line; do echo " $line"; done
fi
# Show staged modified files
if [ -n "$staged_modified" ]; then
print_info "Staged modified files:"
echo -e "$staged_modified" | grep -v '^$' | while IFS= read -r line; do echo " $line"; done
fi
# Show staged deleted files
if [ -n "$staged_deleted" ]; then
print_info "Staged deleted files:"
echo -e "$staged_deleted" | grep -v '^$' | while IFS= read -r line; do echo " $line"; done
fi
has_staged_changes=true
fi
# Show unstaged changes
if ! git diff --quiet; then
if [ "$ADD_ALL" = true ]; then
print_info "Modified files (will be added):"
else
print_info "Modified files (unstaged, will NOT be included):"
local modified_files=""
local deleted_files=""
# Get file status and categorize
while IFS=$'\t' read -r status file; do
[ -z "$status" ] && continue
case "${status:0:1}" in
M) modified_files="${modified_files}${file}\n" ;;
D) deleted_files="${deleted_files}${file}\n" ;;
*) modified_files="${modified_files}${file}\n" ;; # Default to modified for other statuses
esac
done < <(git diff --name-status)
# Show modified files
if [ -n "$modified_files" ]; then
if [ "$ADD_ALL" = true ]; then
print_info "Modified files (will be added):"
else
print_info "Modified files (unstaged, will NOT be included):"
fi
echo -e "$modified_files" | grep -v '^$' | while IFS= read -r line; do echo " $line"; done
fi
git diff --name-only -- | while IFS= read -r line; do echo " $line"; done
# Show deleted files
if [ -n "$deleted_files" ]; then
if [ "$ADD_ALL" = true ]; then
print_info "Deleted files (will be removed):"
else
print_info "Deleted files (unstaged, will NOT be included):"
fi
echo -e "$deleted_files" | grep -v '^$' | while IFS= read -r line; do echo " $line"; done
fi
has_unstaged_changes=true
fi