Re: [RFC/PATCH] status: introduce status.displayCommentChar to disable display of #

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

 



Am 8/28/2013 10:32, schrieb Matthieu Moy:
> Historically, "git status" needed to prefix each output line with '#' so
> that the output could be added as comment to the commit message. This
> prefix comment has no real purpose when "git status" is ran from the
> command-line, and this may distract users from the real content.
> 
> Allow the user to disable this prefix comment. In the long run, if users
> like the non-prefix output, it may make sense to flip the default value
> to true.
> 
> Obviously, status.displayCommentChar applies to "git status" but is
> ignored by "git commit", so the status is still commented in
> COMMIT_EDITMSG.
> 
> Signed-off-by: Matthieu Moy <Matthieu.Moy@xxxxxxx>
> ---
> As a beginner (long ago), I found this comment-prefixed output really
> weird. I got used to it,...

You have my sympathy.

How does your solution work when dirty submodules are involved and
submodule status is included?

> +test_expect_success 'status with status.displayCommentChar=false' '
> +	"$PERL_PATH" -pi -e "s/^\# //; s/^\#$//; s/^#\t/\t/" expect &&

Perl's -i does not work on Windows when no backup file extension is given.
Therefore, please use a temporary file or "... -pi.bak ..."

> +	git -c status.displayCommentChar=false status >output &&
> +	test_i18ncmp expect output
> +'

-- Hannes
--
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]