git signoff+ and review+
Andreas Schneider
asn at samba.org
Wed Mar 25 07:02:19 UTC 2020
On Tuesday, 24 March 2020 12:51:46 CET David Disseldorp wrote:
> Hi,
>
> On Tue, 24 Mar 2020 11:00:11 +0100, Andreas Schneider via samba-technical
wrote:
> > Hello,
> >
> > as a daily task I have to sign commits and also add my review tag after
> > inspection.
> >
> > As git-filter-branch has been deprecated and the replacement is
> > git-filter-
> > repo [1], I've written some really nice python tools to make my life
> > easier.
> >
> > In a git repository I and do:
> >
> > git signoff+ # Add my signoff to commits I authored.
> > git signoff+ --by metze # Sign commits authored by metze,
> >
> > # because he forgot :-)
> >
> > git review+ # Add my RB tag to commits I'm not the
> >
> > # author of or which has my sign tag
> >
> > git review+ --by metze # Add review by metze
>
> These look helpful. Keep in mind that git comes with a built-in
> interpret-trailers command, which is also pretty useful for this (and
> handles duplicates, etc.). I have the following in my git config:
>
> [alias]
> # add a Reviewed-by: David Disseldorp <ddiss at samba.org> trailer to top
> commit msg rbm = "!f() { \
> t=\"Reviewed-by: $(git config --get user.name) <$(git config --get
> user.email)>\"; \ GIT_EDITOR=\"git interpret-trailers --trailer \\\"$t\\\"
> --in-place\" git commit --amend; \ }; f"
>
> # add a trailing Reviewed-by: $1 trailer to top commit msg
> rbo = "!f() { \
> t=\"Reviewed-by: $1\"; \
> GIT_EDITOR=\"git interpret-trailers --trailer \\\"$t\\\" --in-place\"
> git commit --amend; \ }; f"
>
> For batch reviewed-bys, I use "git rebase -i" and run "git rbm" via
> execute hook.
'git review+' is doing that for you in one go. It is also really fast. Also I
don't see that intper-trailers checks e.g. the author of the commit.
git-repo-filter is available on Fedora and openSUSE as a package.
Andreas
--
Andreas Schneider asn at samba.org
Samba Team www.samba.org
GPG-ID: 8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
More information about the samba-technical
mailing list