Commit Graph

7 Commits

Author SHA1 Message Date
Maxime Coste
2d9c84e363 Another try to fix blame-jump-message test flakyness 2024-02-18 19:00:33 +11:00
Johannes Altmanninger
f786fceb73 Fix flaky blame-jump-message test
This test fails occasionally[1] because the order of events and the
number of events varies across runs.

We should always call draw_status exactly 3 times:

                        [*git*][fifo]
                        [*git*]
    Commit subject etc. [*git*]

Let's check it this way.
This seems to work; this time I took the time to run it a couple
hundred times and in Cirrus CI.

[1] https://builds.sr.ht/~mawww/job/1151239
2024-02-18 15:45:03 +11:00
Johannes Altmanninger
5f0729f155 rc tools git: fix initial position of blame of deleted line
When running git blame in a "git show" buffer, we annotate the youngest
version of the file that has the line referenced by the diff line
at cursor.
In case the cursor is on an added or context line, we simply show
the version from the surrounding commit.

When the cursor is on a deleted line, we show the parent commit,
which still has the deleted line.  However there is a bug: we use
the line number in the new version of the file. Fix that.
2024-02-18 10:15:03 +11:00
Johannes Altmanninger
a85b81e08a test tools patch: disable when perl is missing
This failed on freebsd_gcc task in
Cirrus because Perl is not installed, see
https://github.com/mawww/kakoune/pull/5101/checks?check_run_id=21604156722
2024-02-18 10:05:55 +11:00
Johannes Altmanninger
e1fd2351e0 rc git.kak: fix blame-jump for commits with special characters
Commit 53d9b9b67 (Escaping tweak in git.kak, 2024-02-06) broke
blame-jump when the commit subject contains a single quote.
(Also on unbalanced "{" which is a rare edge case but we already have
it in our Git history.)
git.kak assumes that filenames don't contain ' or unbalanced {,
but we can't really make that assumption about people's names or
commit subjects.

Unfortunately the escaping here is very messy. We need to pass
arbitrary text to callbacks; maybe we should have closures that can
capture private temporary registers.
2024-02-13 19:24:24 +11:00
Johannes Altmanninger
11e7e2964c rc tools patch: skip patch message signature, fixing diff application
Patches as produced by "git format-patch" have a trailing signature
that is separated from the body by a line with "-- " on it.  By default
it contains the Git version.  We erroneously include this signature
in the diff we pipe to patch, which fails to apply as a result.

Add a targeted fix to suppress these signatures.
2024-01-26 09:55:52 +11:00
Johannes Altmanninger
1276e67ef7 rc tools patch: skip spurious diff header for files with no changes
Since :patch transforms its inputs into context-only lines, we can
easily get into a state where a file diff has only context lines.
git apply does not accept a "diff" without any hunk, so let's skip
that.
2024-01-22 07:02:31 +01:00