Re: [PATCH v2] convert: clarify line ending conversion warning

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

 



On Mon, Apr 04, 2022 at 11:35:59PM -0600, Alex Henrie wrote:
> The warning about converting line endings is extremely confusing. Its
> two sentences each use the word "will" without specifying a timeframe,
> which makes it sound like both sentences are referring to the same
> timeframe. On top of that, it uses the term "original line endings"
> without saying whether "original" means LF or CRLF.
>
> Rephrase the warning to be clear about when the line endings will be
> changed and what they will be changed to.
>
> On a platform whose native line endings are not CRLF (e.g. Linux), the
> "git add" step in the following sequence triggers the warning in
> question:
>
> $ git config core.autocrlf true
> $ echo 'Hello world!' >hello.txt
> $ git add hello.txt
> warning: LF will be replaced by CRLF in hello.txt
> The file will have its original line endings in your working directory
>
> Signed-off-by: Alex Henrie <alexhenrie24@xxxxxxxxx>
> ---
> v2:
> - Quote the confusing warning in the above commit message
> - Move the file name to the beginning of the warning message
> - Put the file name in single quotes
> - Use the arguably broader verb "touch" instead of "check out"
> - Remove the period at the end of the sentence
> - Remove the second sentence entirely
> ---
>  convert.c            | 10 ++++------
>  t/t0027-auto-crlf.sh |  8 ++++----
>  2 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/convert.c b/convert.c
> index 8e39731efb..733e581cb9 100644
> --- a/convert.c
> +++ b/convert.c
> @@ -195,9 +195,8 @@ static void check_global_conv_flags_eol(const char *path,
>  		if (conv_flags & CONV_EOL_RNDTRP_DIE)
>  			die(_("CRLF would be replaced by LF in %s"), path);
>  		else if (conv_flags & CONV_EOL_RNDTRP_WARN)
> -			warning(_("CRLF will be replaced by LF in %s.\n"
> -				  "The file will have its original line"
> -				  " endings in your working directory"), path);
> +			warning(_("In '%s', CRLF will be replaced by LF the"
> +				  " next time Git touches it"), path);

(Somewhat late to the discussions), thanks for picking this up.
May be we can use "updates" instead of "touches" ?

"In '%s', CRLF will be replaced by LF the next time Git updates it"

Or may be

"In '%s', CRLF will be replaced by LF the next time a `git checkout` updates it"


[snip]




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

  Powered by Linux