git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alex Henrie <alexhenrie24@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git mailing list <git@vger.kernel.org>,
	prohaska@zib.de, eyvind.bernhardsen@gmail.com
Subject: Re: [PATCH] convert: clarify line ending conversion warning
Date: Mon, 4 Apr 2022 11:21:24 -0600	[thread overview]
Message-ID: <CAMMLpeQUZ3OfP=G-qKRjUVON=hninYEDQeeCrAdfM9maAZ3j7Q@mail.gmail.com> (raw)
In-Reply-To: <xmqqtub8rdrw.fsf@gitster.g>

On Mon, Apr 4, 2022 at 10:53 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Alex Henrie <alexhenrie24@gmail.com> writes:
>
> > Rephrase the warning to be clear that line endings have not been changed
> > in the working directory but will be changed on the next checkout, and
> > explicitly say which line endings the file currently has in the working
> > directory.
> >
> > Example commands to trigger the warning on Linux:
> >
> > git config core.autocrlf true
> > echo 'Hello world!' > hello.txt
> > git add hello.txt
> > git commit -m "Add hello.txt"
>
> While the "example" does not hurt, because the log message is not
> executable, it would not help to its potential unless you add its
> expected output to go with it.
>
>     On a platform whose native line endings are not CRLF
>     (e.g. Linux), the "git add" step in the sequence triggers the
>     waring 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
>
> or something like that.
>
> I think the recent trend is to enclose end-user supplied strings
> (like misspelt option names, arguments to options, and pathnames)
> inside single quote, so
>
>     warning: LF will be replaced by CRLF in 'hello.txt'.
>
> would probably be a good idea, on top of what you are aiming for.
> Also, in a multi-sentence warning message like this, I do not think
> it makes sense to omit the end-of-sentence full-stop.

Sure. I'll do all of that in the v2.

> I have mixed feelings with this change, even though I agree that the
> original is not good.  The first sentence of the updated text
> already says that right now, the file ends with CRLF, and that the
> conversion happen the next time you check out the file to the
> working tree.  And that makes "For now ... still" totally redundant.
>
> Perhaps a single sentence, nothing more than
>
>         warning: in '%s', CRLF will be replaced by LF the next time
>         you check it out
>
> is sufficient?  I dunno.

I like your idea to move the file name to the start of the message,
and I think that will address Ævar's concern as well.

It doesn't matter to me whether the message is one sentence or two
sentences. If you have a slight preference for one sentence then let's
just do that.

Thanks for the feedback!

-Alex

  reply	other threads:[~2022-04-04 21:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04  5:51 [PATCH] convert: clarify line ending conversion warning Alex Henrie
2022-04-04  6:06 ` Ævar Arnfjörð Bjarmason
2022-04-04 15:22 ` Tao Klerks
2022-04-04 17:23   ` Alex Henrie
2022-04-05  4:03     ` Tao Klerks
2022-04-04 16:53 ` Junio C Hamano
2022-04-04 17:21   ` Alex Henrie [this message]
2022-04-04 19:37     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMMLpeQUZ3OfP=G-qKRjUVON=hninYEDQeeCrAdfM9maAZ3j7Q@mail.gmail.com' \
    --to=alexhenrie24@gmail.com \
    --cc=eyvind.bernhardsen@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=prohaska@zib.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).