subtree: make --ignore-joins pay attention to adds
commitdd21d43b58ee3ce1b9801b5121fead0298961be1
authorStrain, Roger L <roger.strain@swri.org>
Fri, 28 Sep 2018 18:35:38 +0000 (28 13:35 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 6 Oct 2018 23:09:34 +0000 (7 08:09 +0900)
tree6e72693803423efc66a19054b01d0879d795c408
parent565e4b79816c1618161a5bd647982aa0daff81c4
subtree: make --ignore-joins pay attention to adds

Changes the behavior of --ignore-joins to always consider a subtree add
commit, and ignore only splits and squashes.

The --ignore-joins option is documented to ignore prior --rejoin commits.
However, it additionally ignored subtree add commits generated when a
subtree was initially added to a repo.

Due to the logic which determines whether a commit is a mainline commit
or a subtree commit (namely, the presence or absence of content in the
subtree prefix) this causes commits before the initial add to appear to
be part of the subtree. An --ignore-joins split would therefore consider
those commits part of the subtree history and include them at the
beginning of the synthetic history, causing the resulting hashes to be
incorrect for all later commits.

Signed-off-by: Strain, Roger L <roger.strain@swri.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh