Re: [PATCH v2] difftool: Change prompt to display the number of files in the diff queue
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 4, 2013, 20:18 UTC
- Message-ID
- <xmqq61r4l69h.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAPig+cTUB=UbY-j8mtz6QsvJKoA2T41u-wiR7Di596pM3t+k=Q@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 7 quoted lines
>> + setenv ("GIT_DIFF_PATH_COUNTER", counterstr.buf, 1);
>> + setenv ("GIT_DIFF_PATH_TOTAL", totalstr.buf, 1);
>> +
>> retval = run_command_v_opt(spawn_arg, RUN_USING_SHELL);
>
> Would run_command_v_opt_cd_env() be more appropriate than setenv() +
> run_command_v_opt() done here?Probably (besides, SPs after 'setenv' need to go).
Also, we know total/conter is a decimal integer. On-stack 32-byte arrays are sufficient and two strbufs are overkill ;-)
Show 15 quoted lines
>> diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh >> index 8a30979..4935fc4 100755 >> --- a/t/t4020-diff-external.sh >> +++ b/t/t4020-diff-external.sh >> @@ -193,6 +193,22 @@ test_expect_success 'GIT_EXTERNAL_DIFF with more than one changed files' ' >> GIT_EXTERNAL_DIFF=echo git diff >> ' >> >> +echo "#!$SHELL_PATH" >external-diff.sh >> +cat >> external-diff.sh <<\EOF >> +echo $GIT_DIFF_PATH_COUNTER of $GIT_DIFF_PATH_TOTAL >>counter.txt >> +EOF >> +chmod a+x external-diff.sh > > Perhaps write_script()?
Definitely.
Thanks, both.