30 Commits

Author SHA1 Message Date
Andreas Gruenbacher
8cc8b7061c * src/patch.c (longopts, get_some_switches): Add an optional argument
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.
2009-12-29 17:03:14 +01:00
Andreas Gruenbacher
ab59a14a7b * src/pch.c: When the input files to diff have CRLF line endings, the
'<' 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.
2009-12-28 15:14:20 +01:00
Andreas Gruenbacher
e2218ace73 * src/pch.c (intuit_diff_type): Fix regression introduced after patch
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.
2009-12-23 00:15:30 +01:00
Andreas Gruenbacher
84f303c1ef * src/pch.c (intuit_diff_type): Add some clarifying comments. 2009-12-22 20:31:43 +01:00
Andreas Gruenbacher
71a3f0d5cf * src/version.c (copyright_string): Add year 2009. 2009-12-22 20:30:22 +01:00
Andreas Gruenbacher
87f54e80e1 Clarify the message when (part of) a hunk cannot be merged 2009-10-27 16:46:25 +01:00
Andreas Gruenbacher
ba37782d74 Try to preserve the owning group of patched files 2009-09-04 13:55:32 +02:00
Andreas Gruenbacher
62d03acb14 The -m option hasn't been officially allocated yet; use only the long form for now (--merge) 2009-07-19 17:50:54 +02:00
Andreas Gruenbacher
8c8cf43e87 When copying files, use full_write() from gnulib instead of write() 2009-07-19 16:37:11 +02:00
Andreas Gruenbacher
4e894668a7 Don't fail when removing nonexistent files in move_file 2009-06-15 23:31:47 +02:00
Andreas Gruenbacher
dee5d61753 To redirect messages, instead of assigning stderr to stdout, use dup2 2009-06-05 21:54:58 +02:00
Andreas Gruenbacher
917aa4f4f1 When the file to patch is specified on the command line, apply all patches to that file 2009-05-12 21:55:35 +02:00
Andreas Gruenbacher
889d33db47 When merging, make sure that hunks will not end up "out of order" 2009-05-12 15:39:36 +02:00
Vincent Legoll
b008dece18 Change the default value of PATCH_GET to 0
Patch should default to not try to get files from revision control software
unless actively asked by the user with the "-g" or "--get" command-line
switches, or the PATCH_GET environment variable.

Make the posixly correct behaviour of not using source control, the global
patch default. I.e. default to "-g0".

This is related to debian BTS bug: #200895
Please refer to that discussion for more background
information and discussion.
2009-05-12 14:32:15 +02:00
Andreas Gruenbacher
70df4e46b3 Don't forget to NUL terminate ptimestr in fetchname() 2009-04-08 16:37:57 +02:00
Andreas Gruenbacher
c59af953e8 Allow special characters in filenames read interactively 2009-04-08 12:28:33 +02:00
Andreas Gruenbacher
2e583114c7 Add support for sending output to standard output 2009-04-08 06:23:11 +02:00
Andreas Gruenbacher
7e2373f062 Remove redundant check in main(). 2009-04-08 06:19:20 +02:00
Andreas Gruenbacher
da45b67685 Preserve timestamps in reject files 2009-04-07 22:03:49 +02:00
Andreas Gruenbacher
2782a52315 Adapt file_id_hasher() to Gnulib type change 2009-04-07 01:28:13 +02:00
Christian Franke
d35880278d patch -Z not working if timestamp contains seconds > 59.5
Hi,

this is from a recent discussion in the cygwin mailing list:
(http://cygwin.com/ml/cygwin/2006-04/msg00699.html)

The patch options -Z and -T do not set filetime if the seconds part
of the timestamp is greater 59.5. This is because maketime() does
not handle denormalized times and returns an error on tm_sec = 60.

The bug could also be reproduced with patch 2.5.9 on Linux.

It might be better to ignore the fractional part of the second at all.
This would make timestamps set by patch identical to those set by tar.

[agruen: Christian's second version of the patch.]
2009-04-06 17:57:50 +02:00
Andreas Gruenbacher
b3a9ff4f13 Fix the "patch would create" fix from 2009-03-28 2009-04-06 05:47:52 +02:00
Andreas Gruenbacher
a03f22893c Copyright notice updates 2009-04-05 21:12:30 +02:00
Andreas Gruenbacher
99c2da6f0b Add a similar asymmetric hunk check to locate_merge() 2009-04-05 20:40:55 +02:00
Andreas Gruenbacher
802b26e78d Revert (almost) to the original asymmetric hunk behavior and document that 2009-04-05 20:24:04 +02:00
Andreas Gruenbacher
018b7b56c0 Remove dir_name() and base_name() in create_backup(): too many problems 2009-04-05 19:39:06 +02:00
Andreas Gruenbacher
1d204bbab2 Don't assume the target directory exists when making a backup copy 2009-04-05 17:42:20 +02:00
Andreas Gruenbacher
b3fbd9a585 Update to the latest version of Gnulib 2009-04-05 08:18:21 +02:00
Andreas Gruenbacher
f3a61e5f3e Move all Gnulib files into gl/ 2009-04-05 08:13:07 +02:00
Andreas Gruenbacher
85cd8a4cfe Move all source and header files into src/ 2009-04-05 08:12:05 +02:00