Search code examples
gitphabricatorarcanistgpg-signature

Signing arc diff commits without using git config commit.gpgsign


Is there a way to get arc diff to submit a signed diff commit like git commit -S does? I know that git config commit.gpgsign true will get arc diff to start signing commits, but I'm looking for some way that won't start trying to sign everything else I do in that repository if I forget to turn commit.gpgsign off.


Solution

  • The easiest way is to create a custom shell script, that run these commands you mentioned in order and use it for singed commits, an example would be:

    #!/bin/bash
    git config commit.gpgsign true
    path-to-arc-bin diff
    git config commit.gpgsign false
    

    and save it as arc-diff-signed command. And link it to /usr/local/bin/ so you conveniently run it in shell where ever you are.