Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753163AbcDXSSp (ORCPT ); Sun, 24 Apr 2016 14:18:45 -0400 Received: from mail.kernel.org ([198.145.29.136]:60200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107AbcDXSSn (ORCPT ); Sun, 24 Apr 2016 14:18:43 -0400 Date: Sun, 24 Apr 2016 20:18:37 +0200 From: Sebastian Reichel To: Joe Perches Cc: changbin.du@intel.com, apw@canonical.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] checkpatch.pl: add support for checking patch from git repository Message-ID: <20160424181837.GA32104@earth> References: <1461494406-30000-1-git-send-email-changbin.du@intel.com> <1461496965.2726.50.camel@perches.com> <20160424151052.GA12279@earth> <1461514041.2726.59.camel@perches.com> <20160424173012.GA29148@earth> <1461519824.2726.78.camel@perches.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline In-Reply-To: <1461519824.2726.78.camel@perches.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3311 Lines: 77 --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sun, Apr 24, 2016 at 10:43:44AM -0700, Joe Perches wrote: > On Sun, 2016-04-24 at 19:30 +0200, Sebastian Reichel wrote: > > On Sun, Apr 24, 2016 at 09:07:21AM -0700, Joe Perches wrote: > > > On Sun, 2016-04-24 at 17:10 +0200, Sebastian Reichel wrote: > > > > On Sun, Apr 24, 2016 at 04:22:45AM -0700, Joe Perches wrote: > > > > > On Sun, 2016-04-24 at 18:40 +0800, changbin.du@intel.com wrote: > > > > > > This patch add "-g, --git" option that tread FILE as git commits > > > > > > expression. You can specify the git commit hash ID expressions, > > > > > > then these commits from your git repository will be checked. > > > > > Why would anyone want to use checkpatch on commits already in git? > > > > It may be in some non-public development branch. Usually when I > > > > write patches I open a file, change it and commit the result or even > > > > interim result to have backups and other git features available as > > > > soon as possible. All testing is done later. > > > >=20 > > > > So IMHO this is a really useful feature. > > > I think it would be a more useful feature for > > > something like a git pull request rather than > > > a local git repository. > > There are basically two places, where one wants to check patches: > >=20 > > 1. When one creates/modifies patches > > 2. When one wants to apply patches in some tree >=20 > 3. when one wants to accept patches from a pull request. >=20 > > I'm perfectly happy with checkpatch's current behaviour for > > the second task. OTOH during development I would find it useful > > if I can do something like "checkpatch --git HEAD~3..HEAD". >=20 > So you can rework the patches that are already applied? > What would you do if it showed errors/defects? >=20 > Encouraging rework seems inefficient. No, but I can do it with patches I'm currently writing. My workflow when working on patches I write some stuff and commit it. When I have reached a status where the result looks ok to me, I start to prepare it for sending it to the mailinglists. That involves squashing some patches, changing some descriptions, running checkpatch, maybe reorder some patches. IMHO having a --git option is not an encouragement, but makes it less annoying to run it in this use case. -- Sebastian --ew6BAiZeqk4r7MaW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJXHQ37AAoJENju1/PIO/qaJWAP/2xHtbOLlINHISIyk723/4n3 jwda1Z2ggVEuZ2xfBi749JBLzrwJ3f4eZcl1mnrL6Hjl8TtnQf8d2kOl95mbdvt5 P7CPkpPMoPhaFoTDG49VDEhWWNFTBpsqat0xx30nN9ewP0xi0hYCdh7xwM3UXdDs nhIemRklsNNJk0M/YV8HJpB68hgjTzYdgTBd7sowSTjSfk0ZCXtVGjGolhenMXFr LTW9U12ve5KZg5F/Vk49WjLBf8qoX/IoGlHIYL1Li70P76fVyDQWSuZzQxWu4Hpq PBzMRx2gDSE+yMrlrvIClsB+f5oV+g5A6F5lJVDvRq5zzcGRduMGxFAd5Prw7m/F awi02d3e8qwEj7Xz2AFa9xf2wfxCGkM2n50BIsJqjxQD559OdmacfYzKZcyaatOg HKUEerLPQ7aePYjs97v85E5buv09G/+X4q5U1M3KoHH3mNs07YsvVcVRw9HsBa3c Bvhavjd7YJW1XOAIHBzfxeVtx5hamUB8GfyEEDaYgCB9R98C8m0hiefP7/mZ4fmc V2KeI2OihC34EWIAf8WXSYElt5P3q11v+lK19vkkWC0dVxTn9RDs9dmcF4ONohvS 6RHnSRRP7D1fCnMsWN0FyGQktjZ15jzVGolIuxVRPHYFndCAg8lQW27NBicgfXVP cuNI02+WH73rkr4kyfPM =Bjqc -----END PGP SIGNATURE----- --ew6BAiZeqk4r7MaW--