hooks/pre-commit: check for cycles in dependencies
commitb7fdc229eb9ffb682057d66ce3d3f12337dc0e96
authorBert Wesarg <bert.wesarg@googlemail.com>
Mon, 4 Oct 2010 21:07:27 +0000 (4 23:07 +0200)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 5 Oct 2010 07:03:44 +0000 (5 09:03 +0200)
tree8dfbca784e12a2e23b362e1643bf3627bb7854ea
parent1fb84a0250902fdf93bb0de335625975bd69734b
hooks/pre-commit: check for cycles in dependencies

We need only to consider newly added dependencies.  For each of these deps we
need to check if there is a path from this dep to the current HEAD.

We use recursive_dep() for this task.  Even if recursive_dep() uses a DFS
traversal it will not run into an endless loop if there would be a cycle,
because recursive_dep() takes .topdeps only from committed trees.  And we
require that the committed dependency graph has no cycles.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
hooks/pre-commit.sh