mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-12-12 22:38:50 +00:00
refactor: enhance update_changelog.sh with diff counting and logging
- Added functionality to count and log the number of unstaged, staged, and unpushed changes for better visibility of the git state. - Improved logging to provide clearer feedback on the current status of changes before generating the changelog.
This commit is contained in:
parent
c282cf57d6
commit
f1fcbf69cf
@ -95,12 +95,17 @@ log "Collecting git diffs..."
|
||||
|
||||
# Unstaged changes
|
||||
UNSTAGED_DIFF=$(git diff 2>/dev/null || echo "")
|
||||
UNSTAGED_COUNT=$(echo "$UNSTAGED_DIFF" | grep -c "^diff\|^index" 2>/dev/null || echo "0")
|
||||
|
||||
# Staged changes
|
||||
STAGED_DIFF=$(git diff --cached 2>/dev/null || echo "")
|
||||
STAGED_COUNT=$(echo "$STAGED_DIFF" | grep -c "^diff\|^index" 2>/dev/null || echo "0")
|
||||
|
||||
# Unpushed commits
|
||||
UNPUSHED_DIFF=$(git diff "$REMOTE_BRANCH"..HEAD 2>/dev/null || echo "")
|
||||
UNPUSHED_COMMITS=$(git rev-list --count "$REMOTE_BRANCH"..HEAD 2>/dev/null || echo "0")
|
||||
|
||||
log "Found: $UNSTAGED_COUNT unstaged file(s), $STAGED_COUNT staged file(s), $UNPUSHED_COMMITS unpushed commit(s)"
|
||||
|
||||
# Combine all diffs
|
||||
ALL_DIFFS="${UNSTAGED_DIFF}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user