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

Re: [PATCH 16/20] revision: trivial style fixes

From
Stefan Beller <stefanbeller@googlemail.com>
Date
Oct 12, 2013, 09:08 UTC
Message-ID
<52591180.3010103@googlemail.com>
In-Reply-To
<1381561636-20717-10-git-send-email-felipe.contreras@gmail.com>
On 10/12/2013 09:07 AM, Felipe Contreras wrote:
Show 64 quoted lines
> 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

Previous: Felipe ContrerasNext: Felipe Contreras
Message 11 of 26 in “doc: git-foo was obsoleted several years ago”
  1. 10/20 doc: git-foo was obsoleted several years agoFelipe Contreras, Oct 12, 2013
  2. 00/20 Trivial pachesFelipe Contreras, Oct 12, 2013
  3. 03/20 pull: cleanup documentationFelipe Contreras, Oct 12, 2013
  4. 20/20 add: avoid yoda conditionsFelipe Contreras, Oct 12, 2013
  5. 08/20 branch: trivial style fixFelipe Contreras, Oct 12, 2013
  6. 15/20 pretty: trivial style fixFelipe Contreras, Oct 12, 2013
  7. 19/20 setup: trivial style fixesFelipe Contreras, Oct 12, 2013
  8. 13/20 transport-helper: trivial style fixFelipe Contreras, Oct 12, 2013
  9. 01/20 merge: simplify ff-only optionFelipe Contreras, Oct 12, 2013
  10. 16/20 revision: trivial style fixesFelipe Contreras, Oct 12, 2013
  11. Stefan BellerOct 12, 2013
  12. Felipe ContrerasOct 12, 2013
  13. 17/20 diff: trivial style fixFelipe Contreras, Oct 12, 2013
  14. 05/20 remote: fix trivial memory leakFelipe Contreras, Oct 12, 2013
  15. 07/20 shortlog: add missing declarationFelipe Contreras, Oct 12, 2013
  16. 11/20 symbolic-ref: trivial style fixFelipe Contreras, Oct 12, 2013
  17. 06/20 revision: add missing includeFelipe Contreras, Oct 12, 2013
  18. 18/20 run-command: trivial style fixesFelipe Contreras, Oct 12, 2013
  19. 02/20 t: replace pulls with mergesFelipe Contreras, Oct 12, 2013
  20. 12/20 alias: trivial style fixFelipe Contreras, Oct 12, 2013
  21. Stefan BellerOct 12, 2013
  22. Jonathan NiederOct 14, 2013
  23. Felipe ContrerasOct 14, 2013
  24. 04/20 fetch: add missing documentationFelipe Contreras, Oct 12, 2013
  25. 09/20 sha1-name: trivial style cleanupFelipe Contreras, Oct 12, 2013
  26. 14/20 describe: trivial style fixesFelipe Contreras, Oct 12, 2013

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.