Joel E. Denny wrote: > On Tue, 4 Aug 2009, Jim Meyering wrote: > >> Thanks for all of that. >> I've pushed that as well as your other three change sets, >> and one more change: > > Thanks. Unfortunately, my email client ate the \r\n sequences in the DOS > EOL test. Sorry about that. The attached patch adds them back. > > From f7aecbdf27eea1a0a6eb0960dbb34627ff56ccb6 Mon Sep 17 00:00:00 2001 > From: Joel E. Denny <jde...@clemson.edu> > Date: Tue, 4 Aug 2009 09:37:54 -0400 > Subject: [PATCH] update-copyright-tests: correctly test EOL=\r\n handling > > * tests/test-update-copyright.sh: Add back the \r on each line, > and add a comment saying it shouldn't be removed.
Thanks, but I couldn't easily apply that, using git-am: $ git am j Applying: update-copyright-tests: correctly test EOL=\r\n handling /gnulib/.git/rebase-apply/patch:31: trailing whitespace. Rem \r\n on each line is intentional; don't change--> /gnulib/.git/rebase-apply/patch:32: trailing whitespace. Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, /gnulib/.git/rebase-apply/patch:33: trailing whitespace. Rem 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, /gnulib/.git/rebase-apply/patch:34: trailing whitespace. Rem 2009 Free Software Foundation, Inc. /gnulib/.git/rebase-apply/patch:44: trailing whitespace. Rem \r\n on each line is intentional; don't change--> warning: squelched 3 whitespace errors warning: 8 lines add whitespace errors. and besides, mixing line endings in version-controlled files is not sustainable, since some editors tend to correct such anomalies. So how about this instead? [BTW, it'd be good to use a "compare" function as defined in test-vc-list-files-cvs.sh, in case diff is not available or does not honor the -u option. ] >From 42a9048038cf861b4966da0b0c8d74a0dbeae568 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Tue, 4 Aug 2009 16:12:21 +0200 Subject: [PATCH] update-copyright-tests: correctly test EOL=\r\n handling * tests/test-update-copyright.sh: Put \r at the end of some lines for the dos-eol tests. Based on a patch by Joel E. Denny. --- ChangeLog | 6 ++++++ tests/test-update-copyright.sh | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba72930..f0d30a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-04 Jim Meyering <meyer...@redhat.com> + + update-copyright-tests: correctly test EOL=\r\n handling + * tests/test-update-copyright.sh: Put \r at the end of some lines + for the dos-eol tests. Based on a patch by Joel E. Denny. + 2009-08-04 Joel E. Denny <jde...@clemson.edu> update-copyright-tests: correctly test EOL=\r\n handling diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh index 4abc6f1..8584b3d 100755 --- a/tests/test-update-copyright.sh +++ b/tests/test-update-copyright.sh @@ -290,22 +290,23 @@ rm $TMP* ## --------- ## TMP=$TMP_BASE-dos-eol -cat > $TMP <<EOF -Rem \r\n on each line is intentional; don't change--> -Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, -Rem 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +tr @ '\r' > $TMP <<EOF +Rem \r\n on each line is intentional; don't change-->@ +Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@ +Rem 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@ Rem 2009 Free Software Foundation, Inc. EOF UPDATE_COPYRIGHT_YEAR=2010 \ update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr diff -u /dev/null $TMP-stdout || exit 1 diff -u /dev/null $TMP-stderr || exit 1 -diff -u - $TMP <<EOF || exit 1 -Rem \r\n on each line is intentional; don't change--> -Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98, -Rem 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -Rem 2009-2010 Free Software Foundation, Inc. +tr @ '\r' > $TMP-exp <<EOF +Rem \r\n on each line is intentional; don't change-->@ +Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98,@ +Rem 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@ +Rem 2009-2010 Free Software Foundation, Inc.@ EOF +diff -u $TMP-exp $TMP || exit 1 rm $TMP* exit 0 -- 1.6.4.70.g9c084