| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* tests/copy-rename, tests/criss-cross, tests/file-modes,
tests/mixed-patch-types, tests/quoted-filenames: Add missing index lines in the
"dif --git" test cases: We will use some of them for consistency checks soon.
|
|
|
|
|
|
| |
Bug reported by Dmitry V. Levin <ldv@altlinux.org>.
* src/patch.c (output_file_later): Fix case where the output file is identical
with the input file (and to == NULL).
|
|
|
|
| |
* bootstrap: Update from gnulib.
|
|
|
|
| |
* NEWS: Update.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Failing when trying to patch read-only files causes various users of patch to
break. Instead, warn by default and introduce a command line option for
choosing a different behavior.
* patch.man: Describe the new behavior and command-line option.
* src/patch.c (read_only_behavior): New variable.
(main): Implement the new behavior.
(longopts): Add the new --read-only option.
(option_help): Describe the new behavior.
(get_some_switches): Recognize the new --read-only option.
|
|
|
|
| |
* tests/create-delete: Remove left-over file f.orig before the test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In git-style patch files, all patches refer to the initial state of the input
files; files cannot be modified more than once. Implement these semantics by
creating all output files once all patches in the patch file have been
processed.
* src/patch.c (init_files_to_output, output_files): Add prototypes.
(main): Remember which type of patch file we are processing. Initialize the
output files list. Output files of git-style patches once all patches have
been read, or when from git-style to normal patches.
(file_to_output): New struct.
(files_to_output): List of the files to output.
(output_file, output_file_now, output_file_later): Either queue a file for
deletion, remember to output a file later (git-style), or output the file
immediately (normal).
(dispose_file_to_output, init_files_to_output, output_files,
forget_output_files): New functions.
(gl_list_clear): Should be provided by gnulib but isn't.
(cleanup): Clean up any left-over temporary output files as well.
* tests/Makefile-am (XFAIL_TESTS): Remove criss-cross; this test case works now.
* tests/mixed-patch-types: Patch files that change from normal to git-style, or
from git-style to normal.
|
|
|
|
|
|
| |
* src/pch.c (p_git_diff): New global variable.
(intuit_diff_type): Use p_git_diff instead of a local variable.
(pch_git_diff): New function.
|
|
|
|
|
|
| |
* tests/symlinks: Remove test case which deletes and then recreates a symlink:
all patches in a git-style input file must refer to the "before" state; the
test case is invalid.
|
|
|
|
|
|
|
|
|
|
| |
Remembering backup files was needed because we would have lost track of deleted
files before -- but we don't delete files immediately anymore.
* src/util.c (create_backup_copy): No longer remember backup files.
(create_backup): Likewise; update comment.
(move_file): Update create_backup() call.
* src/util.h (create_backup): Update prototype.
* src/patch.c (output_file): Update create_backup() call.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the bug that more than one numbered backup would be created when a patch
file deletes and recreates a file.
* bootstrap.conf (gnulib_modules): Add linked-list and xlist modules.
* src/util.h (file_id_type): Add DELETE_LATER and OVERWRITTEN types.
(create_backup, set_file_attributes): Update prototype.
(insert_file_id): Add prototype.
* src/util.c (insert_file_id): Export.
(set_file_attributes, create_backup_copy): Make the st argument const.
(create_backup): Pass in to_st instead of returning it from create_backup().
This obsoletes the to_errno argument.
(move_file): Determine to_st here and pass it to create_backup(). Remember
when a file is overwritten.
* src/patch.c (output_file): Add to_st parameter. Remember files to delete
instead of deleting them immediately. Pass from-st to create_backup().
(file_to_delete): New struct.
(init_files_to_delete, delete_file_later, delete_files): New functions.
(main): Use init_files_to_delete() and delete_files(). Pass to_st to
output_file() where we already have it.
* src/pch.c (intuit_diff_type): Assume that files which are marked for deletion
don't exist.
|
|
|
|
|
|
|
| |
* src/patch.c (output_file): New function for creating or deleting an output
file and backing the old file up as needed.
(main): Use the new function.
* src/util.c (move_file): Allow FROM_NEEDS_REMOVAL to be NULL.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/util.h (file_id_type): New enum.
* src/util.c (file_id): Add a file_id_type field.
(insert_file_id): Rename from insert_file(); specify a type when inserting a
file id.
(lookup_file_id): Rename from file_id_exists(); return a file id type.
(create_backup_copy, create_backup, move_file): Use insert_file_id() instead of
insert_file(), and lookup_file_id() instead of file_already_seen().
* src/patch.c (main): Use lookup_file_id() instead of file_already_seen().
|
|
|
|
|
| |
* src/common.h, src/patch.c, src/pch.c, src/util.c, src/util.h: Switch from the
`old' gnu quoting style to the 'new' one in messages and comments.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Steffen Sledz in
https://bugzilla.novell.com/show_bug.cgi?id=755136 via Jean Delvare.
Bug introduced in commit v2.6.1-115-ge0f7075; fixed with help from Jim
Meyering <meyering@redhat.com>.
* src/common.h (ARRAY_SIZE): New macro.
* src/pch.c (invalid_names): New global variable for remembering bad names.
(intuit_diff_type): Reset invalid_names for each new patch; the names from the
previous patch have already been freed.
(name_is_valid): Use invalid_names. Make the code "safer" and avoid
duplication.
|
|
|
|
|
| |
* configure.ac (AM_INIT_AUTOMAKE): Require version 1.11.2 which introduced the
AM_PROG_AR macro, used since commit 297f9e7d.
|
| |
|
|
|
|
|
|
|
|
| |
* bootstrap: Update from gnulib.
* bootstrap.conf (gnulib_tool_option_extras): Define.
* lib/Makefile.am: Initialize numerous automake variables so that
generated code in gnulib.mk may use += to append to them.
* configure.ac: Add AM_PROG_AR, to placate newer automake.
|
|
|
|
|
|
| |
* cfg.mk (local-checks-to-skip): Remove sc_space_tab,
thus enabling this syntax-check rule.
* tests/quoted-filenames: Use TAB-space, not space-TAB.
|
|
|
|
|
|
| |
* cfg.mk (local-checks-to-skip): Remove sc_useless_cpp_parens,
thus enabling this syntax-check rule.
* src/patch.c: Remove unneeded parentheses.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mark functions as pure of const, per recommendations enabled by
new gcc -W options. Apply _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST.
* src/common.h: Apply new function attributes.
* src/pch.c: Likewise.
* src/pch.h: Likewise.
* src/util.c: Likewise.
* src/util.h: Likewise.
* configure.ac: Use -Wno-format-nonliteral.
* m4/.gitignore: Update.
* gnulib: Update to latest.
* cfg.mk: Exempt src/util.c from two tests, to avoid new
"make syntax-check" failures.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/util.h (enum file_attributes): Add FA_XATTRS flag for extended
attributes.
* src/patch.c (main): Use set_file_attributes() even when the infile doesn't
exist: it may still set the file time (FA_TIMES). Omit all other FA_ flags if
infile doesn't exist. Otherwise, add FA_XATTRS as well.
* src/util.c (set_file_attributes): Only copy extended attributes if FA_XATTRS
is set. Avoid using st where it may be undefined.
* tests/preserve-mode-and-timestamp: Add file create test.
|
|
|
|
|
|
| |
* tests/Makefile.am (TESTS_ENVIRONMENT): Don't use $(SHELL) here
to ensure the test scripts are run through it; instead, ...
(LOG_COMPILER): ... use it here.
|
|
|
|
|
|
|
|
|
|
| |
* src/pch.c (another_hunk): Rather than asserting(C), issue the
"replacement text or line numbers mangled ..." diagnostic when !C.
* tests/mangled-numbers-abort: New test for the above.
* tests/Makefile.am (TESTS): Add it.
* NEWS: Mention it.
Reported by Gabriel Vlasiu via Tim Waugh.
See also http://bugzilla.redhat.com/738959
|
|
|
|
|
|
|
|
| |
* configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
* bootstrap.conf (gnulib_modules): ...this. Use largefile module.
* gnulib: Update to latest.
This is useful to Mac OS X 10.5 users if/when configure
is generated using autoconf prior to v2.68-80-gdb2f2e0.
|
|
|
|
|
|
| |
* Makefile.am (EXTRA_DIST): Append .version, to avoid "make distcheck"
failure when run from an unpacked tarball.
Reported by Iain Nicol.
|
|
|
|
| |
* README: Refer users to README-hacking after a "git clone".
|
|
|
|
|
| |
* src/patch.c (open_outfile): If dup fails, don't clobber its
errno value by calling fdopen with -1.
|
|
|
|
| |
* src/inp.c (plan_a): Don't leak "buffer" upon early return.
|
|
|
|
|
|
| |
* src/util.c: Include "error.h".
(ask): Use error, not perror. The latter would not have included
the usual "program name: " prefix.
|