| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
|
|
|
| |
tests/create-delete: Repair 'backup of unmodified file' test.
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add errno module.
* src/common.h: Remove ENOTSUP fallback.
|
|
|
|
| |
* NEWS: Trailing whitespace fix.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* configure.ac (WARN_CFLAGS): Disable -Wsuggest-attribute=format,
to avoid some warnings that are not worth working around.
|
|
|
|
| |
* NEWS: Update.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* src/common.h (ENOTSUP): Make sure this error code is defined.
* src/util.c (set_file_attributes): Ignore ENOSYS, ENOTSUP, and EPERM errors.
|
|
|
|
| |
* tests/crlf-handling: Add explanation.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* src/pch.c (prefix_components): Follow symlinks.
(cwd_is_root): Follow symlinks.
|
|
|
|
|
| |
* patch.man: The options are mostly listen in alphabetical order; stick to
that.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* src/inp.c (get_input_file): Rename mode parameter to file_type, it's all we
care about here.
|
|
|
|
|
|
| |
* src/inp.c (get_input_file): Improve error message when patching a file of
different type.
* tests/symlinks: Update test case.
|
|
|
|
|
| |
* tests/dash-o-append: Minor update (still expected to fail).
* tests/symlinks: Minor update.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* README: Change leftover GPLv2 license notice to GPLv3.
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* NEWS: Add note.
|
|
|
|
| |
* NEWS: Update.
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* src/util.c (file_id): Remove sha1 field.
(update_sha1, lookup_sha1): Remove functions.
* src/util.h (update_sha1, lookup_sha1): Remove declarations.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* tests/concat-git-diff: Add test case here.
|
| |
|
|
|
|
| |
* src/patch.c (main): Rename outst to tmpoutst.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* src/inp.c (re_input): Don't close FD if it's negative.
|
|
|
|
| |
* tests/concat-git-diff: Add file create test case.
|
|
|
|
|
| |
* src/util.c (update_sha1): Remove unnecessary if-before-free,
to avoid "make syntax-check" failure.
|
|
|
|
|
| |
* src/pch.c (sha1_says_nonexistent): Apply _GL_ATTRIBUTE_PURE,
to avoid failure with -Werror=suggest-attribute=pure.
|
|
|
|
| |
* bootstrap: Update from gnulib.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|