| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* src/util.c (make_tempfile): Do not create temporary files in the final output
directory when in dry-run mode: the path may be read-only. In addition, we do
not want to leave intermediary empty output directories around.
|
|
|
|
|
| |
* patch.1: Use higher-level markup that translates better into HTML and other
formats. (With changes by Andreas Gruenbacher.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Doing so prevents bootstrapping with bleeding-edge autotools,
because of harmless deprecation warnings (that are not planned
to become hard errors for at least a few years to come). And
unfortunately, options in AM_INIT_AUTOMAKE take precedence over
those given on the command line (this is a long-time wart of
automake).
* configure.ac (AM_INIT_AUTOMAKE): Drop '-Werror' option.
Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Reported by Thomas Moschny <thomas.moschny@gmx.de>:
src/patch.c (main): Temporary output files are created in the same directory as
the output file. Make sure to remove them before removing empty files and
their empty ancestor directories; else the directories won't be empty.
tests/remove-directories: Add directory removal test case.
tests/Makefile.am (TESTS): Add new test case.
|
|
|
|
| |
* patch.man: Clarify the description of option --forward.
|
|
|
|
|
|
|
| |
* 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: Skip binary diff test if printf '\0' is broken.
|
| |
|
| |
|
|
|
|
| |
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.
|