git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[TopGit PATCH] pre-commit: check .topdeps for valid branches

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Oct 4, 2010, 21:18 UTC
Message-ID
<1286227130-8306-1-git-send-email-bert.wesarg@googlemail.com>
In-Reply-To
<1286226447-3390-1-git-send-email-bert.wesarg@googlemail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 hooks/pre-commit.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hooks/pre-commit.sh b/hooks/pre-commit.sh
index fd960a4..f6901e4 100644 hooks/pre-commit.sh
--- a/hooks/pre-commit.sh
+++ b/hooks/pre-commit.sh
@@ -52,6 +52,9 @@ BEGIN      { in_hunk = 0; }
 /^[^@ +-]/ { in_hunk = 0; }
 ' |
 	while read newly_added; do
+		ref_exists "$newly_added" ||
+			die "Invalid branch as dependent: $newly_added"
+
 		# check for self as dep
 		[ "$head_" != "$newly_added" ] ||
 			die "Can't have myself as dep"
@@ -64,6 +67,3 @@ BEGIN      { in_hunk = 0; }
 		# therefore no endless loop in the cycle-check
 		no_remotes=1 recurse_deps check_cycle_name "$newly_added"
 	done
-
-
-# TODO: Verify .topdeps for valid branch names
-- 
tg: (d4c1eaf..) bw/check-valid-deps (depends on: bw/check-for-dep-cycle)
Previous: Bert WesargNext: Bert Wesarg
Message 2 of 3 in “hooks/pre-commit: check for cycles in dependencies”
  1. hooks/pre-commit: check for cycles in dependenciesBert Wesarg, Oct 4, 2010
  2. pre-commit: check .topdeps for valid branchesBert Wesarg, Oct 4, 2010
  3. hooks/pre-commit: check for deps repititionsBert Wesarg, Oct 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.