mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-23 22:40:38 +01:00
git-submodule.mk: Make git-init-submod-remote work
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
bb9e992211
commit
67a60a57bb
1 changed files with 21 additions and 24 deletions
|
|
@ -1,32 +1,29 @@
|
||||||
GIT_SRV_ADMIN_SH = ssh $(JANWARE_USER)@git.jannet.de /opt/jw-build/bin/git-srv-admin.sh
|
# - Clone remote repo into <mydir>/<myrepo>
|
||||||
|
# - Add the following to <mydir>/Makefile:
|
||||||
|
# - SUBMOD_SRC_DIR = ./<myrepo>
|
||||||
|
# - include <path-to-this-makefile>
|
||||||
|
# - run git-init-submod-remote
|
||||||
|
|
||||||
|
GIT_SRV_ADMIN_SH = ssh $(JANWARE_USER)@git.jannet.de /opt/jw-build/bin/git-srv-admin.sh
|
||||||
|
GIT_REPO_URL = ssh://$(JANWARE_USER)@git.jannet.de/srv/git/$(JANWARE_USER)/contrib/$(PROJECT_DIRNAME)
|
||||||
|
SUBMOD_PATH = $(patsubst $(abspath $(TOPDIR))/%,%,$(abspath $(shell pwd)/$(SUBMOD_SRC_DIR)))
|
||||||
|
SUBMOD_SRC_DIR ?= .
|
||||||
|
SUB_GIT = git -C $(SUBMOD_SRC_DIR)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
install:
|
install:
|
||||||
clean:
|
clean:
|
||||||
distclean:
|
distclean:
|
||||||
|
|
||||||
SUBMOD_SRC_DIR ?= .
|
git-init-submod-remote:
|
||||||
export GIT_EXEC_PATH = $(SUBMOD_SRC_DIR)
|
|
||||||
|
|
||||||
git-submod-init-remote:
|
|
||||||
@echo "FIXME: git-srv-admin.sh needs to support creating a bare repo below <user>/contrib/<project>."
|
|
||||||
@echo "FIXME: Then this target in $(lastword $(MAKEFILE_LIST)) has to do the following:"
|
|
||||||
@echo "FIXME: - Use that,"
|
|
||||||
@echo "FIXME: - rename remote \"origin\" to \"upstream\", # git remote rename origin upstream"
|
|
||||||
@echo "FIXME: - add new remote origin pointing to newly created repo, # git remote add origin ssh://$(JANWARE_USER)@git.jannet.de/srv/git/$(JANWARE_USER)/contrib/<project>"
|
|
||||||
@echo "FIXME: - fix remote to push to # git config branch.master.remote origin"
|
|
||||||
@echo "FISME: - set standard branch (should be okay anyway) # git config branch.master.merge refs/heads/master"
|
|
||||||
@echo "FIXME: - push contents there."
|
|
||||||
@exit 1
|
|
||||||
|
|
||||||
git-submod-test-init-remote:
|
|
||||||
$(GIT_SRV_ADMIN_SH) -F contrib create-repo $(PROJECT_DIRNAME)
|
$(GIT_SRV_ADMIN_SH) -F contrib create-repo $(PROJECT_DIRNAME)
|
||||||
git remote rename origin upstream
|
$(SUB_GIT) remote rename origin upstream
|
||||||
git remote add origin ssh://$(JANWARE_USER)@git.jannet.de/srv/git/$(JANWARE_USER)/contrib/$(PROJECT_DIRNAME)
|
$(SUB_GIT) remote set-url --push upstream no-push
|
||||||
git config branch.master.remote origin
|
$(SUB_GIT) remote add origin $(GIT_REPO_URL)
|
||||||
git config branch.master.merge refs/heads/master
|
$(SUB_GIT) config branch.master.remote origin
|
||||||
git push origin master
|
$(SUB_GIT) config branch.master.merge refs/heads/master
|
||||||
@echo "FIXME: after this procedure I had to manually change the remote in the toplevel project's directory .gitmodules to point to the janware server"
|
$(SUB_GIT) push origin master
|
||||||
@echo "FIXME: - push contents there."
|
git -C $(TOPDIR) submodule add -f $(GIT_REPO_URL) $(SUBMOD_PATH)
|
||||||
@exit 1
|
git submodule init
|
||||||
|
git commit -am "Add git submodule $(SUBMOD_PATH)" $(SUBMOD_SRC_DIR) $(TOPDIR)/.gitmodules
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue