Skip to content

Commit

Permalink
fixed the from-commit parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
aho-dips committed Feb 9, 2024
1 parent 1caa010 commit eafc9c1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
28 changes: 27 additions & 1 deletion smud-cli/functions-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,32 @@ upgrade()
local cherrypick_options="--keep-redundant-commits --allow-empty -x"
local upgrade_error_code=0
if [ "$yes_no" = "yes" ]; then

local user_name=$(git config --get user.name)
local user_email=$(git config --get user.email)

if [ ! "$user_name" ] || [ ! "$user_email" ]; then
local remote_origin_url="$(git config --get remote.origin.url| sed -e 's/https:\/\//')"
if [ ! "$user_name" ]; then
local user_name="githubservicesmud"
fi

if [ ! "$user_email" ]; then
local user_email="[email protected]"
fi
local user_name_ask="$user_name"
local user_email_ask="$user_email"
if [ ! "$silent" ]; then
ask user_name_ask $blue "Please configure git user.name: Push ENTER to use '$user_name_ask': "
ask user_email_ask $blue "Please configure git user.email: Push ENTER to use '$user_email_ask': "
fi

local dummy=$(git config --unset user.name)
local dummy=$(git config --unset user.email)
local dummy=$(git config --add user.name "$user_name_ask" )
local dummy=$(git config --add user.email "$user_email_ask" )
fi

commits="${rev_list[@]}"
print_gray "Running: git cherry-pick [commits]...\n"
print_debug "$commits"
Expand Down Expand Up @@ -197,7 +223,7 @@ upgrade()
else
printf "${red}The follwing contains changes that must be resolved:\n${normal}"
fi

for status_code in "${!status_map[@]}"; do
filenames="${status_map[$status_code]}"
description=$(get_status_description "$status_code")
Expand Down
2 changes: 1 addition & 1 deletion smud-cli/include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ if [ "$has_args" ] && [ ! "$help" ] && [ "$is_repo" ]; then


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

0 comments on commit eafc9c1

Please sign in to comment.