Skip to content

[REF] build.sh: Replace diff-highlight with git-delta for git pager - #234

Merged
moylop260 merged 1 commit into
Vauxoo:mainfrom
vauxoo-dev:main-deprecate-diffhighlight-moy
Jul 18, 2026
Merged

[REF] build.sh: Replace diff-highlight with git-delta for git pager#234
moylop260 merged 1 commit into
Vauxoo:mainfrom
vauxoo-dev:main-deprecate-diffhighlight-moy

Conversation

@moylop260

@moylop260 moylop260 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator
  • Install git-delta instead of the unmaintained diff-highlight package
  • 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])):

Before:

  • Screenshot 2026-07-17 at 4 14 55 p m

After:

  • Screenshot 2026-07-17 at 4 14 45 p m

@moylop260 moylop260 self-assigned this Jul 17, 2026
@moylop260

Copy link
Copy Markdown
Collaborator Author

@luisg123v review please

@moylop260
moylop260 requested a review from luisg123v July 17, 2026 22:21

@desdelinux desdelinux left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh Outdated
@moylop260
moylop260 force-pushed the main-deprecate-diffhighlight-moy branch 3 times, most recently from 7366730 to 9643643 Compare July 18, 2026 02:00

@desdelinux desdelinux left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍

Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh
Comment thread src/travis2docker/templates/build.sh Outdated
Comment thread src/travis2docker/templates/build.sh Outdated
@moylop260
moylop260 force-pushed the main-deprecate-diffhighlight-moy branch from 9643643 to 5b55e42 Compare July 18, 2026 02:30
- 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.
@moylop260
moylop260 force-pushed the main-deprecate-diffhighlight-moy branch from 5b55e42 to e1f761f Compare July 18, 2026 02:43
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.98%. Comparing base (bd819e3) to head (e1f761f).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@moylop260
moylop260 merged commit 8af4b06 into Vauxoo:main Jul 18, 2026
18 checks passed
@moylop260
moylop260 deleted the main-deprecate-diffhighlight-moy branch July 18, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants