  We derive a decomposition formula for the spectral flow of a 1-parameter
family of self-adjoint Dirac operators on an odd-dimensional manifold $M$ split
along a hypersurface $\Sigma$ ($M=X\cup_{\Sigma} Y$). No transversality or
stretching hypotheses are assumed and the boundary conditions can be chosen
arbitrarily. The formula takes the form $SF(D)= SF(D_{|X}, B_X) +
SF(D_{|Y},B_Y) + \mu(B_Y,B_X) + S$ where $B_X$ and $B_Y$ are boundary
conditions, $\mu$ denotes the Maslov index, and $S$ is a sum of explicitly
defined Maslov indices coming from stretching and rotating boundary conditions.
The derivation is a simple consequence of Nicolaescu's theorems and elementary
properties of the Maslov index. We show how to use the formula and derive many
of the splitting theorems in the literature as simple consequences.
