git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 0/5] Abide by our own rules regarding line endings
Date: Wed, 3 May 2017 16:23:15 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1705031323390.3480@virtualbox> (raw)
In-Reply-To: <20170502215627.GX28740@aiede.svl.corp.google.com>

Hi Jonathan,

On Tue, 2 May 2017, Jonathan Nieder wrote:

> Johannes Schindelin wrote:
> 
> > Over the past decade, there have been a couple of attempts to remedy the
> [...]
> 
> I'm intentionally skimming this cover letter, since anything important
> it says needs to also be in the commit messages.

Sure, makes sense. I tried to do that, too, before sending out my patch
series.

> [...]
> > Without these fixes, Git will fail to build and pass the test suite, as
> > can be verified even on Linux using this cadence:
> >
> > 	git config core.autocrlf true
> > 	rm .git/index && git stash
> > 	make DEVELOPER=1 -j15 test
> 
> This should go in a commit message (or perhaps in all of them).

Hmm, okay. I wanted to keep it out of them, as commit messages are (in my
mind) more about the why?, and a little less about the how? when not
obvious from the diff.

I added a variation to the first patch (because the tests would still
fail, I skipped the `test` from the `make` invocation) and the unmodified
cadence to the "Fix the remaining tests..." patch.

> [...]
> > Johannes Schindelin (5):
> >   Fix build with core.autocrlf=true
> >   git-new-workdir: mark script as LF-only
> >   completion: mark bash script as LF-only
> >   Fix the remaining tests that failed with core.autocrlf=true
> >   t4051: mark supporting files as requiring LF-only line endings
> 
> With or without that change,
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks.

I added that footer to the patches (not to the two new ones, though).

> The t/README bit in patch 4/5 is sad (I want to be able to open
> t/README using an old version of Notepad) but changing that test to
> use another file seems out of scope for what this series does.

Yes, it is sad. Maybe I should list the tests that do this (use files
outside any tNNNN/ directory):

t4003-diff-rename-1.sh (uses t/diff-lib/COPYING)
t4005-diff-rename-2.sh (uses t/diff-lib/COPYING)
t4007-rename-3.sh (uses t/diff-lib/COPYING)
t4008-diff-break-rewrite.sh (uses t/diff-lib/README and t/diff-lib/COPYING)
t4009-diff-rename-4.sh (uses t/diff-lib/COPYING)
t4022-diff-rewrite.sh (uses COPYING)
t4023-diff-rename-typechange.sh (uses COPYING)
t7001-mv.sh (uses README.md (!!!) and COPYING)
t7060-wtstatus.sh (uses t/README)
t7101-reset-empty-subdirs.sh (uses COPYING)

