Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit eafc9c1

Browse files
committed
fixed the from-commit parameter
1 parent 1caa010 commit eafc9c1

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

smud-cli/functions-upgrade.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,32 @@ upgrade()
138138
local cherrypick_options="--keep-redundant-commits --allow-empty -x"
139139
local upgrade_error_code=0
140140
if [ "$yes_no" = "yes" ]; then
141+
142+
local user_name=$(git config --get user.name)
143+
local user_email=$(git config --get user.email)
144+
145+
if [ ! "$user_name" ] || [ ! "$user_email" ]; then
146+
local remote_origin_url="$(git config --get remote.origin.url| sed -e 's/https:\/\//')"
147+
if [ ! "$user_name" ]; then
148+
local user_name="githubservicesmud"
149+
fi
150+
151+
if [ ! "$user_email" ]; then
152+
local user_email="[email protected]"
153+
fi
154+
local user_name_ask="$user_name"
155+
local user_email_ask="$user_email"
156+
if [ ! "$silent" ]; then
157+
ask user_name_ask $blue "Please configure git user.name: Push ENTER to use '$user_name_ask': "
158+
ask user_email_ask $blue "Please configure git user.email: Push ENTER to use '$user_email_ask': "
159+
fi
160+
161+
local dummy=$(git config --unset user.name)
162+
local dummy=$(git config --unset user.email)
163+
local dummy=$(git config --add user.name "$user_name_ask" )
164+
local dummy=$(git config --add user.email "$user_email_ask" )
165+
fi
166+
141167
commits="${rev_list[@]}"
142168
print_gray "Running: git cherry-pick [commits]...\n"
143169
print_debug "$commits"
@@ -197,7 +223,7 @@ upgrade()
197223
else
198224
printf "${red}The follwing contains changes that must be resolved:\n${normal}"
199225
fi
200-
226+
201227
for status_code in "${!status_map[@]}"; do
202228
filenames="${status_map[$status_code]}"
203229
description=$(get_status_description "$status_code")

smud-cli/include.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ if [ "$has_args" ] && [ ! "$help" ] && [ "$is_repo" ]; then
477477

478478

479479
if [ ! "$from_commit" ] && [ ! "$from_date" ] && [ "$can_do_git" ] ; then
480-
from_commit_command="git rev-list $default_branch -1"
480+
from_commit_command="git rev-list $current_branch -1"
481481
{
482482
run_command from-commit --command-var from_commit_command --return-var from_commit --skip-error --debug-title "from-commit-command"
483483
} || {

0 commit comments

Comments
 (0)