dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Engestrom <eric.engestrom@imgtec.com>
To: Robert Foss <robert.foss@collabora.com>
Cc: Zach Reizner <zachr@chromium.org>,
	Emil Velikov <emil.l.velikov@gmail.com>,
	ML dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH hwc v1] drm_hwcomposer: Add CONTRIBUTING file
Date: Thu, 28 Sep 2017 11:43:03 +0100	[thread overview]
Message-ID: <20170928104303.3manmm7b4oh6so5i@imgtec.com> (raw)
In-Reply-To: <1506538549.2462.3.camel@collabora.com>

On Wednesday, 2017-09-27 18:55:49 +0000, Robert Foss wrote:
> > > +- When submitting new code please follow the naming conventions
> > > documented
> > > +  in the generated documentation. Also please make full use of all
> > > the helpers and
> > > +  convenience macros provided by drm_hwcomposer. The below command
> > > can help you
> > > +  with formatting of your patches:
> > > +  git diff | clang-format-diff-3.5 -p 1 -style=file
> > > +
> > 
> > One could wire that in the pre-merge hook on the server side.
> > It should be quite lightweight, although I'm not sure about the
> > integration with FDO's Debian(?) setup ;-)
> 
> Yeah, me neither. Maybe asking Daniel Stone about how this should be
> done is the next step.
> 

The package `clang-format-3.5` would need to be installed, but other than
that the integration would be rather trivial; just add this to the
`update` hook:

  format_diff=$(git diff -U0 $oldrev..$newrev | clang-format-diff-3.5 -p1)
  if [ -n "$format_diff" ]; then
    echo 'Code is not formatted properly; please apply this change and try again:'
    printf -- '----8<----\n%s\n---->8----\n' "$format_diff"
    exit 1
  fi

Note that if malformatted commits are to be rejected, it might be best
to have a pre-commit hook on each client (will need manual setup on each
clone) to re-format the code before being committed and therefore before
being sent to ML, to avoid patchwork losing track of reformatted patches.

Alternatively, such patches could be accepted with just a warning being
printed when pushing, but there's a good chance such warnings would just
end up being ignored.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2017-09-28 10:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22  0:37 [PATCH hwc v1] drm_hwcomposer: Add CONTRIBUTING file Robert Foss
2017-09-22 16:22 ` Zach Reizner
2017-09-22 16:23 ` Sean Paul
2017-09-22 18:22   ` Robert Foss
2017-09-27 14:42 ` Emil Velikov
2017-09-27 18:55   ` Robert Foss
2017-09-27 21:16     ` Rob Herring
2017-09-28 10:43     ` Eric Engestrom [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170928104303.3manmm7b4oh6so5i@imgtec.com \
    --to=eric.engestrom@imgtec.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=robert.foss@collabora.com \
    --cc=zachr@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox