Subject: Re: [PATCH 1/5] Introduces for_each_revision() helper

From: "Luiz Fernando N. Capitulino" <[email-masked]>
Date: Thu, 26 Apr 2007 18:12:14 -0300

Em Thu, 26 Apr 2007 20:59:01 +0100
Andy Whitcroft <[email-masked]> escreveu:

| If this is constructed like that then I would expect the code below to
| be miss-compiled:
| 
| 	if (condition)
| 		for_each_revision(commit, rev) {
| 		}
| 
| As it would be effectivly be:
| 
| 	if (condition)
| 		prepare_revision_walk(rev);
| 	while ((commit = get_revision(rev)) != NULL) {
| 	}
| 
| I think you'd want this to be something more like:
| 
| #define for_each_revision(commit, rev) \
| 	for (prepare_revision_walk(rev); \
| 		(commit = get_revision(rev))) != NULL); ) {

 I'm *so* clueless that this mistake does not surprise me.

 Will fix, thanks for the review Andy.

-- 
Luiz Fernando N. Capitulino