gitbash 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/branch.sh +3 -15
- package/commands/cleanup.sh +2 -9
- package/commands/pr.sh +1 -7
- package/commands/stashes.sh +3 -15
- package/commands/status.sh +1 -5
- package/package.json +1 -1
package/commands/branch.sh
CHANGED
|
@@ -152,25 +152,13 @@ EOF
|
|
|
152
152
|
# -----------------------------
|
|
153
153
|
case "$selection" in
|
|
154
154
|
"$create_option")
|
|
155
|
-
|
|
156
|
-
if [[ -z "${SCRIPT_DIR:-}" ]]; then
|
|
157
|
-
SCRIPT_DIR="$(cd "$SOURCE_DIR/.." && pwd)"
|
|
158
|
-
fi
|
|
159
|
-
"$SCRIPT_DIR/bin/gitbash" create
|
|
155
|
+
gitbash create
|
|
160
156
|
;;
|
|
161
157
|
"$switch_option")
|
|
162
|
-
|
|
163
|
-
if [[ -z "${SCRIPT_DIR:-}" ]]; then
|
|
164
|
-
SCRIPT_DIR="$(cd "$SOURCE_DIR/.." && pwd)"
|
|
165
|
-
fi
|
|
166
|
-
"$SCRIPT_DIR/bin/gitbash" switch
|
|
158
|
+
gitbash switch
|
|
167
159
|
;;
|
|
168
160
|
"$update_option")
|
|
169
|
-
|
|
170
|
-
if [[ -z "${SCRIPT_DIR:-}" ]]; then
|
|
171
|
-
SCRIPT_DIR="$(cd "$SOURCE_DIR/.." && pwd)"
|
|
172
|
-
fi
|
|
173
|
-
"$SCRIPT_DIR/bin/gitbash" update
|
|
161
|
+
gitbash update
|
|
174
162
|
;;
|
|
175
163
|
"$abort_label")
|
|
176
164
|
echo "Aborted."
|
package/commands/cleanup.sh
CHANGED
|
@@ -164,21 +164,14 @@ EOF
|
|
|
164
164
|
recent_branches=()
|
|
165
165
|
|
|
166
166
|
# Variables for loop (declared once to avoid zsh output on redeclaration)
|
|
167
|
-
local last_commit_ts relative_date author_email author_name
|
|
168
167
|
local has_remote configured_upstream entry
|
|
169
168
|
|
|
170
169
|
# Process each local branch
|
|
171
|
-
while IFS= read -r branch; do
|
|
170
|
+
while IFS='|' read -r branch last_commit_ts relative_date author_email author_name; do
|
|
172
171
|
# Skip base branch
|
|
173
172
|
[[ "$branch" == "$base_branch" ]] && continue
|
|
174
173
|
[[ -z "$branch" ]] && continue
|
|
175
174
|
|
|
176
|
-
# Get last commit info for all branches
|
|
177
|
-
last_commit_ts=$(git log -1 --format='%ct' "$branch" 2>/dev/null)
|
|
178
|
-
relative_date=$(git log -1 --format='%cr' "$branch" 2>/dev/null)
|
|
179
|
-
author_email=$(git log -1 --format='%ae' "$branch" 2>/dev/null)
|
|
180
|
-
author_name=$(git log -1 --format='%an' "$branch" 2>/dev/null)
|
|
181
|
-
|
|
182
175
|
# Check if remote branch exists
|
|
183
176
|
has_remote=false
|
|
184
177
|
if echo "$remote_branches" | grep -qx "$branch"; then
|
|
@@ -201,7 +194,7 @@ EOF
|
|
|
201
194
|
# Recent: has recent activity (don't pre-select)
|
|
202
195
|
recent_branches+=("$entry")
|
|
203
196
|
fi
|
|
204
|
-
done < <(git for-each-ref --format='%(refname:short)' refs/heads)
|
|
197
|
+
done < <(git for-each-ref --format='%(refname:short)|%(committerdate:unix)|%(committerdate:relative)|%(committeremail)|%(committername)' refs/heads)
|
|
205
198
|
|
|
206
199
|
# Sort each category by timestamp (most recent first), compatible with bash 3.x (no mapfile)
|
|
207
200
|
_sort_desc() {
|
package/commands/pr.sh
CHANGED
|
@@ -93,14 +93,8 @@ EOF
|
|
|
93
93
|
echo "Continuing without committing..."
|
|
94
94
|
;;
|
|
95
95
|
*)
|
|
96
|
-
# Use SCRIPT_DIR from parent or compute it
|
|
97
|
-
if [[ -z "${SCRIPT_DIR:-}" ]]; then
|
|
98
|
-
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
99
|
-
SCRIPT_DIR="$(cd "$SOURCE_DIR/.." && pwd)"
|
|
100
|
-
fi
|
|
101
|
-
|
|
102
96
|
# Run status command for interactive staging and committing
|
|
103
|
-
|
|
97
|
+
gitbash status
|
|
104
98
|
if [[ $? -ne 0 ]]; then
|
|
105
99
|
echo "Commit cancelled or failed. Aborting PR creation."
|
|
106
100
|
return 1
|
package/commands/stashes.sh
CHANGED
|
@@ -151,25 +151,13 @@ EOF
|
|
|
151
151
|
# -----------------------------
|
|
152
152
|
case "$selection" in
|
|
153
153
|
"$stash_option")
|
|
154
|
-
|
|
155
|
-
if [[ -z "${SCRIPT_DIR:-}" ]]; then
|
|
156
|
-
SCRIPT_DIR="$(cd "$SOURCE_DIR/.." && pwd)"
|
|
157
|
-
fi
|
|
158
|
-
"$SCRIPT_DIR/bin/gitbash" stash
|
|
154
|
+
gitbash stash
|
|
159
155
|
;;
|
|
160
156
|
"$unstash_option")
|
|
161
|
-
|
|
162
|
-
if [[ -z "${SCRIPT_DIR:-}" ]]; then
|
|
163
|
-
SCRIPT_DIR="$(cd "$SOURCE_DIR/.." && pwd)"
|
|
164
|
-
fi
|
|
165
|
-
"$SCRIPT_DIR/bin/gitbash" unstash
|
|
157
|
+
gitbash unstash
|
|
166
158
|
;;
|
|
167
159
|
"$cleanup_option")
|
|
168
|
-
|
|
169
|
-
if [[ -z "${SCRIPT_DIR:-}" ]]; then
|
|
170
|
-
SCRIPT_DIR="$(cd "$SOURCE_DIR/.." && pwd)"
|
|
171
|
-
fi
|
|
172
|
-
"$SCRIPT_DIR/bin/gitbash" cleanstash
|
|
160
|
+
gitbash cleanstash
|
|
173
161
|
;;
|
|
174
162
|
"$abort_label")
|
|
175
163
|
echo "Aborted."
|
package/commands/status.sh
CHANGED
|
@@ -306,12 +306,8 @@ EOF
|
|
|
306
306
|
echo "Ready to commit and push staged changes."
|
|
307
307
|
echo "Press Ctrl+C to abort."
|
|
308
308
|
echo
|
|
309
|
-
# Use SCRIPT_DIR from parent or compute it
|
|
310
|
-
if [[ -z "${SCRIPT_DIR:-}" ]]; then
|
|
311
|
-
SCRIPT_DIR="$(cd "$SOURCE_DIR/.." && pwd)"
|
|
312
|
-
fi
|
|
313
309
|
# Directly prompt for commit message (user can Ctrl+C to abort)
|
|
314
|
-
|
|
310
|
+
gitbash commit -s -p
|
|
315
311
|
break
|
|
316
312
|
fi
|
|
317
313
|
done
|