Re: [PATCH v5 4/4] pretty: test --expand-tabs

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

 



On Mon, Apr 4, 2016 at 8:58 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> The test prepares a simple commit with HT on its log message lines,
> and makes sure that
>
>  - formats that should or should not expand tabs by default do or do
>    not expand tabs respectively,
>
>  - with explicit --expand-tabs=<N> and short-hands --expand-tabs
>    (equivalent to --expand-tabs=8) and --no-expand-tabs (equivalent
>    to --expand-tabs=0) before or after the explicit --pretty=$fmt,
>    the tabs are expanded (or not expanded) accordingly.
>
> The tests use the second line of the log message for formats other
> than --pretty=short, primarily because the first line of the email
> format is handled specially to add the [PATCH] prefix, etc. in a
> separate codepath (--pretty=short uses the first line because there
> is no other line to test).
>
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
> ---
> diff --git a/t/t4213-log-tabexpand.sh b/t/t4213-log-tabexpand.sh
> @@ -0,0 +1,98 @@
> +count_expand ()
> +{
> +       case " $* " in
> +       *' --pretty=short '*)
> +               line=$title ;;
> +       *)
> +               line=$body ;;
> +       esac
> +       expect=
> +       count=$(( $1 + $2 )) ;# expected spaces
> +       while test $count -gt 0
> +       do
> +               expect="$expect "
> +               count=$(( $count - 1 ))
> +       done
> +       shift 2
> +       count=$1 ;# expected tabs

Why semicolon before the hash here and above?
--
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]