git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
To: Petr Baudis <pasky@suse.cz>
Cc: git@vger.kernel.org, pasky@suse.cz,
	martin f krafft <madduck@madduck.net>,
	Bert Wesarg <bert.wesarg@googlemail.com>
Subject: [TopGit PATCH] hooks/pre-commit: check for deps repititions
Date: Mon,  4 Oct 2010 23:22:17 +0200	[thread overview]
Message-ID: <1286227337-8934-1-git-send-email-bert.wesarg@googlemail.com> (raw)
In-Reply-To: <1286227130-8306-1-git-send-email-bert.wesarg@googlemail.com>

A dep should only be listed once in .topdeps, force this.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>

---
 hooks/pre-commit.sh |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hooks/pre-commit.sh b/hooks/pre-commit.sh
index f6901e4..e8986d6 100644 hooks/pre-commit.sh
--- a/hooks/pre-commit.sh
+++ b/hooks/pre-commit.sh
@@ -67,3 +67,15 @@ BEGIN      { in_hunk = 0; }
 		# therefore no endless loop in the cycle-check
 		no_remotes=1 recurse_deps check_cycle_name "$newly_added"
 	done
+
+# check for repititions of deps
+depdir="$(mktemp -t -d tg-depdir.XXXXXX)" ||
+	die "Can't check for mulitple occurrences of deps"
+trap "rm -rf '$depdir'" 0
+cat_file "(i):.topdeps" |
+	while read dep; do
+		[ ! -d "$depdir/$dep" ] ||
+			die "Mulitple occurrences of the same dep: $dep"
+		mkdir -p "$depdir/$dep" ||
+			die "Can't check for mulitple occurrences of deps"
+	done
-- 
tg: (a2bfc32..) bw/check-for-repetitions (depends on: bw/check-valid-deps)

      reply	other threads:[~2010-10-04 21:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 21:07 [TopGit PATCH] hooks/pre-commit: check for cycles in dependencies Bert Wesarg
2010-10-04 21:18 ` [TopGit PATCH] pre-commit: check .topdeps for valid branches Bert Wesarg
2010-10-04 21:22   ` Bert Wesarg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286227337-8934-1-git-send-email-bert.wesarg@googlemail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=madduck@madduck.net \
    --cc=pasky@suse.cz \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).