Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

parser doesn't work with diffs from git merge commits

Open
#284 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start by locating the parser code that handles unified diff headers and the regex or parsing path for the @@@ hunk header. Compare its behavior on the shown diff --cc example and a normal diff, then add coverage if the repository has parser tests. Done means merge-commit diffs are recognized without breaking normal patch parsing.

Written by the indexing model from the issue text.

Description

bug

@mpe reported that https://patchwork.ozlabs.org/patch/1129056/ is missing a patch diff.

It appears this is because it's a diff of a git merge commit:

diff --cc arch/powerpc/include/asm/pgtable.h
index bf7d771f342e,64145751b2fd..000000000000
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@@ -140,30 -140,20 +140,44 @@@ static inline void pte_frag_set(mm_cont
  }
  #endif

as opposed to a normal diff

diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index 80ceb458e79c..ef75f590ad3e 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -133,20 +133,27 @@ struct ppc64_stub_entry
  * the stub, but it's significantly shorter to put these values at the
  * end of the stub code, and patch the stub address (32-bits relative

The part that the parser trips on is the unusual format of the @@@ header line because of diff --cc mode.

This isn't too high priority since sending a merge diff to a mailing list is not the normal case, but we might still want to consider fixing the regex to cope with this.

Dominant language
Python
Stars
317
Forks
91
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getpatchwork/patchwork

All issues in getpatchwork/patchwork

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.