[REF] build.sh: Replace diff-highlight with git-delta for git pager - #234
Conversation
|
@luisg123v review please |
desdelinux
left a comment
There was a problem hiding this comment.
Right direction — the pip diff-highlight package is unmaintained and is the source of those Python 3.12 SyntaxWarnings, and the delta setup itself matches upstream's recommended config (diffFilter = delta --color-only for git add -p, DarkNeon is a valid theme, and less stays installed as the underlying pager).
Requesting changes for one real issue: this template runs on whatever {{ image }} each project uses, and on pre-23.04 Ubuntu bases (15.0 is focal, 16.0/17.0 are jammy) the current form breaks the whole apt transaction, the git pager, and merges — details inline. It works as-is on noble, which I assume is where the screenshots come from.
7366730 to
9643643
Compare
desdelinux
left a comment
There was a problem hiding this comment.
All points from my previous review are addressed: delta now comes from the pinned GitHub releases .deb using the same fail-safe pattern as ngrok (so the main apt transaction is never at risk on older bases), the gitconfig is gated on command -v delta, zdiff3 and the redundant side-by-side are gone, and the comment was updated.
I also verified the constructed URL against the release: git-delta_0.18.2_amd64.deb exists under the 0.18.2 tag of dandavison/delta.
A few non-blocking nits inline. LGTM 👍
9643643 to
5b55e42
Compare
- Install git-delta instead of the unmaintained diff-highlight package - Latest change 2years ago https://github.com/tk0miya/diff-highlight - Configure delta as the default Git pager - Enable line numbers and navigation - Set DarkNeon as the default syntax theme - Enable zdiff3 merge conflict style - Fix the following warning running `git diff` /usr/lib/python3/dist-packages/highlights/command.py:33: SyntaxWarning: invalid escape sequence '\[' stripped = re.sub('\x1b\[[0-9;]*m', '', rawline.rstrip("\r\n")) /usr/lib/python3/dist-packages/highlights/command.py:36: SyntaxWarning: invalid escape sequence '\w' if re.match('^(@|commit \w+$)', stripped): /usr/lib/python3/dist-packages/highlights/command.py:39: SyntaxWarning: invalid escape sequence '\-' if not re.match('^(?:[ +\-@\\\\]|diff)', stripped): /usr/lib/python3/dist-packages/highlights/pprint.py:181: SyntaxWarning: invalid escape sequence '\s' is_word = lambda s: re.match('^(%s+|\s+)$' % chars, s[0]) /usr/lib/python3/dist-packages/highlights/pprint.py:183: SyntaxWarning: invalid escape sequence '\-' marks = '[ !"#$%&\'()*+,\-./:;<=>?@\[\\]^_{|}~]' /usr/lib/python3/dist-packages/highlights/pprint.py:186: SyntaxWarning: invalid escape sequence '\s' is_mark = lambda s: re.match('^(%s+|\s+)$' % marks, s[0]) /usr/lib/python3/dist-packages/highlights/pprint.py:232: SyntaxWarning: invalid escape sequence '\s' if (inserted[0][0] == "+" and re.match('^\s*$', inserted[1][0]) and /usr/lib/python3/dist-packages/highlights/pprint.py:233: SyntaxWarning: invalid escape sequence '\s' deleted[0][0] == "-" and re.match('^\s*$', deleted[1][0])): - Install git-delta from .deb Not all Ubuntu versions used across Odoo images have git-delta available in their apt repos, so install it directly from the official .deb release instead.
5b55e42 to
e1f761f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #234 +/- ##
=======================================
Coverage 80.98% 80.98%
=======================================
Files 7 7
Lines 610 610
Branches 90 90
=======================================
Hits 494 494
Misses 83 83
Partials 33 33 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
git-deltainstead of the unmaintaineddiff-highlightpackagegit diff/usr/lib/python3/dist-packages/highlights/command.py:33: SyntaxWarning: invalid escape sequence '\[' stripped = re.sub('\x1b\[[0-9;]*m', '', rawline.rstrip("\r\n")) /usr/lib/python3/dist-packages/highlights/command.py:36: SyntaxWarning: invalid escape sequence '\w' if re.match('^(@|commit \w+$)', stripped): /usr/lib/python3/dist-packages/highlights/command.py:39: SyntaxWarning: invalid escape sequence '\-' if not re.match('^(?:[ +\-@\\\\]|diff)', stripped): /usr/lib/python3/dist-packages/highlights/pprint.py:181: SyntaxWarning: invalid escape sequence '\s' is_word = lambda s: re.match('^(%s+|\s+)$' % chars, s[0]) /usr/lib/python3/dist-packages/highlights/pprint.py:183: SyntaxWarning: invalid escape sequence '\-' marks = '[ !"#$%&\'()*+,\-./:;<=>?@\[\\]^_{|}~]' /usr/lib/python3/dist-packages/highlights/pprint.py:186: SyntaxWarning: invalid escape sequence '\s' is_mark = lambda s: re.match('^(%s+|\s+)$' % marks, s[0]) /usr/lib/python3/dist-packages/highlights/pprint.py:232: SyntaxWarning: invalid escape sequence '\s' if (inserted[0][0] == "+" and re.match('^\s*$', inserted[1][0]) and /usr/lib/python3/dist-packages/highlights/pprint.py:233: SyntaxWarning: invalid escape sequence '\s' deleted[0][0] == "-" and re.match('^\s*$', deleted[1][0])):Before:
After: