[llvm-dev] GitHub Hooks

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Jul 19 19:53:25 PDT 2016


On 19 July 2016 at 18:06, Tim Northover <t.p.northover at gmail.com> wrote:
> Ah, that too probably. I was confusing that with fast-forward-only,
> which I think is what protected branches without status give you.

Just thought I'd send my current progress so that effort isn't wasted
over night if others are thinking along similar lines. I'm attaching
an extremely rough-and-ready verifier here. I'm expecting lots more
bells and whistles would be needed, more user-friendly error
reporting, and more verification steps (at the moment it checks a
linear history only).

To use it:

Setup:
1. Generate a GitHub OAuth token for "repo:status" and "git config
llvm.token $TOK" with it.
2. Similarly config llvm.user to your GitHub username
3. Add "llvm" as a remote, pointing to the protected repository (in my
test-case git at github.com:TNorthover/tmp.git, usually
git at github.com:llvm/llvm.git).

Routine use:
3. Work on your feature branch (not the protected one, or at least a
fork of it otherwise step 4 will fail)
4. git push the feature to your fork.
5. Run "python git-llvm-check.py --branch master" in the git dir[1]
6. Run "git push llvm HEAD:master".

Tim.

[1] In the usual case, the branch can be inferred (you'll be
developing on a fork of $thing, and want to push to $thing). But when
you don't have 2 GitHub accounts to test with it gets more
complicated. Simplest workaround is "--branch master".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: git-llvm-check.py
Type: text/x-python-script
Size: 2980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160719/16ac4795/attachment.bin>


More information about the llvm-dev mailing list