Note most of these tests may *use* those files, but do *not* assume that
they have Unix line endings! Only a couple test compare SHA-1s to
hardcoded values (which, if you ask me, is a bit fragile, given that files
outside the tests' control are used).

Interesting side note: t0022-crlf-rename.sh copies *itself* to the trash*
directory where it is then used to perform tests. So while this test uses
"an outside file", that file happens to be a .sh file which we already
have to mark LF-only for different reasons (Bash likes its input
CR/LF-free).

Another interesting side note: the convention appears to dictate that
supporting files should be either generated in the test script itself, or
be committed into t/tNNNN/ directories (where NNNN matches the respective
test script's number, or reuses another test script's supporting files). A
notable exception is t3901 which has the supporting files t3901-8859-1.txt
and t3901-utf8.txt. I would wageer that this is just a remnant of ancient
times before the current convention, judging by the date of the commit
that added these files: a731ec5eb82 (t3901: test "format-patch | am" pipe
with i18n, 2007-01-13). The scripts t0203-gettext-setlocale-sanity.sh,
t9350-fast-export.sh and t9500-gitweb-standalone-no-errors.sh merely reuse
those files, and when those scripts started using those files, they did
not change their location. I made this move a preparatory step in this
patch series.

Back to the question what to do about those tests that make improper
assumptions about line endings of files outside the tests' realm: I think
I can do this more cleverly, as it would appear that only four test
scripts make hard assumptions about the exact byte sequence of the COPYING
file, and I simply turned those `cp` (and even `cat`!) calls into `tr -d
"\015"` calls.

I will Cc: you on v2.

Ciao,
Dscho

  reply	other threads:[~2017-05-03 14:23 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 12:29 [PATCH 0/5] Abide by our own rules regarding line endings Johannes Schindelin
2017-05-02 12:30 ` [PATCH 1/5] Fix build with core.autocrlf=true Johannes Schindelin
2017-05-02 12:30 ` [PATCH 2/5] git-new-workdir: mark script as LF-only Johannes Schindelin
2017-05-02 12:30 ` [PATCH 3/5] completion: mark bash " Johannes Schindelin
2017-05-02 12:30 ` [PATCH 4/5] Fix the remaining tests that failed with core.autocrlf=true Johannes Schindelin
2017-05-02 12:30 ` [PATCH 5/5] t4051: mark supporting files as requiring LF-only line endings Johannes Schindelin
2017-05-02 21:56 ` [PATCH 0/5] Abide by our own rules regarding " Jonathan Nieder
2017-05-03 14:23   ` Johannes Schindelin [this message]
2017-05-04  5:19 ` Junio C Hamano
2017-05-04  9:47   ` Johannes Schindelin
2017-05-04 15:04     ` Junio C Hamano
2017-05-04 18:48       ` Johannes Schindelin
2017-05-07  5:29         ` Junio C Hamano
2017-05-08 10:49           ` Johannes Schindelin
2017-05-04  9:49 ` [PATCH v2 0/7] " Johannes Schindelin
2017-05-04  9:49   ` [PATCH v2 1/7] Fix build with core.autocrlf=true Johannes Schindelin
2017-05-08  5:08     ` Junio C Hamano
2017-05-04  9:49   ` [PATCH v2 2/7] git-new-workdir: mark script as LF-only Johannes Schindelin
2017-05-08  5:11     ` Junio C Hamano
2017-05-04  9:49   ` [PATCH v2 3/7] completion: mark bash " Johannes Schindelin
2017-05-04  9:49   ` [PATCH v2 4/7] t3901: move supporting files into t/t3901/ Johannes Schindelin
2017-05-08  5:12     ` Junio C Hamano
2017-05-04  9:50   ` [PATCH v2 5/7] t4003, t4005, t4007 & t4008: handle CR/LF in t/README & t/diff-lib/README Johannes Schindelin
2017-05-08  5:14     ` Junio C Hamano
2017-05-04  9:50   ` [PATCH v2 6/7] Fix the remaining tests that failed with core.autocrlf=true Johannes Schindelin
2017-05-08  5:22     ` Junio C Hamano
2017-05-04  9:50   ` [PATCH v2 7/7] t4051: mark supporting files as requiring LF-only line endings Johannes Schindelin
2017-05-08  5:29     ` Junio C Hamano
2017-05-09 11:20       ` Johannes Schindelin
2017-05-09 12:53   ` [PATCH v3 0/6] Abide by our own rules regarding " Johannes Schindelin
2017-05-09 12:53     ` [PATCH v3 1/6] Fix build with core.autocrlf=true Johannes Schindelin
2017-05-22 17:57       ` Jonathan Nieder
2017-05-23  3:35         ` Junio C Hamano
2017-05-23  9:01           ` Johannes Schindelin
2017-05-09 12:53     ` [PATCH v3 2/6] git-new-workdir: mark script as LF-only Johannes Schindelin
2017-05-09 12:54     ` [PATCH v3 3/6] completion: mark bash " Johannes Schindelin
2017-05-09 12:54     ` [PATCH v3 4/6] t3901: move supporting files into t/t3901/ Johannes Schindelin
2017-05-09 12:54     ` [PATCH v3 5/6] Fix the remaining tests that failed with core.autocrlf=true Johannes Schindelin
2017-05-09 12:54     ` [PATCH v3 6/6] t4051: mark supporting files as requiring LF-only line endings Johannes Schindelin

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=alpine.DEB.2.20.1705031323390.3480@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    /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).