913 Commits

Author SHA1 Message Date
Jim Meyering
3c19ca08b1 diff: fix a typo that was always disabling the same_special_file macro
* src/system.h (same_special_file): Correct cpp guard expression:
s/HAVE_ST_RDEV/HAVE_STRUCT_STAT_ST_RDEV/.  Reported by Eli Zaretskii.
2012-05-05 15:53:20 +02:00
Jim Meyering
6cb7786fd8 maint: update bootstrap from gnulib
* bootstrap: Update from gnulib.
2012-04-17 11:46:28 +02:00
Eric Blake
2f108d7405 usage: improve wording of --ignore-matching-lines
* src/diff.c (option_help_msgid): Tweak wording.
2012-03-07 09:13:10 -07:00
Paul Eggert
c7560370da doc: explain -I RE better in --help output
* src/diff.c, src/sdiff.c (option_help_msgid): For -I RE,
change "whose lines all match" to "all whose lines match" to avoid
unintended interpretation.  Reported by Danijel Tasov in
<http://bugs.debian.org/648411>.
2012-03-04 13:21:50 -08:00
Paul Eggert
b2892140d8 sdiff: remove dependency on sigprocmask
* bootstrap.conf (gnulib_modules): Remove sigprocmask.
* src/sdiff.c (temporary_file): No need to invoke sigprocmask
here, since the signal handler merely sets a flag.
2012-02-12 13:08:50 -08:00
Paul Eggert
7f2f4bb365 diff: -N, --unidirectional-new-file now compare to "-" too
* NEWS: Document this.
* doc/diffutils.texi (Comparing Directories): Likewise.
Also, document that these options work at the top level.
* src/diff.c (compare_files): Treat EBADF like ENOENT, to handle
the case where "-" is closed.  Allow the other file to be
STDIN_FILENO, in case it's "-".
* tests/Makefile.am (TESTS): Add new-file.
* tests/new-file: New file.
2012-02-04 22:13:48 -08:00
Paul Eggert
62ca21c8c1 maint: quote 'like this' or "like this", not `like this'
This is in response to a recent change in the GNU coding standards,
which now suggest quoting 'like this' or "like this", instead of
`like this' or ``like this''.
* HACKING, NEWS, README, README-hacking, TODO, doc/diagmeet.note:
* doc/diffutils.texi, ms/config.bat, ms/config.site:
* src/analyze.c, src/cmp.c, src/context.c, src/diff.c:
* src/diff.h, src/diff3.c, src/dir.c, src/ifdef.c, src/io.c:
* src/sdiff.c, src/side.c, src/system.h, src/util.c:
* tests/help-version:
Quote 'like this' or "like this" in commentary.
* cfg.mk (old_NEWS_hash): Adjust to reflect new NEWS quoting.
* man/help2man: Update to 1.40.4 version, with quoting fixed as above.
* po/en.po: Remove translation involving `, as it's no longer needed.
* src/cmp.c (try_help, specify_ignore_initial, usage, main):
* src/diff.c (main, try_help, option_help_msgid, specify_value)
(compare_files):
* src/diff3.c (main, try_help, option_help_msgid, usage)
(read_diff):
* src/dir.c (compare_names):
* src/sdiff.c (try_help, usage, check_child_status, main):
* src/util.c (finish_output):
* tests/help-version:
Quote 'like this' in output.
2012-01-25 23:54:38 -08:00
Paul Eggert
70eafb8038 build: update gnulib submodule to latest 2012-01-25 23:54:37 -08:00
Jim Meyering
301a23cdbb build: accommodate newer bootstrap from gnulib
* bootstrap.conf (gnulib_tool_option_extras): Add both --symlink
and --makefile-name=gnulib.mk.  Also remove now-obsolete $bt/ prefix.
* bootstrap: Update from gnulib.
* tests/init.sh: Update from gnulib.
* lib/Makefile.am: Initialize numerous variables, so that
generated code in gnulib.mk may use += to append to them.
2012-01-12 14:04:44 +01:00
Jim Meyering
6e51ccfb4e maint: avoid new syntax-check failure
* src/diff.c (compare_files): Use STREQ, not strcmp.
2012-01-12 14:04:44 +01:00
Bruno Haible
e3324651cc New option --no-dereference.
* src/diff.h (no_dereference_symlinks): New variable.
* src/diff.c: Include xreadlink.h.
(longopts): Add --no-dereference option.
(main): Accept --no-dereference option.
(option_help_msgid): Mention the --no-dereference option.
(compare_files): If no_dereference_symlinks is true, use lstat()
instead of stat(). Compare symbolic links by comparing their values.
* bootstrap.conf (gnulib_modules): Add lstat, stat, xreadlink.
* doc/diffutils.texi (Comparing Directories, diff Options): Mention the
--no-dereference option.
* tests/no-dereference: New file.
* tests/Makefile.am (TESTS): Add it.
2012-01-08 21:26:27 +01:00
Jim Meyering
45110a7927 maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 09:32:41 +01:00
Jim Meyering
c88c3b6b2a build: update to latest gnulib and adapt
* tests/binary: Reverse arguments to compare to avoid failure of
new syntax-check rule.
* configure.ac: Use -Wno-format-nonliteral.
Mark functions as pure of const, per recommendations enabled by
new gcc -W options.  Use _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST.
* lib/cmpbuf.h (buffer_lcm, block_compare):
Apply pure and/or const attributes.
* src/cmp.c (block_compare): Likewise.
* src/context.c (find_hunk): Likewise.
* src/diff.h (lines_differ): Likewise.
* src/diff3.c (skipwhite): Likewise.
* src/dir.c (dir_loop): Likewise.
* src/util.c (find_change, find_reverse_change): Likewise.
(translate_line_number): Likewise.
2011-12-14 15:07:57 +01:00
Jim Meyering
439286a937 build: stop distributing gzip'd releases; xz is enough
* configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip.
2011-12-14 14:27:28 +01:00
Jim Meyering
31b43733d4 tests: use "compare exp out", not "compare out exp"
Likewise, when an empty file is expected, use "compare /dev/null out",
not "compare out /dev/null". I.e., specify the expected/desired contents
via the first file name.  Prompted by a suggestion from Bruno Haible
in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154

Run these commands:

  git grep -l -E 'compare [^ ]+ exp' \
    |xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/'
  git grep -l -E 'compare [^ ]+ /dev/null' \
    |xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,'

But manually convert this one:

  -compare out exp-$(echo $opt|tr ' ' _)
  +compare exp-$(echo $opt|tr ' ' _) out

and avoid an inappropriate change to cfg.mk.
2011-11-29 17:17:10 +01:00
Stefano Lattarini
5e2baecb26 tests: use more portable fd redirection in TESTS_ENVIRONMENT
* tests/Makefile.am (TESTS_ENVIRONMENT): Redirection with `exec 9>&2'
is not portable to various Korn shells, and to (at least) HP-UX 11
/bin/sh.  Use a more portable idiom.
See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488 for
lots of discussion.
2011-10-12 19:46:13 +02:00
Stefano Lattarini
366adeb73d tests: make test runner a script, not a shell function
All the test scripts in the diffutils testsuite are shell scripts,
so the current definition of TESTS_ENVIRONMENT, which adaptively
run tests using either perl or the shell depending on their kind,
is an overkill.

