* src/patch.c (main): Support nanosecond timestamps. Replaqce utime()
with utimens().
* src/util.c (create_backup_copy): Preserve nanosecond timestamps.
Replace utime() with utimens().
* src/util.h: Remove the utime() related declarations, and include
the utimens() and nanosecond related headers instead.
* bootstrap.conf: Add the stat-time and utimens modules.
* src/Makefile.am (patch_SOURCES): Remove maketime.c, maketime.h,
partime.c, and partime.h.
(patch_LDFLAGS): Add LIB_CLOCK_GETTIME for clock_gettime().
* src/util.c: Replace maketime.h and partime.h with getdate.h.
(fetchname): Replace str2time() with get_date(). Sanitize the test
for epoch timestamps.
* src/patch.c (main): When --set-utc is given, set the TZ environment
variable to UTC so that get_date() will default to UTC timestamps.
* tests/preserve-mode-and-timestamp: Switching to get_date() revealed
that str2time() was ignoring timezones. In order to test --set-utc
now that get_date() fixes this, we must use timestamps that do not
include timestamps here.
* bootstrap.conf: Add the clock-time, getdate, gettime, and setenv
modules.
* src/pch.h (pch_timestamp): Return timestamp as struct timespec
instead of time_t.
* src/pch.c: Use struct timespec instead of time_t. A tv_sec value
of -1 indicates "no timestamp".
* src/util.h (fetchname): Return timestamp as struct timespec
instead of time_t.
* src/util.c (fetchname): str2time() does not give us nanoseconds; set
them to zero for now.
* src/patch.c (main): Only use the seconds in timestamps for now.
* bootstrap.conf: Add the time module for getting struct timespec
declared on old hosts.
* src/patch.c (Argv): Change type to char ** so that we can pass Argv
to getopt_long without warning.
* src/maketime.c (maketime): Fix year overflow check.
* tests/merge: Use the sed commands i, a, and c in their standard form
instead of relying on a GNU extension, and pass sed a script (-f)
instead of a list of commands via -e.
Some versions of sed don't support expressions like /^\(\|foo\)$/.
* tests/corrupt-reject-files: Use the more widely available -e switch
instead of -A.
* tests/crlf-handling: Likewise.
* tests/preserve-mode-and-timestamp: Use touch -t instead of touch -d.
Some non-GNU versions of date can't show a file's timestamp.
* configure.ac: Add automake and gnulib macros, replace several
obsolete macros.
* Makefile.am, lib/Makefile.am, src/Makefile.am, tests/Makefile.am:
Add for automake.
* autogen.sh, INSTALL, Makefile.in, mkinstalldirs, update-version.sh:
Obsolete; remove.
* README-hacking: Import from diffutils, replace cvs with git.
* build-aux: Move gnulib auxiliary files here from the top-level
directory.
* gnulib: Add gnulib git submodule.
* bootstrap, bootstrap.conf: Import from gnulib and adjust.
* gl/lib: Remove gnulib files from the repository; they are now
imported into lib/ from gnulib as needed.
* tests/test-lib.sh: Use $abs_top_builddir exported from
tests/Makefile.am here instead of $PWD.
* m4/utimbuf.m4: This macro has been removed from gnulib. Add it here
for now; this will be replaced by gnulib's utimens module soon.
* src/merge.c: When a hunk has fewer suffix than prefix context lines,
try matching to the end of the file instead of doing a "greedy match":
this allows to detect already-applied inserts at the end of the file.
* tests/merge: Add test cases for this.
* gl/lib/strndup.c: HAVE_DECL_STRNLEN is either 0 or 1 so we need
to test for it with #if, not #ifdef.
* gl/lib/xstrndup.c: Likewise for HAVE_DECL_STRNDUP.
* src/bestmatch.h, src/diffseq.h, src/inp.c, src/maketime.c,
src/merge.c, src/partime.c, src/pch.c, src/util.c: No longer use
"continue" as the only instruction in a loop body: at least one
compiler chokes on this in combination with variable-length arrays
as in src/bestmatch.h.
to the --merge option to choose the output formats for conflicts.
* patch.man: Document the new optional argument of --merge.
* src/merge.c (merge_hunk): Implement diff3-style conflicts.
* src/common.h (conflict_style): This global variable determines the
output format for conflicts.
* tests/merge: Add test cases for the diff3 output format.
directory if needed.
(stdbool.h, STDBOOL_H): Likewise -- this should fix stdbool.h
generation on platforms which don't provide this header.
(argmatch.$(OBJEXT)): Add missing $(STDBOOL_H) dependency.
* gl/m4/strndup.m4 (gl_HEADER_STRING_H_DEFAULTS): Don't use gnulib's
strings.h replacement for now, it is too complicated to add right now.
* gl/lib/xstrndup.c: Instead of using gl_HEADER_STRING_H_DEFAULTS,
declare strndup here on systems which don't have it.
* gl/lib/strndup.c: Instead of using gl_HEADER_STRING_H_DEFAULTS,
declare strnlen here on systems which don't have it.
* gl/lib/strnlen.c: Import from gnulib.
'<' and '>' lines of normal-style diffs will have CRLF endings even
when the patch itself has not been CRLF mangled. Do not assume a
mangled patch in this case.
* tests/crlf-handling: Update test case to cover this case.
2.5.9: when none of the filenames in the old, new, and index headers
exists, patch chose the wrong filename (bug 28367).
(maybe_reverse): Return if the patch looks reversed, not if this
function toggled the reverse flag.
* tests/filename-choice: New test case.
* Makefile.in (TESTS): Add test case.