summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update .gitmodules to point at upstream:gnulibbaserock/v2.7.1Daniel Silverstone2014-09-181-1/+1
|
* Initialize data structures early enoughAndreas Gruenbacher2014-09-183-4/+23
| | | | | | | * src/patch.c (main): Initialize data structures early enough, before error paths can access them. * tests/bad-usage: Test bad command line usage. * tests/Makefile.am (TESTS): Add bad-usage here.
* Version 2.7.1v2.7.1Andreas Gruenbacher2012-09-281-0/+2
|
* build: update gnulib submodule to latestAndreas Gruenbacher2012-09-281-0/+0
|
* Repair 'backup of unmodified file' testAndreas Gruenbacher2012-09-281-8/+5
| | | | tests/create-delete: Repair 'backup of unmodified file' test.
* Use gnulib errno module instead of our own default ENOTSUP fallbackAndreas Gruenbacher2012-09-282-4/+1
| | | | | * bootstrap.conf (gnulib_modules): Add errno module. * src/common.h: Remove ENOTSUP fallback.
* Trailing whitespace fixAndreas Gruenbacher2012-09-281-1/+1
| | | | * NEWS: Trailing whitespace fix.
* Improve the previous commitAndreas Gruenbacher2012-09-263-6/+27
| | | | | | | | * src/patch.c: Only print the "file is not empty after patch" message when trying to delete the output file. Say that we were trying to delete the file. * tests/create-delete: Fix the expected messages. Add test cases for the --remove-empty-files and --posix options. * NEWS: Better describe this change.
* Only expect files to become empty if the patch says soAndreas Gruenbacher2012-09-253-11/+73
| | | | | | | Test cases based on patches from Dmitry V. Levin <ldv@altlinux.org>. * src/patch.c (main): Only expect files to become empty if the patch says so. * NEWS: Document this change. * tests/create-delete: Add (more) empty vs. non-empty test cases.
* build: avoid gcc warnings from -Wsuggest-attribute=formatJim Meyering2012-09-221-0/+1
| | | | | * configure.ac (WARN_CFLAGS): Disable -Wsuggest-attribute=format, to avoid some warnings that are not worth working around.
* Update NEWSAndreas Gruenbacher2012-09-221-0/+13
| | | | * NEWS: Update.
* Improve messages when in --dry-run modeAndreas Gruenbacher2012-09-225-14/+24
| | | | | | | | * src/patch.c (main): Say that we are checking a file and not that we are patching it in --dry-run mode. Don't say "saving rejects to file" when we don't create reject files. * tests/reject-format: Add rejects with --dry-run test case. * tests/bad-filenames, tests/fifo, tests/mixed-patch-types: Update.
* Improve handling of LF vs. CRLF line endingsAndreas Gruenbacher2012-09-223-9/+47
| | | | | | | | | * src/patch.c (check_line_endings): New function. (main): When a hunk fails, report when the line endings differ between the input file and the patch. * src/pch.c (there_is_another_patch): When saying that we strip trailing CRs, also say how to turn this off. * tests/crlf-handling: Update changed messages. Add test case that fails.
* Ignore when preserving extended attributes is not supported or allowedAndreas Gruenbacher2012-09-222-6/+13
| | | | | * src/common.h (ENOTSUP): Make sure this error code is defined. * src/util.c (set_file_attributes): Ignore ENOSYS, ENOTSUP, and EPERM errors.
* Add a missing explanation in the tests/crlf-handling test caseAndreas Gruenbacher2012-09-201-0/+4
| | | | * tests/crlf-handling: Add explanation.
* Add --follow-symlinks option for backwards compatibilityAndreas Gruenbacher2012-09-195-1/+21
| | | | | | | | | * src/common.h (follow_symlinks): New variable. * src/patch.c (longopts): Add new --follow-symlinks option. (get_some_switches): Recognize the new option. * src/util.c (stat_file): Follow symlinks if requested. * patch.man: Document the new option. * tests/symlinks: Add test case.
* Introduce function to lstat all input filesAndreas Gruenbacher2012-09-195-21/+26
| | | | | | | | | | | * src/util.c (stat_file): New function. (move_file): Use here. * src/util.h (stat_file): Declare here. * src/inp.c (get_input_file): Use here. * src/patch.c (main): Use here. (delete_file_later): Use here. * src/pch.c (there_is_another_patch): Use here. (intuit_diff_type): Use here.
* Use stat where we want to follow symlinksAndreas Gruenbacher2012-09-191-3/+3
| | | | | * src/pch.c (prefix_components): Follow symlinks. (cwd_is_root): Follow symlinks.
* Document command-line options in alphabetic orderAndreas Gruenbacher2012-09-191-4/+4
| | | | | * patch.man: The options are mostly listen in alphabetical order; stick to that.
* Fix file truncation when switching from git diff to non-git diffAndreas Gruenbacher2012-09-182-6/+41
| | | | | | | | * src/patch.c (main): Output queued output files only when switching from a git diff to a non-git diff. This can modify the input file, so make sure to stat() it again. * tests/concat-git-diff: Add test case growing a file with a git diff and then with a non-git diff; without this fix; the result would be truncated.
* Rename get_input_file() parameter to clarify codeAndreas Gruenbacher2012-09-181-5/+5
| | | | | * src/inp.c (get_input_file): Rename mode parameter to file_type, it's all we care about here.
* Improve error message when patching a file of different typeAndreas Gruenbacher2012-09-182-4/+4
| | | | | | * src/inp.c (get_input_file): Improve error message when patching a file of different type. * tests/symlinks: Update test case.
* Minor test case updatesAndreas Gruenbacher2012-09-182-6/+6
| | | | | * tests/dash-o-append: Minor update (still expected to fail). * tests/symlinks: Minor update.
* Disable xattrs if libattr doesn't implement attr_copy_action()Andreas Gruenbacher2012-09-172-7/+2
| | | | | | | * m4/xattr.m4 (gl_FUNC_XATTR): Only enable USE_XATTR if both attr_copy_file() and attr_copy_action() are defined. * src/util.c (copy_attr_check): No fallback needed if attr_copy_action() is not defined.
* Allow to use potentially dangerous filenames from the root directoryAndreas Gruenbacher2012-09-172-0/+38
| | | | | | | | | * src/pch.c (cwd_is_root): New function to check if we are in the root directory of a filename. (name_is_valid): Allow to use potentially dangerous filenames when the current working directory is the root directory: from there, those names are not any more dangerous than other names. * tests/bad-filenames: New test case.
* Update leftover license notice in READMEAndreas Gruenbacher2012-09-141-7/+5
| | | | * README: Change leftover GPLv2 license notice to GPLv3.
* Check if libattr implements attr_copy_action()Andreas Gruenbacher2012-09-142-1/+7
| | | | | | * m4/xattr.m4 (gl_FUNC_XATTR): Check if attr_copy_action() is defined. * src/util.c: If attr_copy_action() doesn't exist, fall back to the default copy_attr_file() behavior of copying most extended attributes except ACLs.
* Change the type of *_needs_removal from int to boolAndreas Gruenbacher2012-09-137-23/+23
|
* In a git-style diff, make sure not to unlink the original by accidentAndreas Gruenbacher2012-09-132-2/+28
| | | | | | | | * src/patch.c (main): Fail if a file is not empty as expected. (output_files): In a git-style diff, make sure not to unlink the original when making a backup of an unmodified file. * tests/create-delete: Fix failed-file-deletion test and add successful-file-deletion test.
* Do not pass file type in mode of open(..., O_CREAT, mode)Andreas Gruenbacher2012-09-131-1/+2
| | | | | | * src/patch.c (main): Strip file type off of create mode for temporary output files: some systems don't ignore the file type; we want to create a regular file even when patching a symlink.
* Add note on GPLv3 license change in version 2.6Andreas Gruenbacher2012-09-131-0/+1
| | | | * NEWS: Add note.
* Version 2.7v2.7Andreas Gruenbacher2012-09-121-4/+6
| | | | * NEWS: Update.
* maint: update gnulib submoduleAndreas Gruenbacher2012-09-122-0/+1
|
* Support double-quoted filenames in all context diff formatsAndreas Gruenbacher2012-08-115-13/+15
| | | | | | | | * src/util.c (fetchname): Always recognize double-quoted filenames. * src/util.h (fetchname): Update prototype. * src/pch.c (intuit_diff_type): Update calls to fetchname(). * tests/quoted-filenames: Change to a normal unified diff. * NEWS: Update.
* Remove SHA1 hashes from the file id cacheAndreas Gruenbacher2012-08-082-24/+0
| | | | | | * src/util.c (file_id): Remove sha1 field. (update_sha1, lookup_sha1): Remove functions. * src/util.h (update_sha1, lookup_sha1): Remove declarations.
* Detect concatenated git-style patches by tracking what's in the output queueAndreas Gruenbacher2012-08-082-26/+46
| | | | | | | * src/patch.c (main): Instead of looking at the SHA hashes to detect concatenated git-style patches, detect when a file to write to is already in the output queue. * tests/concat-git-diff: Add create/delete tests.
* In the file id cache, allow to flag files in the output queueAndreas Gruenbacher2012-08-082-0/+22
| | | | | | | * src/util.c (file_id): Add queued_output field. (__insert_file_id): Initialize queued_output. (set_queued_output, has_queued_output): New functions. * src/util.h (set_queued_output, has_queued_output): Declare.
* Add another git-style diff concatenation regression testDmitry V. Levin2012-08-081-0/+40
| | | | * tests/concat-git-diff: Add test case here.
* maint: ignore more build artifactsAndreas Gruenbacher2012-08-081-0/+1
|
* Change outst variable name to tmpoutst to be less misleadingAndreas Gruenbacher2012-08-071-7/+7
| | | | * src/patch.c (main): Rename outst to tmpoutst.
* In git-style diffs, create new files immediatetly and only remember files to ↵Andreas Gruenbacher2012-08-022-3/+26
| | | | | | | | modify * src/patch.c (output_file): Create new files immediately. Document why things are implemented that way. * tests/concat-git-diff: Fix glitch in test case.
* Don't close a negative file descriptorJim Meyering2012-08-011-1/+2
| | | | * src/inp.c (re_input): Don't close FD if it's negative.
* Add file create test case which still needs to be fixedAndreas Gruenbacher2012-08-011-2/+7
| | | | * tests/concat-git-diff: Add file create test case.
* build: remove unnecessary if-before-freeJim Meyering2012-08-011-2/+1
| | | | | * src/util.c (update_sha1): Remove unnecessary if-before-free, to avoid "make syntax-check" failure.
* build: mark an internal function as "pure"Jim Meyering2012-08-011-1/+1
| | | | | * src/pch.c (sha1_says_nonexistent): Apply _GL_ATTRIBUTE_PURE, to avoid failure with -Werror=suggest-attribute=pure.
* maint: update bootstrap and gnulib submoduleAndreas Gruenbacher2012-08-013-93/+176
| | | | * bootstrap: Update from gnulib.
* Try to recognize concatenated git diffs and handle them appropriatelyAndreas Gruenbacher2012-08-013-0/+67
| | | | | | | | * src/patch.c (main): Remember the "before" SHA1 hashes of git-style patches; the same patch will always use the same "before" SHA1 for a specific file. Try to recognize concatenated patches based on that. * tests/concat-git-diff: New test case. * tests/Makefile.am (TESTS): Add new test case.
* Allow to process only part of the deferred output file listAndreas Gruenbacher2012-08-011-5/+20
| | | | | * src/patch.c (output_files): Add parameter to specify which file to stop at. (main): Pass NULL to output_files() to process the entire list.
* Allow to remember SHA1 hashes in the file id cacheAndreas Gruenbacher2012-07-312-9/+48
| | | | | | | | | * src/util.c (file_id): New sha1 field. (__insert_file_id): Split off from insert_file_id(). Initialize sha1 field. (__lookup_file_id): Split off from lookup_file_id(). (update_sha1): Remember SHA1 hash of a file or update the remembered SHA1 hash. (lookup_sha1): Look up the SHA1 hash of a file. * src/util.h (update_sha1, lookup_sha1): Declare.
* Accessor functions for SHA1 hashes in git-style diffsAndreas Gruenbacher2012-07-312-7/+33
| | | | | | | | | | | * src/pch.c (p_sha1): New variable. (get_sha1): New function for saving a sha1 checksum. (sha1_says_nonexistent): Take a NULL terminated string instead of an end pointer. (intuit_diff_type): Remember the SHA1 hashes from index headers in git-style diffs in p_sha1. (pch_sha1): New function for accessing p_sha1. * src/pch.h (pch_sha1): Declare.