git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>,
	junkio@cox.net, git@vger.kernel.org
Subject: Re: [PATCH 1/5] Introduces for_each_revision() helper
Date: Sat, 28 Apr 2007 13:50:59 +0200	[thread overview]
Message-ID: <20070428115059.GA4888@steel.home> (raw)
In-Reply-To: <Pine.LNX.4.64.0704280446180.12006@racer.site>

Johannes Schindelin, Sat, Apr 28, 2007 04:46:41 +0200:
> > +#define for_each_revision(commit, rev) \
> > +	for (prepare_revision_walk(rev); \
> > +		  (commit = get_revision(rev)) != NULL; )
> > +
> >  #endif
> 
> I object to this, additionally to the magic argument that I agree to, on 
> the grounds that it is actually wrong. The first iteration will work on an 
> _uninitialized_ "commit" variable.

No, it wont. Check it. This code is correct.

> Furthermore, it is not like it was a huge piece of code that is being 
> replaced by a shortcut. There are better places to do some libification 
> than this.

It is not about libification. It is plain readability issue.
Look at what list_for_each_* macros did to the source of Linux kernel.

  reply	other threads:[~2007-04-28 11:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27 17:00 [PATCH 0/5] New for_each_revision() helper Luiz Fernando N. Capitulino
2007-04-27 17:00 ` [PATCH 1/5] Introduces " Luiz Fernando N. Capitulino
2007-04-27 19:32   ` Junio C Hamano
2007-04-27 21:13     ` Luiz Fernando N. Capitulino
2007-04-29  6:59       ` Junio C Hamano
2007-04-29  7:06         ` Shawn O. Pearce
2007-04-30 23:19           ` Junio C Hamano
2007-04-28  2:46   ` Johannes Schindelin
2007-04-28 11:50     ` Alex Riesen [this message]
2007-04-28 12:52       ` Johannes Schindelin
2007-04-28 16:02       ` Luiz Fernando N. Capitulino
2007-04-28 16:48         ` Alex Riesen
2007-04-29 13:04           ` Luiz Fernando N. Capitulino
2007-04-27 17:00 ` [PATCH 2/5] builtin-fmt-merge-msg.c: Use " Luiz Fernando N. Capitulino
2007-04-27 17:00 ` [PATCH 3/5] reachable.c: " Luiz Fernando N. Capitulino
2007-04-27 17:00 ` [PATCH 4/5] builtin-shortlog.c: " Luiz Fernando N. Capitulino
2007-04-27 17:00 ` [PATCH 5/5] builtin-log.c: " Luiz Fernando N. Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2007-04-26 19:46 [PATCH 0/5] RFC: " Luiz Fernando N Capitulino
2007-04-26 19:46 ` [PATCH 1/5] Introduces " Luiz Fernando N Capitulino
2007-04-26 19:59   ` Andy Whitcroft
2007-04-26 21:12     ` Luiz Fernando N. Capitulino

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=20070428115059.GA4888@steel.home \
    --to=raa.lkml@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=lcapitulino@mandriva.com.br \
    /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).