From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 8562D1F4B4 for ; Thu, 24 Sep 2020 06:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727188AbgIXGvm (ORCPT ); Thu, 24 Sep 2020 02:51:42 -0400 Received: from cloud.peff.net ([104.130.231.41]:39026 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726979AbgIXGvb (ORCPT ); Thu, 24 Sep 2020 02:51:31 -0400 Received: (qmail 1595 invoked by uid 109); 24 Sep 2020 06:51:30 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 24 Sep 2020 06:51:30 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 18438 invoked by uid 111); 24 Sep 2020 06:51:32 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 24 Sep 2020 02:51:32 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 24 Sep 2020 02:51:29 -0400 From: Jeff King To: Chris Webster Cc: "Chris. Webster via GitGitGadget" , git@vger.kernel.org Subject: Re: [PATCH] ci: github action - add check for whitespace errors Message-ID: <20200924065129.GB1851751@coredump.intra.peff.net> References: <20200922170745.GA541915@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Sep 22, 2020 at 03:17:54PM -0700, Chris Webster wrote: > On Tue, Sep 22, 2020 at 10:07 AM Jeff King wrote: > > - for a linear branch on top of master, using the commit count will > > work reliably. But I suspect it would run into problems if there were > > ever a merge on a PR (e.g., back-merging from master), where we'd be > > subject to how `git log` linearizes the commits. That's not really a > > workflow I'd expect people to use with git.git, but it would probably > > be easy to make it more robust. Does the PR object provide the "base" > > oid, so we could do "git log $base..$head"? > > GitGitGadget PR linting is going to flag merges in the PR and request > a rebase. If I understand correctly, that means back-merging is not > part of the workflow. Yeah, I would definitely be surprised to see it used with a git PR, but I didn't realize there was other linting that would actually complain about it. > The checkout is limited to improve performance > and reduce resources. In the PR object, the base is the branch. The > github api would need to be used to get more detailed information. > The "base" is not really part of the checkout so it can not be > referenced in the git log command (without doing a larger checkout). Hmm. git clone --shallow-exclude=HEAD --single-branch -b $branch git log --check _almost_ works. The problem is that the shallow graft means that the bottom commit looks like it introduces every file. We really want to graft at HEAD^, but the server side only accepts exact refnames. You could work around it with a followup: git fetch --deepen 1 which is getting a bit convoluted. I suspect you may also have to abandon the "checkout" action and do this manually. Definitely not worth it compared to your solution for a PR, but maybe worth it if it lets us do the same thing for arbitrary branches. -Peff