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

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

From
LCLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Date
Apr 26, 2007, 21:12 UTC
Message-ID
<20070426181214.36049e32@localhost>
In-Reply-To
<46310485.8070605@shadowen.org>

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
Previous: Andy WhitcroftNext: Luiz Fernando N Capitulino
Message 4 of 15 in “RFC: for_each_revision() helper”
  1. 0/5 RFC: for_each_revision() helperLuiz Fernando N Capitulino, Apr 26, 2007
  2. 1/5 Introduces for_each_revision() helperLuiz Fernando N Capitulino, Apr 26, 2007
  3. Andy WhitcroftApr 26, 2007
  4. Luiz Fernando N. CapitulinoApr 26, 2007
  5. 2/5 builtin-fmt-merge-msg.c: Use for_each_revision() helperLuiz Fernando N Capitulino, Apr 26, 2007
  6. 3/5 reachable.c: Use for_each_revision() helperLuiz Fernando N Capitulino, Apr 26, 2007
  7. 4/5 builtin-shortlog.c: Use for_each_revision() helperLuiz Fernando N Capitulino, Apr 26, 2007
  8. 5/5 builtin-log.c: Use for_each_revision() helperLuiz Fernando N Capitulino, Apr 26, 2007
  9. Hermes TrismegistoApr 26, 2007
  10. Sam RavnborgApr 26, 2007
  11. Luiz Fernando N. CapitulinoApr 26, 2007
  12. Luiz Fernando N. CapitulinoApr 26, 2007
  13. Junio C HamanoApr 26, 2007
  14. Luiz Fernando N. CapitulinoApr 27, 2007
  15. Junio C HamanoApr 27, 2007

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.