Changes between Version 11 and Version 12 of Phabricator


Ignore:
Timestamp:
Sep 14, 2019, 5:40:24 AM (5 years ago)
Author:
Krinkle
Comment:

update git-based arc workaround

Legend:

Unmodified
Added
Removed
Modified
  • Phabricator

    v11 v12  
    5959This will apply the latest diff from a revision Dn (`n` being an integer) to your working copy.
    6060
    61 If you use a Git-based mirror (such as https://github.com/0ad/0ad), this may fail because Arcanist demands to find the latest SVN revision in the git-log which might not be mirrored yet. It does this slowly searching the full git history for a commit message containing `git-svn-id: @{latest-revision}`, which it will then never find. (Upstream issue: https://secure.phabricator.com/T9044). The `--force` and `--skip-dependencies` options do not prevent this issue. To workaround this, use `arc patch --patch /file/to.diff` instead, like so (the download url can be copied from the "Download Raw Diff" link in the web interface):
     61=== Download a patch (Git) ===
     62If you use a Git-based mirror (such as https://github.com/0ad/0ad), then using `arc diff` may fail because Arcanist demands to find the latest SVN revision in the git-log which might not be mirrored yet. Arcanist tries to searching the full git commit history for a commit message containing `git-svn-id: @{latest-revision}`, which it will then never find. (Upstream issue: https://secure.phabricator.com/T9044). The `--force` and `--skip-dependencies` options to `arc diff` do not solve this issue.
     63
     64As a workaround, you can download the diff from Phabricator Differential directly (using the "Download Raw Diff" link), and then applying it using the `patch` command. Below is a function you can use (e.g. place in `~/.bash_profile`).
    6265
    6366{{{#!sh
    64 curl -L 'https://code.wildfiregames.com/D1991?download=true' > /tmp/arc.patch
    65 arc patch --patch /tmp/arc.patch
     67# From https://git.io/JeYgl#L292
     68function pull0ad {
     69        if [ -z "$1" ]; then
     70                echo "usage: ${FUNCNAME[0]} Dnnnn"
     71                return 1
     72        fi
     73        patch="$1"
     74        curl "https://code.wildfiregames.com/{$patch}?download=true" -L 2>/dev/null > /tmp/arc.diff
     75        git checkout -q -B "arcpatch_$patch" origin/master
     76        git apply -p0 --index -v /tmp/arc.diff
     77        git commit -q -m "D2079"
     78}
     79
     800ad (master)$ pull0ad D1991
     81 Checking patch...
     82 Applied patch!
     83
     840ad (arcpatch_D1991)$
    6685}}}
    6786