mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
pgit.sh: Rename command "clone" to "get"
"clone" in the Git sense means to copy a remote project over from scratch. pgit.sh clone has come from that, but has since evolved into something different, a mixture of clone, pull and fetch, so find a different name. "get" seems generic enough and doesn't clash with a Git meaning. Adapt variable names accordingly across the project. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
82b41ffce2
commit
f86634a1d1
4 changed files with 38 additions and 43 deletions
|
|
@ -112,7 +112,7 @@ cmd_commit()
|
|||
done
|
||||
)
|
||||
|
||||
cmd_clone()
|
||||
cmd_get()
|
||||
(
|
||||
run_clone() {
|
||||
local url="$1"
|
||||
|
|
@ -128,7 +128,7 @@ cmd_clone()
|
|||
local whoami="$(id -un)"
|
||||
set_global_variables
|
||||
cd $projects_dir
|
||||
local projects="$PGIT_CLONE_PROJECTS"
|
||||
local projects="$PGIT_SH_PROJECTS"
|
||||
local ignore="$PGIT_IGNORE"
|
||||
local this_dir="${0%/*}"
|
||||
local jw_projects="/usr/bin/python3 $this_dir/jw-pkg.py"
|
||||
|
|
@ -138,7 +138,7 @@ cmd_clone()
|
|||
long_opts="$long_opts,refspec:"
|
||||
|
||||
local opts
|
||||
opts=$(getopt -o C --long "$long_opts" -n clone -- "$@") || fatal "Failed to parse options $@"
|
||||
opts=$(getopt -o C --long "$long_opts" -n get -- "$@") || fatal "Failed to parse options $@"
|
||||
eval set -- "$opts"
|
||||
while [ "$1" != -- ]; do
|
||||
case "$1" in
|
||||
|
|
@ -189,7 +189,7 @@ cmd_clone()
|
|||
[ "$to_ref" = "current-branch" ] && to_ref=$cur_ref
|
||||
[ "$from_ref" = "current-branch" ] && from_ref=$cur_ref
|
||||
[ "$refspec_arg" != "$from_user:$from_ref:$to_ref" ] && log "Fetching $from_user:$from_ref:$to_ref ($refspec_arg)"
|
||||
fat_marker "Fetching project $project_name from user $from_user"
|
||||
fat_marker "Getting project $project_name from user $from_user"
|
||||
if [ -d $project_dir ]; then
|
||||
run_git -C $project_dir remote | grep -q "^$remote_name$" || {
|
||||
run_git -C $project_dir remote add $remote_name $pull_url
|
||||
|
|
@ -272,7 +272,7 @@ while [ "${1:0:1}" = - ]; do
|
|||
done
|
||||
|
||||
case $cmd in
|
||||
clone|diff|commit)
|
||||
get|diff|commit)
|
||||
cmd_${cmd//-/_} "$@"
|
||||
;;
|
||||
*)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue