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

3 messages from 2009-06-02 to 2009-06-04. Participants: Uwe Kleine-König, Bert Wesarg.
Thread: https://gitlist.dev/t/19660

## Bert Wesarg, 2009-06-02 21:09

Subject: [TopGit PATCH] pre-commit: check .topdeps for valid branches
Message-ID: <1243976962-10486-1-git-send-email-bert.wesarg@googlemail.com>
URL: https://gitlist.dev/e/1243976962-10486-1-git-send-email-bert.wesarg%40googlemail.com
In-Reply-To: <1243592316-10820-1-git-send-email-bert.wesarg@googlemail.com>

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

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

diff --git a/hooks/pre-commit.sh b/hooks/pre-commit.sh
index 8e05a4e..1eae2e8 100644
--- 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"
+
 		# deps can be non-tgish but we can't run recurse_deps() on them
 		ref_exists "refs/top-bases/$newly_added" ||
 			continue
-- 
tg: (0f8cd77..) bw/check-valid-deps (depends on: bw/check-for-dep-cycle)

```

## Uwe Kleine-König, 2009-06-04 09:34

Subject: Re: [TopGit PATCH] pre-commit: check .topdeps for valid branches
Message-ID: <20090604093456.GA14548@pengutronix.de>
URL: https://gitlist.dev/e/20090604093456.GA14548%40pengutronix.de
In-Reply-To: <1243976962-10486-1-git-send-email-bert.wesarg@googlemail.com>

```
Hi Bert,

> diff --git a/hooks/pre-commit.sh b/hooks/pre-commit.sh
> index 8e05a4e..1eae2e8 100644
> --- 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"
> +
>  		# deps can be non-tgish but we can't run recurse_deps() on them
>  		ref_exists "refs/top-bases/$newly_added" ||
>  			continue
> -- 
> tg: (0f8cd77..) bw/check-valid-deps (depends on: bw/check-for-dep-cycle)
this patch doesn't apply to my branch.  I'd say you didn't send out
bw/check-for-dep-cycle (or I oversaw it).

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

```

## Bert Wesarg, 2009-06-04 12:18

Subject: Re: [TopGit PATCH] pre-commit: check .topdeps for valid branches
Message-ID: <36ca99e90906040518h4bb92638y4d63fb5507b500a6@mail.gmail.com>
URL: https://gitlist.dev/e/36ca99e90906040518h4bb92638y4d63fb5507b500a6%40mail.gmail.com
In-Reply-To: <20090604093456.GA14548@pengutronix.de>

```
2009/6/4 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
> Hi Bert,
>
>> diff --git a/hooks/pre-commit.sh b/hooks/pre-commit.sh
>> index 8e05a4e..1eae2e8 100644
>> --- 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"
>> +
>>               # deps can be non-tgish but we can't run recurse_deps() on them
>>               ref_exists "refs/top-bases/$newly_added" ||
>>                       continue
>> --
>> tg: (0f8cd77..) bw/check-valid-deps (depends on: bw/check-for-dep-cycle)
> this patch doesn't apply to my branch.  I'd say you didn't send out
> bw/check-for-dep-cycle (or I oversaw it).
I have forwarded it to you, but you may also want to clone my topgit tree at:

http://kgb2.thruhere.net/git/?p=bertw/topgit.git;a=summary

Now that repo.or.cz is up again, I will put this repo on this server next week.

Regards,
Bert

>
> Best regards
> Uwe

```
