]> git.ipfire.org Git - thirdparty/git.git/commit - submodule.c
Implement automatic fast-forward merge for submodules
authorHeiko Voigt <hvoigt@hvoigt.net>
Wed, 7 Jul 2010 13:39:13 +0000 (15:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Jul 2010 16:48:45 +0000 (09:48 -0700)
commit68d03e4a6e448aa557f52adef92595ac4d6cd4bd
treea0ff79beee2c86ab9ab5f511cdbb81316cbee0a2
parent9ef6aeb09ffe0650ca86dca53de93fd85333b02d
Implement automatic fast-forward merge for submodules

This implements a simple merge strategy for submodule hashes. We check
whether one side of the merge candidates is already contained in the
other and then merge automatically.

If both sides contain changes we search for a merge in the submodule.
In case a single one exists we check that out and suggest it as the
merge resolution. A list of candidates is returned when we find multiple
merges that contain both sides of the changes.

This is useful for a workflow in which the developers can publish topic
branches in submodules and a separate maintainer merges them. In case
the developers always wait until their branch gets merged before tracking
them in the superproject all merges of branches that contain submodule
changes will be resolved automatically. If developers choose to track
their feature branch the maintainer might get a conflict but git will
search the submodule for a merge and suggest it/them as a resolution.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c
submodule.c
submodule.h
t/t7405-submodule-merge.sh