Commits
- Commit:
5b7126c502f8d046d0779dd2cb0558163c383819
- From:
- Omar Polo <op@omarpolo.com>
- Date:
actually guarding against negative line offsets
previous commit looked at some pretty zeroes returned from calloc
instead of the actual numbers received.
- Commit:
2399b53d3a5f7a784efc54b86027b4f50f65ac41
- From:
- Omar Polo <op@omarpolo.com>
- Date:
style; set datalen only once
- Commit:
71393b5c7fb0a8cff0c8fd7890c3954e3f3a9599
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: guard against invalid (negative) line offsets
under normal circumstances got-read-patch can't send negative line
offsets; that's not an excuse not to guard the main process from those
as well.
This makes sure we bail out early instead of trying to apply the diff.
- Commit:
0e07a2a181ad1663e726597758495e6b8010ba97
- From:
- Omar Polo <op@omarpolo.com>
- Date:
free patch on error
- Commit:
99b94ad7a7280ebcb23a103b28c81900bbe250ee
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: ensure new and old paths are NUL-terminated
- Commit:
4bcdc8959af14bcb2e50c7f303df6c055573bc7a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
refactor got_patch / got_worktree_patch_complete
let got_patch own fileindex_path and call got_worktree_patch_complete
only if got_wokrtree_patch_prepare hasn't failed.
suggested by stsp@
- Commit:
f2dd780737c47f6d92e6fe01cbd51bf93c91b3b3
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: avoid open/sync/close the fileindex over and over again
Instead of flushing the fileindex after every patch in the patchfile
just reuse the same fileindex and sync it only at the end of the patch
operation. This speeds up 'got patch' on large repositories by quite a
lot.
- Commit:
e45f7eba7c3fe929b6bd5852f390301aeace98aa
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
got patch: switch from fseek() to fseeko(), use unary minus while here
ok op
- Commit:
be33dff7fa389c620154dc06efbeae69bd002950
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: fail when reading empty hunks
- Commit:
bad961bf76d36ad6f3472c7ad80f648091f56019
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: allow to reverse a patch
add a flag to got_patch to reverse a patch before applying and the -R
flag for `got patch'.
ok stsp@
- Commit:
b28327780dc2e32f03051c7d18d57db2e27e2de6
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got-read-patch: preserve all \ lines
as a cheap optimization got-read-patch was sending only the "\ No
newline at end of file" lines that follows an addition (a "+" line). To
be able to reverse patches in the future got_patch needs to know about
all of these lines instead. No functional changes intended.
ok stsp@
- Commit:
ed3bff83077bfa3c251eb87bc83f541d8cdaaa11
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: resolve paths from the current working directory
this allow to apply patches from subdirectories of the work tree root.
Prodded by naddy@, ok stsp@.
- Commit:
41a37a441444194d85c82d2046e402b55b159286
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fix wrong path in error message
- Commit:
9d6cabd51222f7506db617ee8a7b282823dde999
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: allow to strip path components
Move some bits from the libexec helper to the main process so we know if
the patch was generated by git or not and finally document the automatic
stripping of a/ and b/ prefixes added by git-diff(1).
ok stsp@
- Commit:
fbbb53b90ee30e5fde6281e4b06b3fc1d689e083
- From:
- Omar Polo <op@omarpolo.com>
- Date:
remove trailing whitespaces
- Commit:
b3c57ab2fb7857f055b840d29c425370effc8f9c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: handle "\ No newline at end of file"
- Commit:
4027dbc25c21bad271f5406e382054c6095523bc
- From:
- Omar Polo <op@omarpolo.com>
- Date:
reuse apply_hunk in patch_file when creating a file
- Commit:
78f5ac2436c8d17d1dd687d69e51354707275988
- From:
- Omar Polo <op@omarpolo.com>
- Date:
move got_patch file status checking in worktree.c
check_file_status used got_worktree_status to check if the file was in
an allowed state, but it's wrong since the callback is not invoked on
unchanged files.
While here also fix a relate bug: unlink(newpath) is in the wrong spot
and ends up removing files even when it shouldn't, so move it early in
the got_worktree_schedule_* error handling.
Finally, update the appropriate test case. It was passing before
because got_worktree_schedule_add returned GOT_ERR_FILE_STATUS, not
because check_file_status failed.
ok stsp@
- Commit:
46ebad135d9dc52eb84d6985393298465fa7b3ff
- From:
- Omar Polo <op@omarpolo.com>
- Date:
style
- Commit:
60aa1fa0d1bdadc23596e5d614d184525b17935c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
augment patch progress callback with hunks info; recover from errors
Augment got_patch_progress_cb by providing the hunks that were applied
with offset (or that failed) and the recoverable error encountered
during the operation (bad status, missing file, ...)
got_patch now proceeds when a file fails to be patched and exits with
GOT_ERR_PATCH_FAILED if no other errors are encountered.
While here, also add a test for the 'hunk applied with offset' case and
shrink test_patch_dont_apply and illegal_status by taking advantage that
'got patch' doesn't stop at the first error. (And add some other cases
to illegal_status too.)
discussed with and ok stsp@
- Commit:
95d683408adee5188de396567e8e9746b703d7dd
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: create missing directories when adding files
ok stsp@
- Commit:
2be5e1a234aeec2c4e8d6b84f0405034ed8664fa
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: keep permissions after patching a file
ok stsp@
- Commit:
b22138f5dbdf02a4800b44caa215bfa102ee321b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
introduce got_patch_progress_cb
This introduce a proper got_patch specific progress callback that is
invoked after processing a patch. It also drops the hackish printf in
the modified case and takes `nop' out of the struct got_patch.
ok stsp
- Commit:
899fcfdf4534887848844329dae7327bd810a432
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add a dry-run/nop mode for got patch
with lots of help from stsp for the manpage bits!
- Commit:
5b67f96efbfbf2e5a3f75f6ab91e45dd3013c77f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: require exact match when removing files