Commit c2c85340 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Remove the submodule update from do_update

Submodule updates are now done weekly, on a cron job, in a CI
environment.
parent 7c5d8549
Loading
Loading
Loading
Loading
+0 −43
Original line number Diff line number Diff line
@@ -102,48 +102,6 @@ update_worktree()
	fi
}

update_repos()
(
	git fetch origin

	local worktree=`mktemp -d`
	git worktree add -f $worktree --detach origin/master
	cd $worktree

	git submodule sync --recursive
	git submodule update --init --recursive --depth=1 ${GIT_JOBS}

	git submodule foreach --recursive '
		setting="submodule.${name}.auto-update";
		branch=`git config -f ~/.gitmodules ${setting}`;
		git checkout origin/${branch:-master} || exit 1
		(cd ${toplevel}; exec git add ${path})
		'

	local updates="`git status --short -uno`"
	if [ -n "$updates" ]; then
		git commit -F- <<-END_MESSAGE
			Update submodules

			$updates

			Automatically generated:
			  source: .shell/funcs:update_submodules()
			  time:   `date`
			  host:   `hostname -f 2>/dev/null || hostname`
		END_MESSAGE

		if git push origin HEAD:master; then
			echo >&2 "Submodules have been updated and pushed to origin"
		else
			echo >&2 "Automatic push failed, this may mean the remote" \
		             "'origin' has not been set"
		fi
	fi

	cd && rm -r $worktree
)

do_update()
{
	local timestamp=${HOME}/.shell/.update
@@ -171,7 +129,6 @@ do_update()
	(cd ~
		set -eu
		git_check &&
		update_repos &&
		update_worktree
	) || return