[PATCH] D73075: [utils] Add initial llvm-patch helper to manage patches.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 01:17:24 PST 2020


mstorsjo added a comment.

I tested using this for applying one patch (D73139 <https://reviews.llvm.org/D73139>), but ran into the following issues:

- The patch that `differential.getrawdiff` returns had

  --- a/lld/test/COFF/comdat-gcc-compatibility.s
  +++ b/lld/test/COFF/comdat-gcc-compatibility.s

for a newly added file. (For a newly added file, the git diff should normally say `--- /dev/null`.) This causes `git apply` to fail with not finding the file to patch. As the revision has been updated now that it has been pushed, it no longer does that (as it picks a newer diff). (I'm not really sure how the original patch was made and uploaded though, as the "Download raw diff" button on the web (for the last revision before committing it) gives a diff that contains

  Index: lld/test/COFF/comdat-gcc-compatibility.s
  ===================================================================
  --- lld/test/COFF/comdat-gcc-compatibility.s
  +++ lld/test/COFF/comdat-gcc-compatibility.s

- If I manually worked around this, to get a patch that `git apply` managed to commit, the newly added file still was missing, as `git apply` doesn't add it to the index, and the final `git commit -a` doesn't pick it up unless specifically added
- At this point, I still had to manually word-wrap the commit message to fit normal git standards. (Not sure if arcanist does this automatically either though.)
- I looked into the right conduit calls for fetching the user name and email for getting a proper git author field. Finding the user name seems fairly straightforward using `differential.revision.search` followed by `user.search`. That does give the realname of the author, but it doesn't give the email address. A later dig into this indicates that it isn't really doable, https://stackoverflow.com/a/25569692/3115956 saying "Phabricator does not expose email addresses, by design. We consider this information to be private.". Despite this, the email is easily visible if e.g. browsing the mails that it sends out...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73075/new/

https://reviews.llvm.org/D73075





More information about the llvm-commits mailing list