git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Chris Webster <chris@webstech.net>
Cc: "Chris. Webster via GitGitGadget" <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] ci: github action - add check for whitespace errors
Date: Thu, 24 Sep 2020 02:51:29 -0400	[thread overview]
Message-ID: <20200924065129.GB1851751@coredump.intra.peff.net> (raw)
In-Reply-To: <CAGT1KpVmeT+nT1-Pfwa_M8BptFYwRTL4ofM0k6UOOzkYh0kucw@mail.gmail.com>

On Tue, Sep 22, 2020 at 03:17:54PM -0700, Chris Webster wrote:

> On Tue, Sep 22, 2020 at 10:07 AM Jeff King <peff@peff.net> 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

  reply	other threads:[~2020-09-24  6:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  7:28 [PATCH] ci: github action - add check for whitespace errors Chris. Webster via GitGitGadget
2020-09-22 17:07 ` Jeff King
2020-09-22 17:55   ` Junio C Hamano
2020-09-22 22:41     ` Chris Webster
2020-10-09  5:00       ` Chris Webster
2020-10-09 13:20         ` Johannes Schindelin
2020-10-09 16:23           ` Junio C Hamano
2020-10-09 17:59             ` Jeff King
2020-10-09 18:13               ` Junio C Hamano
2020-10-09 18:18                 ` Jeff King
2020-10-09 18:56                   ` Junio C Hamano
2020-10-10  5:26                     ` Chris Webster
2020-10-10  6:29                       ` Junio C Hamano
2020-09-22 22:17   ` Chris Webster
2020-09-24  6:51     ` Jeff King [this message]
2020-09-25  5:10       ` Chris Webster
2020-09-25  6:44         ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200924065129.GB1851751@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=chris@webstech.net \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).