Re: [PATCH v3] difftool: Change prompt to display the number of files in the diff queue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 06, 2013 at 10:38:46AM +1100, Zoltan Klinger wrote:

> @@ -2928,7 +2933,14 @@ static void run_external_diff(const char *pgm,
>  	}
>  	*arg = NULL;
>  	fflush(NULL);
> -	retval = run_command_v_opt(spawn_arg, RUN_USING_SHELL);
> +
> +	env[0] = env_counter;
> +	snprintf(env_counter, sizeof(env_counter), "GIT_DIFF_PATH_COUNTER=%d",
> +			++o->diff_path_counter);

I don't think we have a particular rule, but our usual style is to line
up the continued line of arguments with the open-paren of the function,
like:

  foo(arg1, arg2,
      arg3, arg4);

> @@ -3317,6 +3329,8 @@ void diff_setup_done(struct diff_options *options)
>  		options->output_format = DIFF_FORMAT_NO_OUTPUT;
>  		DIFF_OPT_SET(options, EXIT_WITH_STATUS);
>  	}
> +
> +    options->diff_path_counter = 0;

It's hard to see with the email quoting, but this is a 4-space indent
rather than the usual 1-tab (which should be 8-wide on the terminals of
all True Believers).


Both are minor, but worth fixing IMHO (especially the second one). Looks
like it's too late for squashing, so here's a patch that can go on top
(doing it now is still of value, though, as it's less likely to create
conflicts since nobody is building on top yet).

-- >8 --
Subject: diff.c: fix some recent whitespace style violations

These were introduced by ee7fb0b.

Signed-off-by: Jeff King <peff@xxxxxxxx>
---
On top of zk/difftool-counts.

 diff.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/diff.c b/diff.c
index a7d5a47..d69cc1b 100644
--- a/diff.c
+++ b/diff.c
@@ -2936,7 +2936,7 @@ static void run_external_diff(const char *pgm,
 
 	env[0] = env_counter;
 	snprintf(env_counter, sizeof(env_counter), "GIT_DIFF_PATH_COUNTER=%d",
-			++o->diff_path_counter);
+		 ++o->diff_path_counter);
 	env[1] = env_total;
 	snprintf(env_total, sizeof(env_total), "GIT_DIFF_PATH_TOTAL=%d", q->nr);
 
@@ -3330,7 +3330,7 @@ void diff_setup_done(struct diff_options *options)
 		DIFF_OPT_SET(options, EXIT_WITH_STATUS);
 	}
 
-    options->diff_path_counter = 0;
+	options->diff_path_counter = 0;
 }
 
 static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)
-- 
1.8.5.1.399.g900e7cd

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]