All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Beller <stefanbeller@googlemail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 16/20] revision: trivial style fixes
Date: Sat, 12 Oct 2013 11:08:16 +0200	[thread overview]
Message-ID: <52591180.3010103@googlemail.com> (raw)
In-Reply-To: <1381561636-20717-10-git-send-email-felipe.contreras@gmail.com>

On 10/12/2013 09:07 AM, Felipe Contreras wrote:
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  revision.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/revision.c b/revision.c
> index 0173e01..4049867 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -1503,7 +1503,7 @@ struct cmdline_pathspec {
>  static void append_prune_data(struct cmdline_pathspec *prune, const char **av)
>  {
>  	while (*av) {
> -		ALLOC_GROW(prune->path, prune->nr+1, prune->alloc);
> +		ALLOC_GROW(prune->path, prune->nr + 1, prune->alloc);
>  		prune->path[prune->nr++] = *(av++);
>  	}
>  }
> @@ -1515,7 +1515,7 @@ static void read_pathspec_from_stdin(struct rev_info *revs, struct strbuf *sb,
>  		int len = sb->len;
>  		if (len && sb->buf[len - 1] == '\n')
>  			sb->buf[--len] = '\0';
> -		ALLOC_GROW(prune->path, prune->nr+1, prune->alloc);
> +		ALLOC_GROW(prune->path, prune->nr + 1, prune->alloc);
>  		prune->path[prune->nr++] = xstrdup(sb->buf);
>  	}
>  }
> @@ -2118,7 +2118,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
>  		 *	call init_pathspec() to set revs->prune_data here.
>  		 * }
>  		 */
> -		ALLOC_GROW(prune_data.path, prune_data.nr+1, prune_data.alloc);
> +		ALLOC_GROW(prune_data.path, prune_data.nr + 1, prune_data.alloc);
>  		prune_data.path[prune_data.nr++] = NULL;
>  		parse_pathspec(&revs->prune_data, 0, 0,
>  			       revs->prefix, prune_data.path);
> @@ -2971,7 +2971,7 @@ static struct commit *get_revision_internal(struct rev_info *revs)
>  	if (revs->max_count) {
>  		c = get_revision_1(revs);
>  		if (c) {
> -			while (0 < revs->skip_count) {
> +			while (revs->skip_count > 0) {
>  				revs->skip_count--;
>  				c = get_revision_1(revs);
>  				if (!c)
> @@ -2986,9 +2986,8 @@ static struct commit *get_revision_internal(struct rev_info *revs)
>  	if (c)
>  		c->object.flags |= SHOWN;
>  
> -	if (!revs->boundary) {
> +	if (!revs->boundary)
>  		return c;
> -	}
>  
>  	if (!c) {
>  		/*
> @@ -3034,9 +3033,8 @@ struct commit *get_revision(struct rev_info *revs)
>  
>  	if (revs->reverse) {
>  		reversed = NULL;
> -		while ((c = get_revision_internal(revs))) {
> +		while ((c = get_revision_internal(revs)))
>  			commit_list_insert(c, &reversed);
> -		}

While talking about trivia, what is the projects stance on
such constructs here?
	while (foo)
		bar();
	foobar();

I've seen an empty line between the bar(); and the foobar(); often, which suits readability.
What's the stance on such an empty line here?

>  		revs->commits = reversed;
>  		revs->reverse = 0;
>  		revs->reverse_output_stage = 1;
> 

Thanks,
Stefan

  reply	other threads:[~2013-10-12  9:08 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-12  7:06 [PATCH 10/20] doc: git-foo was obsoleted several years ago Felipe Contreras
2013-10-12  7:06 ` [PATCH 00/20] Trivial paches Felipe Contreras
2013-10-12  7:06 ` [PATCH 03/20] pull: cleanup documentation Felipe Contreras
2013-10-12  7:06 ` [PATCH 20/20] add: avoid yoda conditions Felipe Contreras
2013-10-12  7:07 ` [PATCH 08/20] branch: trivial style fix Felipe Contreras
2013-10-12  7:07 ` [PATCH 15/20] pretty: " Felipe Contreras
2013-10-12  7:07 ` [PATCH 19/20] setup: trivial style fixes Felipe Contreras
2013-10-12  7:07 ` [PATCH 13/20] transport-helper: trivial style fix Felipe Contreras
2013-10-12  7:07 ` [PATCH 01/20] merge: simplify ff-only option Felipe Contreras
2013-10-12  7:07 ` [PATCH 16/20] revision: trivial style fixes Felipe Contreras
2013-10-12  9:08   ` Stefan Beller [this message]
2013-10-12 11:18     ` Felipe Contreras
2013-10-12  7:07 ` [PATCH 17/20] diff: trivial style fix Felipe Contreras
2013-10-12  7:07 ` [PATCH 05/20] remote: fix trivial memory leak Felipe Contreras
2013-10-12  7:07 ` [PATCH 07/20] shortlog: add missing declaration Felipe Contreras
2013-10-12  7:07 ` [PATCH 11/20] symbolic-ref: trivial style fix Felipe Contreras
2013-10-12  7:07 ` [PATCH 06/20] revision: add missing include Felipe Contreras
2013-10-12  7:07 ` [PATCH 18/20] run-command: trivial style fixes Felipe Contreras
2013-10-12  7:07 ` [PATCH 02/20] t: replace pulls with merges Felipe Contreras
2013-10-12  7:07 ` [PATCH 12/20] alias: trivial style fix Felipe Contreras
2013-10-12  8:55   ` Stefan Beller
2013-10-14 14:18     ` Jonathan Nieder
2013-10-14 21:21       ` Felipe Contreras
2013-10-12  7:07 ` [PATCH 04/20] fetch: add missing documentation Felipe Contreras
2013-10-12  7:07 ` [PATCH 09/20] sha1-name: trivial style cleanup Felipe Contreras
2013-10-12  7:07 ` [PATCH 14/20] describe: trivial style fixes Felipe Contreras

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=52591180.3010103@googlemail.com \
    --to=stefanbeller@googlemail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.