Commits
- Commit:
fc2a50f28951c340fb573e7fcb0646ddf93fde8f
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
use mkstemps(3) instead of mkstemp(3) for opening named temporary files
Allows 'got commit' to use a ".diff" suffix for temporary diff files.
ok op@
- Commit:
a2c162ebaea11f9bd1d46c4cdf5b8f488ebaf58f
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
respect umask when creating or changing files and directories
This behaviour is already documented in got-worktree(5) but wasn't
actually implemented.
ok stsp@
- Commit:
dd73a53d967417134d842edfcf254d126dde3d3d
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
handle unlink(2) errors for mergepath, tmppath, and apath in apply_patch()
ok op@
- Commit:
37e766f45c2e1cc637f4b0a0be03f125e65f8ebd
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
ensure got patch respects x-bit perms for new files
Reported by stsp on IRC: got patch failed to set the x-bit for a new file
despite got diff recording mode 755. Parse got and git diffs for this data
and set file modes accordingly. Tweaked with hint from op.
ok stsp@
- Commit:
aaabf83f2dcb3f5cea3dc1f0227a88c7949e07d4
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
locate_hunk: set mangled earlier for clarity
suggested by stsp@; no functional change.
- Commit:
4f34ed97e0f428b8e9695ed8c18c681c339f7f02
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
allow for ignore whitespaces when matching the hunk
- Commit:
7d8bcb99cc69666c8317a8c1cadc8dc5885a7a77
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got patch: add -c flag to apply at a specified commit
it's useful for e.g. to apply old patches that weren't generated by `got
diff' or git-diff(1) and so lacks the metadata needed for the 3-way
merge.
manpage improvements from and ok stsp@
- Commit:
219482121213057d543880d13747cebe11895075
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
simplify got_patch/apply_patch to call reverse_patch in one place once
Current code is overly complex; it looks if the diff *might* use diff3
merge to postpone reverse_patch until we know for sure. Instead, just
reverse_patch in apply_patch once we know if merge *is* used or not.
- Commit:
f4602cbd0dc693f398f68e64406240dcba6b57c0
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix `got patch -R' when using diff3 merge
`got patch -R' fails spectacularly when applied on a diff that contains
the info of the original blob for the diff3 merge machinery since it
tries to apply the reverse of the patch to the old blob.
change it to run the patch (_not_ reversed) on the old blob and then
swap the arguments to got_diff3_merge which gives us the correct reverse
merge of the diff. while here add a test case too.
reported by naddy, discussed with and ok stsp@
- Commit:
8b925c6ccd3968917253ea191906a1710c40ed2d
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: add back sys/queue.h
Now that the handling of including sys/queue.h is better, there's no
need to remove those lines from the source. Copy the location of those
original sys/queue.h lines from upstream at the same line number, so as
to avoid any conflicts in the future.
- Commit:
dab315a53201f10e04361d5f740a7e921260d60c
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
use got_privsep_flush_imsg instead of reinventing it
ok stsp@
- Commit:
2140c6ec5634ddee572383944f0903ab7b0b829f
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
check for specific chars instead of using isspace(3)
Reminded by naddy and stsp; it was missing a cast to unsigned char to
prevent issues on archs with signed chars and was too broad anyway.
While here, drop an extra check immediately after.
ok stsp@
- Commit:
bb90ca7bc134f43cfda3c6f5e5d0faac9f116820
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got patch: handle mangled whitespaces
This makes 'got patch' try to ignore whitespaces when trying to match a
hunk.
Discused with and ok stsp@
- Commit:
25a880e1b423b178bccafb2f9d92dff53fc82261
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got patch: don't loose the x bit when merging with diff3
This fixes a regression introduced with the diff3 merge: files merged
this way have their permissions resetted after patch.
The issue is due the fact that patch_file looks at a temporary files
and not at the original "old file".
Reported by and ok stsp@
- Commit:
25ec70067dea51a3c3ffd3c5f989853d80b847f7
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
switch 'tog diff' and 'tog blame' to Myers diff for speed
Make the choice of diff algorithm configurable by diff API users.
The got and gotweb programs keep using Patience diffs which are
prettier than Myers. But tog should be as fast as possible since
it is being used interactively. If performance of Patience diff
gets improved later we can consider switching tog back over to it.
ok tracey jamsek
- Commit:
f4ae6ddb59a1edbd016ad7f0e27c2599f8966e19
- From:
- Tracey Emery <tracey@traceyemery.net>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
move got_opentempfd out of open_blob. ok stsp@
- Commit:
19dd85cbe25c418975d46e00cc13b48e26488715
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got patch: handle git-style diffs for the 3-way merge too
tweak and ok stsp@
- Commit:
8afec5d5388b965430c12e3405765ceb552faefa
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
handle blob ids without corresponding blob ids
ok stsp@
- Commit:
762b8e82159007814bc0eaacebf8c2ff2ad34cb5
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got patch: use status G for merged files (and document it)
Suggested by stsp@. This makes possible to tell if 'got patch' used a
merge-base from the repository for the 3-way merge or did a simple
search/replace operation.
While here update the tests to look for the 'G' status and the manpage,
which was also missing the documentation for the 'C' status in got
patch.
ok stsp@
- Commit:
c9a4f4fa65c4e3f4457190460a0b3ec4c50c8d4d
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got patch: ignore blobs not found
since diffs are often enclosed in other formats (e.g. emails) we might
parse something and think it's a blob id when it's not. This should
already happens, but apply_patch is looking for the wrong error due to a
leftover from previous attempts. Reported by stsp@
while here tweak the test_patch_merge_unknown_blob to also try with a
dummy commit id, as now got-read-patch requires it in order to consider
a blob id.
ok stsp@
- Commit:
016bfe4bc2e2f43aea446f3c89e1539235c66fd2
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
use the commitid in the patch diff3 conflict header
suggested by and ok stsp@
- Commit:
0f76ab831bc589bb34a4953cf60c8a05a4ed708c
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got patch: use diff3 to merge the changes
Parse the "blob -" metadata in diffs produced by 'got diff' and use the
original file for patching. Then, use the diff3 with the current
version of the file to merge the differences.
This solves many failures automagically or at least turns them into a
conflict.
ok/improvements stsp@
- Commit:
2d9b683740176cd3223b23ca8bed498f87c0ecbc
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
patch_file: fill tmp with the patched file even in nop mode
future work with diff3 merge will need the fully patched file even in
the nop mode
ok stsp@
- Commit:
2249fadd87cf34f5a23846a876e1a846a82c5c79
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
patch_file: move file ownership to parent
ok stsp@
- Commit:
3b5e1554e5caae9735bd0e242537a2067533c4b3
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
style: remove double semicolon