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:
Jan Lindemann 2026-02-21 09:29:11 +01:00
commit f86634a1d1
4 changed files with 38 additions and 43 deletions

View file

@ -25,13 +25,13 @@ JWBDIR_NAME ?= jw-pkg
JWBDIR_SEARCH_PATH ?= $(DEV_PROJECTS_DIR) $(BUILD_TOOLS_PREFIX)/opt/$(FLAVOUR_PATH_PREFIX)
JWBDIR ?= $(firstword $(wildcard $(addsuffix /$(JWBDIR_NAME),$(JWBDIR_SEARCH_PATH))))
JW_PKG_BINDIR = $(JWBDIR)/bin
JW_PKG_BINDIR = $(JWBDIR)/bin
JWB_SCRIPT_DIR = $(firstword $(wildcard ./$(JWBDIR_NAME)/scripts $(JW_PKG_BINDIR)) jwb-script-dir-not-found)
JW_PKG_REMOTE_BINDIR = /opt/jw-pkg/bin
JW_PKG_REMOTE_BINDIR = /opt/jw-pkg/bin
SHELL = /bin/bash -o pipefail +H
PROJECTS_TXT ?= projects.txt
JW_PKG_VERBOSE ?= false
JW_PKG_VERBOSE ?= false
BASE_PKGS = git make sudo time xdg-utils python3
PREREQ_RELEASE ?= pull
ifneq ($(JANWARE_USER),)
@ -77,7 +77,7 @@ OFFLINE_PROJECTS ?= $(EXCLUDE_FROM_BUILD)
TEXT_FILES_CACHE ?= text-files.txt
ifeq ($(OFFLINE),true)
UNAVAILABLE_TARGETS ?= pull.done update.done clone.done
UNAVAILABLE_TARGETS ?= pull.done update.done get.done
else
UNAVAILABLE_TARGETS ?=
endif
@ -121,19 +121,19 @@ PKG_MANAGER ?= $(JW_PKG_PY) distro --interactive=$(INTERACTIVE)
ifneq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined)
PGIT_SH += --remote-base $(PROJECTS_DIR_REMOTE_BASE)
endif
PGIT_SH_CLONE := $(PGIT_SH) clone
PGIT_SH_CLONE_DEFAULT = $(PGIT_SH_CLONE) $(PGIT_SH_OPTS_NETWORK)
PGIT_SH_GET := $(PGIT_SH) get
PGIT_SH_GET_DEFAULT = $(PGIT_SH_GET) $(PGIT_SH_OPTS_NETWORK)
ifneq ($(JANWARE_USER),)
PGIT_SH_OPTS_NETWORK += --login $(JANWARE_USER)
endif
ifneq ($(CLONE_FROM_USER),)
PGIT_SH_CLONE_DEFAULT += --refspec $(CLONE_FROM_USER):current-branch:current-branch
PGIT_SH_GET_DEFAULT += --refspec $(CLONE_FROM_USER):current-branch:current-branch
endif
ifneq ($(OFFLINE_PROJECTS),)
export PGIT_IGNORE = $(OFFLINE_PROJECTS)
endif
ifneq ($(JANWARE_USER),)
PGIT_SH_CLONE_DEFAULT += --create-remote-user-repos
PGIT_SH_GET_DEFAULT += --create-remote-user-repos
endif
PURGE_SH = /bin/bash $(firstword $(wildcard $(JWB_SCRIPT_DIR)/purge-stale-projects.sh $(JW_PKG_BINDIR)/purge-stale-projects.sh) purge-not-found)
@ -291,7 +291,7 @@ done.clean:
list-maintainers: $(SSH_WRAPPER_SH)
$(GIT_SRV_ADMIN_SH) $@
update pull: purge git-clone
update pull: purge git-get
touch pull.done
sync: pull push
@ -301,13 +301,15 @@ sync-all: pull-all push-all
sync-%:
ssh $* make -C $(shell pwd) sync
pull-all: purge git-clone git-pull-all
touch clone.done
pull-all: purge git-get git-pull-all
touch get.done
touch pull.done
diff-all diff: $(SSH_WRAPPER_SH)
$(PGIT_SH) diff
# --- git targets
git-push push: $(SSH_WRAPPER_SH)
$(PGIT_SH) push $(PGIT_SH_OPTS_NETWORK)
@ -323,22 +325,18 @@ git-short-diff: $(SSH_WRAPPER_SH)
git-status:
$(PGIT_SH) status -uno
git-get: $(SSH_WRAPPER_SH)
$(PGIT_SH_GET_DEFAULT)
touch get.done
git-pull: $(SSH_WRAPPER_SH)
$(PGIT_SH_CLONE_DEFAULT)
git-pull-mini: $(SSH_WRAPPER_SH)
PGIT_CLONE_PROJECTS="$(patsubst %/.git,%,$(wildcard $(addsuffix /.git,$(shell make -s build-order))))" $(PGIT_SH_CLONE_DEFAULT)
git-get-mini: $(SSH_WRAPPER_SH)
PGIT_SH_PROJECTS="$(patsubst %/.git,%,$(wildcard $(addsuffix /.git,$(shell make -s build-order))))" $(PGIT_SH_GET_DEFAULT)
git-pull-all: $(SSH_WRAPPER_SH)
$(PGIT_SH) pull $(PGIT_SH_OPTS_NETWORK) --all
git-clone: $(SSH_WRAPPER_SH)
$(PGIT_SH_CLONE_DEFAULT)
touch clone.done
git-clone-%: $(SSH_WRAPPER_SH)
$(PGIT_SH_CLONE_DEFAULT)
git-get-%: $(SSH_WRAPPER_SH)
$(PGIT_SH_GET) $(PGIT_SH_OPTS_NETWORK) --refspec "$*:master:master"
git-show-non-master-branches:
$(Q)$(PGIT_SH) branch 2>&1 | \
@ -366,9 +364,6 @@ git-echo-links-%: | $(TEXT_FILES_CACHE)
git-update-project-descriptions: $(SSH_WRAPPER_SH)
$(GIT_SRV_ADMIN_SH) -j update-descriptions all
git-pull-%: $(SSH_WRAPPER_SH)
$(PGIT_SH_CLONE) $(PGIT_SH_OPTS_NETWORK) --refspec "$*:master:master"
git-commit:
$(PGIT_SH) commit
@ -383,9 +378,9 @@ clean.ssh-wrapper:
rm -f $(SSH_WRAPPER_SH)
distclean: clean.ssh-wrapper
pull.done: $(filter-out $(UNAVAILABLE_TARGETS), clone.done)
pull.done: $(filter-out $(UNAVAILABLE_TARGETS),get.done)
touch $@
clone.done: $(filter-out $(UNAVAILABLE_TARGETS),$(SSH_WRAPPER_SH))
$(PGIT_SH_CLONE_DEFAULT)
get.done: $(filter-out $(UNAVAILABLE_TARGETS),$(SSH_WRAPPER_SH))
$(PGIT_SH_GET_DEFAULT)
touch $@