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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Luiz Fernando N. Capitulino
Date: Thursday, April 26, 2007 - 2:12 pm

Em Thu, 26 Apr 2007 20:59:01 +0100
Andy Whitcroft <apw@shadowen.org> 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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/5] RFC: for_each_revision() helper, Luiz Fernando N Capi ..., (Thu Apr 26, 12:46 pm)
[PATCH 1/5] Introduces for_each_revision() helper, Luiz Fernando N Capi ..., (Thu Apr 26, 12:46 pm)
[PATCH 2/5] builtin-fmt-merge-msg.c: Use for_each_revision ..., Luiz Fernando N Capi ..., (Thu Apr 26, 12:46 pm)
[PATCH 3/5] reachable.c: Use for_each_revision() helper, Luiz Fernando N Capi ..., (Thu Apr 26, 12:46 pm)
[PATCH 4/5] builtin-shortlog.c: Use for_each_revision() h ..., Luiz Fernando N Capi ..., (Thu Apr 26, 12:46 pm)
[PATCH 5/5] builtin-log.c: Use for_each_revision() helper, Luiz Fernando N Capi ..., (Thu Apr 26, 12:46 pm)
Re: [PATCH 1/5] Introduces for_each_revision() helper, Andy Whitcroft, (Thu Apr 26, 12:59 pm)
Re: [PATCH 0/5] RFC: for_each_revision() helper, Hermes Trismegisto, (Thu Apr 26, 1:57 pm)
Re: [PATCH 0/5] RFC: for_each_revision() helper, Sam Ravnborg, (Thu Apr 26, 2:05 pm)
Re: [PATCH 1/5] Introduces for_each_revision() helper, Luiz Fernando N. Cap ..., (Thu Apr 26, 2:12 pm)
Re: [PATCH 0/5] RFC: for_each_revision() helper, Luiz Fernando N. Cap ..., (Thu Apr 26, 2:14 pm)
Re: [PATCH 0/5] RFC: for_each_revision() helper, Luiz Fernando N. Cap ..., (Thu Apr 26, 2:17 pm)
Re: [PATCH 0/5] RFC: for_each_revision() helper, Junio C Hamano, (Thu Apr 26, 2:21 pm)
Re: [PATCH 0/5] RFC: for_each_revision() helper, Luiz Fernando N. Cap ..., (Fri Apr 27, 6:21 am)
Re: [PATCH 0/5] RFC: for_each_revision() helper, Junio C Hamano, (Fri Apr 27, 10:13 am)