Moreover, this change is required in order for the testsuite to
continue to work with the new testsuite harness that is planned
to be introduced in Automake 1.12 (which, as of the writing date,
is still under development and in late alpha state).

See also related discussion on bug-coreutils:
 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8887>

* tests/Makefile.am (TESTS_ENVIRONMENT): Remove definition of the
`shell_or_perl_' shell function, which is not required anymore.
(LOG_COMPILER): New, define to `$(SHELL)'.
* tests/binary: Make executable.
* tests/colliding-file-names: Likewise.
* tests/excess-slash: Likewise.
* tests/no-newline-at-eof: Likewise.
2011-10-11 16:40:12 +02:00
Claudio Bley
7508234eab portability: use SET_BINARY rather than xfreopen (NULL, ...
* src/diff.c: Include binary-io.h, not xfreopen.h.
(main): Use SET_BINARY (...) rather than xfreopen (NULL, X, ...),
because the latter doesn't work on MinGW and crashes using MSVC.
* src/cmp.c (main): Likewise.
2011-10-04 13:55:49 +02:00
Jim Meyering
11ef88af92 build: update gnulib submodule to latest 2011-10-04 13:40:21 +02:00
Jim Meyering
57a09576e8 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2011-09-02 17:21:07 +02:00
Jim Meyering
8f14bb9095 version 3.2
* NEWS: Record release date.
v3.2
2011-09-02 17:18:34 +02:00
Jim Meyering
e2ed9d279b build: update bootstrap and tests/init.sh from gnulib
* bootstrap: Update from gnulib.
* tests/init.sh: Likewise.
2011-09-02 14:16:04 +02:00
Jim Meyering
783eca9655 build: update gnulib submodule to latest 2011-09-02 14:10:10 +02:00
Jim Meyering
77bcc326cc doc: diffutils' texi-derived doc may now be in debian's "main" section
* NEWS (Packaging): Mention the "no front/back-cover" change.
2011-09-02 00:36:16 +02:00
Jim Meyering
320355d6d4 maint: avoid new "make sytnax-check" failure.
* src/diff.h (find_dir_file_pathname): Mark declaration with "extern"
keyword, in order to placate the tight-scope syntax check.
2011-08-15 07:27:14 +02:00
Paul Eggert
8739d45f72 * src/io.c (find_and_hash_each_line): Refactor for brevity. 2011-08-14 22:09:22 -07:00
Roland McGrath
86a40dd6ac diff, sdiff: new option --ignore-trailing-space (-Z)
Derived from Roland McGrath's patch (dated June 2004!) in:
http://lists.gnu.org/archive/html/bug-gnu-utils/2004-07/msg00000.html
* NEWS:
* doc/diffutils.texi (White Space, Blank Lines)
(sdiff Option Summary, diff Options, sdiff Options): Document -Z.
* src/diff.h (IGNORE_TRAILING_SPACE)
(IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE): New constants, for -Z.
* src/diff.c (shortopts, longopts, main, option_help_msgid):
* src/sdiff.c (longopts, option_help_msgid, main):
* src/io.c (find_and_hash_each_line):
* src/util.c (lines_differ, analyze_hunk): Support -Z.
2011-08-14 22:09:21 -07:00
Paul Eggert
efb0557f4c * bootstrap.conf (gnulib_modules): Remove timegm.
This fixes a problem noted by Andreas Schwab in:
http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00035.html
2011-08-13 15:12:35 -07:00
Tim Waugh
70febebfe5 diff: --ignore-file-name-case now applies at top level too
Derived from Tim Waugh's patch in:
http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00034.html
* NEWS, doc/diffutils.texi (diff Options): Document this.
* src/diff.c (compare_files): Implement this, by using
find_dir_file_pathname.
* src/diff.h (find_dir_file_pathname): New decl.
* src/dir.c: Include filenamecat.h.
(find_dir_file_pathname): New function.
2011-08-13 13:17:40 -07:00
Paul Eggert
e3001b775a * .gitignore: Add lib/unistr, lib/unused-parameter.h. 2011-08-13 13:17:40 -07:00
Jim Meyering
1e340def24 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2011-08-10 12:38:04 +02:00
Jim Meyering
78524ae4ba version 3.1
* NEWS: Record release date.
v3.1
2011-08-10 12:33:36 +02:00
Jim Meyering
3edb801c06 build: use largefile module and update to latest gnulib
* configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
* bootstrap.conf (gnulib_modules): ...this.  Use largefile module.
* gnulib: Update to latest.
2011-08-10 10:21:14 +02:00
Santiago Vila
8832cf045d doc: insert comma in --help line for --ignore-space-change (-b)
* src/diff.c (option_help_msgid): Insert omitted comma between
"-b" and "--ignore-space-change".  (tiny change)
2011-08-08 18:00:23 +02:00
Jim Meyering
789252980f doc: relax restriction on front-cover and back-cover texts
* doc/diffutils.texi (copying): Relax restriction on front-cover
and back-cover texts (just as m4 did here:
http://git.savannah.gnu.org/cgit/m4.git/commit?id=ee1e92ec).
Reported by Santiago Vila.  Fix suggested by Eric Blake.
2011-08-04 18:59:29 +02:00
Jim Meyering
c06794dacf tests: update init.sh from gnulib
* tests/init.sh: Update from gnulib.
2011-08-03 18:07:33 +02:00
Jim Meyering
1ce0b3604b build: update gnulib submodule to latest 2011-08-03 14:22:24 +02:00
Jim Meyering
01fc077bbf maint: remove inclusion of unused header, for "make syntax-check"
* src/diff3.c: Don't include <inttostr.h>.  Not used.
* src/context.c: Likewise.
2011-07-03 22:44:26 +02:00
Jim Meyering
c8b5b09d13 build: don't require perl when building from a tarball
But do ensure -- in all other circumstances -- that the man/*.1
files are rebuilt whenever the version number changes.
* configure.ac (SRC_VERSION_C): Define.
* man/Makefile.am (dist_man1_MANS): Rename from $(man1_MANS),
so that we distribute those pesky man/*.1 files.
(EXTRA_DIST): Reflect name change.
(MAINTAINERCLEANFILES): Define this, not DISTCLEANFILES,
now that these generated files are distributed.
($(dist_man1_MANS)): Depend on $(SRC_VERSION_C), so we get the
full dependency when not building from a tarball.
2011-06-19 17:15:26 +02:00
Jim Meyering
e783a23b19 doc: do not distribute generated man/*.1 man files
* man/help2man: New file.
* man/Makefile.am: Use $(srcdir)/help2man.
Convert $(dist_man1_MANS) to $(man1_MANS), to tell automake
not to distribute the generated man/*.1 files.  Now they're
generated at build-from-tarball time.
($(man1_MANS)): Depend on version.c, so that man pages are
regenerated whenever the version string changes.
2011-06-13 09:17:49 +02:00
Jim Meyering
7faccb437c build: ccache works better without embedded version strings
* src/Makefile.am: Generate version.c and version.h and put the
new symbol in a tiny library to be used by each program.
(LDADD): Add the new library.
* src/cmp.c (main): Use Version, not PACKAGE_VERSION, so the .o
file does not change with each commit-derived version increment.
* src/diff.c (main): Likewise.
* src/diff3.c (main): Likewise.
* src/sdiff.c (main): Likewise.
* src/system.h: Include "version.h".
* .gitignore: Add version.[ch]
2011-06-13 09:17:15 +02:00
Jim Meyering
929cf56472 doc: ensure each program has a man/*.x file: add "SEE ALSO" references
* man/cmp.x: New file.
* man/diff3.x: New file.
* man/sdiff.x: New file.
* man/diff.x: Add xrefs to the other three programs, and to patch.
* man/Makefile.am (EXTRA_DIST): List new files.
(cmp.1, diff3.1, sdiff.1): Depend on each .x file.
2011-06-12 10:25:15 +02:00
Jim Meyering
df0a31f611 doc: rename diff.texi to diffutils.texi
This makes the .texi basename the same as the package name,
which is consistent with most other GNU packages.
* doc/diffutils.texi: Rename from...
* doc/diff.texi: ...removed.
* doc/Makefile.am (info_TEXINFOS): Reflect name change.
(diffutils_TEXINFOS): Likewise.
* cfg.mk (gendocs_options_): Remove this customization.  It is no
longer needed, now that the .texi name matches that of the package.
* man/Makefile.am ($(dist_man1_MANS)): Remove now-unnecessary sed
filter.
* README: Update references to diffutils.texi etc. here, too.
* .gitignore: Update here, too.
Suggested by Karl Berry.
2011-06-12 09:47:27 +02:00
Karl Berry
a2b10ab0d6 cmp, diff, diff3, sdiff: edit and align --help text.
* cmp.c (option_help_msgid, usage),
* diff.c (option_help_msgid, usage),
* diff3.c (option_help_msgid, usage),
* sdiff.c (option_help_msgid, usage): align descriptions in the --help
output and slightly edit content.
2011-06-08 15:44:52 +02:00
Paul Eggert
de65c25dc1 diff: don't use locales after local-specific sorting fails
* src/dir.c (compare_names): Don't invoke strcasecmp if
locale-specific sorting fails, because POSIX.1-2008 says strcasecmp
has unspecified behavior outside the POSIX locale.  See:
http://lists.gnu.org/archive/html/bug-diffutils/2011-05/msg00008.html
2011-05-27 23:41:07 -07:00
Paul Eggert
a3318fdbca bootstrap: Avoid multithreading.
* bootstrap.conf (gnulib_tool_option_extras):
Add "--avoid=localename --avoid=lock", because we don't want to
bring in the multithreading code that recent gnulib changes would
otherwise bring in.
(excluded_files): Remove m4/lock.m4; no longer needed, now that
we use --avoid=lock.
2011-05-27 23:41:07 -07:00
Paul Eggert
1850ea03ac build: update gnulib submodule to latest 2011-05-27 23:41:07 -07:00
Karl Berry
0b7299f98e maint: update README-hacking
* README-hacking: Update a la coreutils for git, etc.
2011-05-23 19:23:48 +02:00
Jim Meyering
91d850a78b maint: update gnulib to latest with accompanying tight-scope tweaks
* cfg.mk: Include $(srcdir)/dist-check.mk using "-include",
to accommodate the new sc_tight_scope rule.
(_gl_TS_extern): Define, to tell gnulib's tight_scope rule that
headers here mark externs with "XTERN".
* gnulib: Update to latest.
2011-05-23 19:20:09 +02:00
Jim Meyering
39213a3bbc maint: use gnulib's new readme-release module
* bootstrap.conf (gnulib_modules): Add readme-release.
(bootstrap_epilogue): Add the recommended perl one-liner.
* README-release: Remove file; it is now generated from gnulib.
* .gitignore: Add it.
2011-05-18 20:31:42 +02:00