git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] ci: github action - add check for whitespace errors

From
Chris Webster <chris@webstech.net>
Date
Sep 25, 2020, 05:10 UTC
Message-ID
<CAGT1KpU6zkvr9QQQqez6x1cVsvhxmkU9gG5T0QYC8yCgnOPN1Q@mail.gmail.com>
In-Reply-To
<20200924065129.GB1851751@coredump.intra.peff.net>
On Wed, Sep 23, 2020 at 11:51 PM Jeff King <peff@peff.net> wrote:
Show 9 quoted lines
>   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

Thanks for the other possibilities (I have much to learn). The first step to increase the commit count is addressing this very problem.

> 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.

The PR solution works because fixed values are available from GitHub (both repos are present and accounted for). A push action for branches could have issues with the state of the GitHub repo versus the local repo. What happens if the base branch is not current on GitHub? Is HEAD reliable? What if the branch has been re-used with a back-merge? How do you limit the check in this case? Based on my demonstrated lack of knowledge these concerns may be addressable.

The original push solution pulled an arbitrary depth knowing GitGitGadget had a limit of 30 commits and then limited the check to post merge commits, again knowing merges were flagged. Not pretty but workable in the confines of the GitGitGadget workflow.

A generic push solution (with an opt out?) could be a separate file or replace this (yea).

I appreciate the feedback, ...chris.

Previous: Jeff KingNext: Jeff King
Message 16 of 17 in “ci: github action - add check for whitespace errors”
  1. ci: github action - add check for whitespace errorsChris. Webster via GitGitGadget, Sep 22, 2020
  2. Jeff KingSep 22, 2020
  3. Junio C HamanoSep 22, 2020
  4. Chris WebsterSep 22, 2020
  5. Chris WebsterOct 9, 2020
  6. Johannes SchindelinOct 9, 2020
  7. Junio C HamanoOct 9, 2020
  8. Jeff KingOct 9, 2020
  9. Junio C HamanoOct 9, 2020
  10. Jeff KingOct 9, 2020
  11. Junio C HamanoOct 9, 2020
  12. Chris WebsterOct 10, 2020
  13. Junio C HamanoOct 10, 2020
  14. Chris WebsterSep 22, 2020
  15. Jeff KingSep 24, 2020
  16. Chris WebsterSep 25, 2020
  17. Jeff KingSep 25, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.