make: use GIT everywhere

This commit is contained in:
Franco Fichtner 2025-08-01 08:54:48 +02:00
parent a7ee273d68
commit 39b915035f

View File

@ -44,82 +44,82 @@ mlog_ARGS?= ${.CURDIR}
slog_ARGS?= ${.CURDIR}
ensure-stable:
@if ! git show-ref --verify --quiet refs/heads/${CORE_STABLE}; then \
git update-ref refs/heads/${CORE_STABLE} refs/remotes/origin/${CORE_STABLE}; \
git config branch.${CORE_STABLE}.merge refs/heads/${CORE_STABLE}; \
git config branch.${CORE_STABLE}.remote origin; \
@if ! ${GIT} show-ref --verify --quiet refs/heads/${CORE_STABLE}; then \
${GIT} update-ref refs/heads/${CORE_STABLE} refs/remotes/origin/${CORE_STABLE}; \
${GIT} config branch.${CORE_STABLE}.merge refs/heads/${CORE_STABLE}; \
${GIT} config branch.${CORE_STABLE}.remote origin; \
fi
diff: ensure-stable
@if [ "$$(git tag -l | grep -cx '${diff_ARGS:[1]}')" = "1" ]; then \
git diff --stat -p ${diff_ARGS:[1]}; \
@if [ "$$(${GIT} tag -l | grep -cx '${diff_ARGS:[1]}')" = "1" ]; then \
${GIT} diff --stat -p ${diff_ARGS:[1]}; \
else \
git diff --stat -p ${CORE_STABLE} ${diff_ARGS}; \
${GIT} diff --stat -p ${CORE_STABLE} ${diff_ARGS}; \
fi
feed: ensure-stable
@FEED="${feed_ARGS:[1]}"; \
if [ -z "$${FEED}" ]; then FEED=$$(${GITVERSION} ${CORE_STABLE} | awk '{print $$1}'); fi; \
git log --stat -p --reverse ${CORE_STABLE}...$${FEED}~1 ${.CURDIR}
${GIT} log --stat -p --reverse ${CORE_STABLE}...$${FEED}~1 ${.CURDIR}
mfc: ensure-stable clean-mfcdir
.for MFC in ${mfc_ARGS}
.if exists(${MFC})
@cp -r ${MFC} ${MFCDIR}
@git checkout ${CORE_STABLE}
@${GIT} checkout ${CORE_STABLE}
@rm -rf ${MFC}
@mkdir -p $$(dirname ${MFC})
@mv ${MFCDIR}/$$(basename ${MFC}) ${MFC}
@git add -f .
@if ! git diff --quiet HEAD; then \
git commit -m "${MFC}: sync with ${CORE_MAIN}"; \
@${GIT} add -f .
@if ! ${GIT} diff --quiet HEAD; then \
${GIT} commit -m "${MFC}: sync with ${CORE_MAIN}"; \
fi
.else
@git checkout ${CORE_STABLE}
@if ! git cherry-pick -x ${MFC}; then \
git cherry-pick --abort; \
@${GIT} checkout ${CORE_STABLE}
@if ! ${GIT} cherry-pick -x ${MFC}; then \
${GIT} cherry-pick --abort; \
fi
.endif
@git checkout ${CORE_MAIN}
@${GIT} checkout ${CORE_MAIN}
.endfor
stable:
@git checkout ${CORE_STABLE}
@${GIT} checkout ${CORE_STABLE}
${CORE_MAINS}:
@git checkout ${CORE_MAIN}
@${GIT} checkout ${CORE_MAIN}
rebase:
@git checkout ${CORE_STABLE}
@git rebase -i
@git checkout ${CORE_MAIN}
@${GIT} checkout ${CORE_STABLE}
@${GIT} rebase -i
@${GIT} checkout ${CORE_MAIN}
reset:
@git checkout ${CORE_STABLE}
@git reset --hard HEAD~1
@git checkout ${CORE_MAIN}
@${GIT} checkout ${CORE_STABLE}
@${GIT} reset --hard HEAD~1
@${GIT} checkout ${CORE_MAIN}
mlog:
@git log --stat -p ${CORE_MAIN} ${mlog_ARGS}
@${GIT} log --stat -p ${CORE_MAIN} ${mlog_ARGS}
slog: ensure-stable
@git log --stat -p ${CORE_STABLE} ${slog_ARGS}
@${GIT} log --stat -p ${CORE_STABLE} ${slog_ARGS}
pull:
@git checkout ${CORE_STABLE}
@git pull
@git checkout ${CORE_MAIN}
@${GIT} checkout ${CORE_STABLE}
@${GIT} pull
@${GIT} checkout ${CORE_MAIN}
push:
@git checkout ${CORE_STABLE}
@git push
@git checkout ${CORE_MAIN}
@${GIT} checkout ${CORE_STABLE}
@${GIT} push
@${GIT} checkout ${CORE_MAIN}
checkout:
.for DIR in ${.CURDIR}/src
.if exists(${DIR})
@git reset -q ${.CURDIR}/src && \
git checkout -f ${.CURDIR}/src && \
git clean -xdqf ${.CURDIR}/src
@${GIT} reset -q ${.CURDIR}/src && \
${GIT} checkout -f ${.CURDIR}/src && \
${GIT} clean -xdqf ${.CURDIR}/src
.endif
.endfor