Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • scripts
  • checkpatch.pl
Find file BlameHistoryPermalink
  • Geert Uytterhoeven's avatar
    checkpatch: use patch subject when reading from stdin · c7f574d0
    Geert Uytterhoeven authored Jun 04, 2020
    While "git am" can apply an mbox file containing multiple patches (e.g.
    as created by b4[1], or a patch bundle downloaded from patchwork),
    checkpatch does not have proper support for that.  When operating on an
    mbox, checkpatch will merge all detected tags, and complain falsely about
    duplicates:
    
        WARNING: Duplicate signature
    
    As modifying checkpatch to reset state in between each patch is a lot of
    work, a simple solution is splitting the mbox into individual patches, and
    invoking checkpatch for each of them.  Fortunately checkpatch can read a
    patch from stdin, so the classic "formail" tool can be used to split the
    mbox, and pipe all individual patches to checkpatch:
    
        formail -s scripts/checkpatch.pl < my-mbox
    
    However, when reading a patch file from standard input, checkpatch calls
    it "Your patch", and reports its state as:
    
        Your patch has style problems, please review.
    
    or:
    
        Your patch has no obvious style problems and is ready for submission.
    
    Hence it can be difficult to identify which patches need to be reviewed
    and improved.
    
    Fix this by replacing "Your patch" by (the first line of) the email
    subject, if present.
    
    Note that "git mailsplit" can also be used to split an mbox, but it will
    create individual files for each patch, thus requiring cleanup afterwards.
    Formail does not have this disadvantage.
    
    [1] https://git.kernel.org/pub/scm/utils/b4/b4.git
    
    [joe@perches.com: reduce cpu usage]
      Link: http://lkml.kernel.org/r/c9d89bb24c7414142414c60371e210fdcf4617d2.camel@perches.com
    
    
    Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Cc: Joe Perches <joe@perches.com>
    Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
    Link: http://lkml.kernel.org/r/20200505132613.17452-1-geert+renesas@glider.be
    
    
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    c7f574d0
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7