Skip to content

aiFeatures-mjs.patch not (correctly) imported/applied #52

Description

@iskunk

(Reposted from the desktop repo bug)

This concerns src/browser/components/preferences/config/aiFeatures-mjs.patch. I've noticed that after running surfer import, even though I see this...

[...]
  [FINISH] Apply /tmp/zen-browser-desktop/src/browser/components/places/content/editBookmark-js.patch
  [FINISH] Apply /tmp/zen-browser-desktop/src/browser/components/places/content/editBookmarkPanel-inc-xhtml.patch
  [FINISH] Apply /tmp/zen-browser-desktop/src/browser/components/preferences/config/aiFeatures-mjs.patch    <-----
  [FINISH] Apply /tmp/zen-browser-desktop/src/browser/components/preferences/dialogs/syncChooseWhatToSync-js.patch
  [FINISH] Apply /tmp/zen-browser-desktop/src/browser/components/preferences/dialogs/syncChooseWhatToSync-xhtml.patch
[...]

...the file it targets shows no modifications:

$ git status browser/components/preferences/config/aiFeatures.mjs 
On branch zen_browser
nothing to commit, working tree clean

I looked at the Git patching code in surfer. I see that it first tries to reverse-apply the patch---presumably in case the patch had previously been applied, in any event ignoring errors---and then applies the patch normally.

Well, when I tried that process manually, I got an odd result...

build@xtradeb-resolute-con:/tmp/zen-browser-desktop/engine$ git apply -R -v ../src/browser/components/preferences/config/aiFeatures-mjs.patch 
Checking patch browser/components/preferences/config/aiFeatures.mjs...
Hunk #1 succeeded at 1178 (offset -544 lines).
Applied patch browser/components/preferences/config/aiFeatures.mjs cleanly.

build@xtradeb-resolute-con:/tmp/zen-browser-desktop/engine$ git apply -v ../src/browser/components/preferences/config/aiFeatures-mjs.patch 
Checking patch browser/components/preferences/config/aiFeatures.mjs...
Hunk #1 succeeded at 1178 (offset 544 lines).
Applied patch browser/components/preferences/config/aiFeatures.mjs cleanly.

build@xtradeb-resolute-con:/tmp/zen-browser-desktop/engine$ git diff browser/components/preferences/config/aiFeatures.mjs
(no output)

I notice that the patch diff is surrounded by a stack of brackets and braces. I think this is a case where the patch needs to be generated with more lines of context than the default, so that the patching program doesn't get confused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions