Commits
- Commit:
27aa2674c93e2cb1cbf231640e9d2ca4969ad008
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
extend test_patch_empty_file() test coverage
Check what happens when patches attempt to edit or delete empty files.
- Commit:
04a87797cb37c4787fdc83040ba75f0ddd60e46d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: fix applying on empty files
if we've reached EOF without finding a match is fine if and only
if the target file is empty, so add this exception.
reported by naddy, ok stsp
- Commit:
2fed5287a0b2737115e6d0dcad77a6b371206cb1
- From:
- Omar Polo <op@omarpolo.com>
- Date:
regress: use seq instead of jot
This is just for -portable since jot is not always available.
ok stsp@
- Commit:
f73bf5bd9e54af999a744c731dfb492e1c9b2b6d
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
replace "(cd path && git cmd)" with "git -C path cmd"
This matches the existing use of "got -r path cmd" and
"git_commit path args".
- Commit:
c8d1a97c8f1deb9cb6fae25376d41d8549d28de4
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
expand support for commit keywords to more got commands
Add the ability to use keywords in the backout, branch, checkout, cherrypick,
and patch commands. Includes some basic regress tests for the new commands,
and also some more contrived test cases for 'got log -c[:]keyword[:(+|-)[N]]'.
ok stsp
- Commit:
bfcdc9e9816dc81c90ce2db28ad9b602ec06b95a
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make 'got patch' display statistics about files with conflicts and rejects
ok op@
- Commit:
e423877dd3fa76444ef448d4272a9f6d3ff32b54
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
properly report a test failure care in test_patch_merge_conflict
- Commit:
684a9a6c2461ac3b30d1f0445ec45c94add21931
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: handle the removal of binary files
Diffs that remove binary files don't have hunks so got patch would skip
over them, treating that part of the diff as "noise".
Different programs outputs a slightly different diff for this kind of
patches, but the "Binary files ... and /dev/null differ" is usually
shown, so try to match it.
The adedd regress test covers got diff, git diff, and OpenBSD'
/usr/bin/diff. CVS diffs will currently fail because the guessed file
name will be wrong. CVS prints the file name in the Index and RCS lines
which got patch currently ignores, and shows an useless path in the
"Binary files /tmp/cvs... and /dev/null differ" line.
Discussed with and ok stsp@
- Commit:
5f94a4e005d31b60559a66dd5fa48b0ed7348d83
- From:
- Omar Polo <op@omarpolo.com>
- Date:
regress: consistently use ed -s
didn't know about -s when writing those tests; saves some output
redirection.
ok jamsek
- Commit:
b2b3fce13e4eca588bb28a869b07f0063568b505
- From:
- Omar Polo <op@omarpolo.com>
- 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:
9cda65e55e3f6d565e83377712e1b81177639cda
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
simplify the way 'got patch' opens a tempfile when reading from stdin
Also add basic test coverage for reading patches from stdin, while here.
ok op@
- Commit:
611e5fc2074d428e17f920dc595496af4dd0dc77
- From:
- Mark Jamsek <mark@jamsek.dev>
- 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:
57b1c3f23ff1e0399a97ed8d7a57fef8471e188f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
patch regress: unify some tests
- Commit:
5f56d41e1acd9cce7202960acad0cab3516e9c26
- From:
- Omar Polo <op@omarpolo.com>
- 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:
38d61ead4d6e9ff3f44b8d6e0e7ff3d02ffcec26
- From:
- Omar Polo <op@omarpolo.com>
- 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:
a92a20426c3078772e9cc8671b4c58ed9a07b9bf
- From:
- Omar Polo <op@omarpolo.com>
- 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:
5dffb1a14a4e706b322f648797d0fea44e684aa8
- From:
- Omar Polo <op@omarpolo.com>
- 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:
f5b0315f0e07bfd36a4eb37d91884fcd8614745a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
aesthetic: rename regress to test_patch_rm_file
drop the "simple" part, there's no "complex" way of removing files.
- Commit:
ed2ff8b9f919f8d0e18e69b038e965924454da58
- From:
- Omar Polo <op@omarpolo.com>
- Date:
augment test_patch_add_line
Try to create a file with more than one line, it would have catched an
issue with my wip diff for ignore whitespaces in got patch.
While here rename the function to drop "simple".
- Commit:
acf749fc600a43d8e276321e8a63cd97484f30bb
- From:
- Omar Polo <op@omarpolo.com>
- Date:
refactor the patch parser
Introduce a patch_start routine that finds the next "diff" header (if
there is one); the idea is to persist some state (commit id and wether
it's a "git diff") while processing the content of the diff. It's
needed because in the case of 'got diff' some information like the
commit id are only present once at the beginning.
As a consequence, the patch parser becomes slightly more robust
(concatenating diffs produced by different means shouldn't confuse it
anymore) and drops the support for "old" got diffs, the ones previous
the introduction of the "commit -/+" header.
ok tracey@
- Commit:
db0dfdd7e5c2c5a38ed7c3291a0615132bcb5945
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got patch: handle git-style diffs for the 3-way merge too
tweak and ok stsp@
- Commit:
9802c41ca727979975e9ee6fbd898dfec7f283c4
- From:
- Omar Polo <op@omarpolo.com>
- 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:
dbc68eedb1de26bf5a444ecad5150b0a243d422b
- From:
- Omar Polo <op@omarpolo.com>
- 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:
d8b5af438b16bcea5568b1d4bfc127567e35e2f6
- From:
- Omar Polo <op@omarpolo.com>
- Date:
use the commitid in the patch diff3 conflict header
suggested by and ok stsp@
- Commit:
55e9459f41acc72438ed2c9f75fdaeae8f5c41d8
- From:
- Omar Polo <op@omarpolo.com>
- 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@