Bug 280004 - Bugzilla misidentifies Git patches
Summary: Bugzilla misidentifies Git patches
Status: New
Alias: None
Product: Services
Classification: Unclassified
Component: Bug Tracker (show other bugs)
Version: unspecified
Hardware: Any Any
: --- Affects Some People
Assignee: Bugmeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-26 10:53 UTC by Dag-Erling Smørgrav
Modified: 2024-06-29 19:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dag-Erling Smørgrav freebsd_committer freebsd_triage 2024-06-26 10:53:49 UTC
When a patch created by `git format-patch` is attached to a bug, Bugzilla automatically sets its type to `application/mbox` (cf. bug #279999).  This is somewhat understandable since the patch is an email, but it is not in fact an mbox file (which would begin with `"From "` rather than `"From: "`), and this prevents viewing the patch directly in the browser.  Would it be possible to modify Bugzilla to always use `text/x-patch` (or otherwise mark the attachment as being a patch) when the file name ends in `.patch`?
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2024-06-28 20:01:05 UTC
(In reply to Dag-Erling Smørgrav from comment #0)
I cannot find any code in Bugzilla that changes content to application/mbox.

Please open a bug with such a patch on bugstest.FreeBSD.org so I can try to
figure out what happens.

Oh, and Cc: me personally on any email.

mcl
Comment 2 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2024-06-28 20:26:25 UTC
I assume it uses either file(1) or libmagic(3)?
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2024-06-29 19:36:17 UTC
(In reply to Dag-Erling Smørgrav from comment #2)
If it does, it's buried deep in a perl dependency somewhere.