-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'git-format-patch' is able to generate binary patches. Fortunately, these are quite easy to spot since they're explicitly labelled as such. Add support for parsing these to the parser. Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #463 (cherry picked from commit 6ba50aa)
- Loading branch information
1 parent
f4c0503
commit 78e257d
Showing
5 changed files
with
142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From 3029b9604cf2b2eaa5f38167f59246e2fa026eb5 Mon Sep 17 00:00:00 2001 | ||
From: Stephen Finucane <stephen@that.guru> | ||
Date: Wed, 11 May 2022 10:59:59 +0100 | ||
Subject: [PATCH] Add a single pixel bitmap image | ||
To: foo@example.com | ||
|
||
Demonstrate how Git generates a patch for a binary file. | ||
|
||
Signed-off-by: Stephen Finucane <stephen@that.guru> | ||
--- | ||
pixel.bmp | Bin 0 -> 142 bytes | ||
1 file changed, 0 insertions(+), 0 deletions(-) | ||
create mode 100644 pixel.bmp | ||
|
||
diff --git pixel.bmp pixel.bmp | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..9710347a13c4336e7dbaafa69af0e44a40c21172 | ||
GIT binary patch | ||
literal 142 | ||
zcmZ?r?PGv|E+AC{#Eft(0hV9^lFE7z3>E+r{}~t{2+VVG4=P5;5yxUeQzj#`nE?RC | ||
Ceh3`^ | ||
|
||
literal 0 | ||
HcmV?d00001 | ||
|
||
-- | ||
2.35.3 | ||
|
40 changes: 40 additions & 0 deletions
40
patchwork/tests/mail/0026-git-add-mixed-binary-text-files.mbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From 499d36d946a6f1f654eebad500742eb5c3057569 Mon Sep 17 00:00:00 2001 | ||
From: Stephen Finucane <stephen@that.guru> | ||
Date: Wed, 11 May 2022 10:33:58 +0100 | ||
Subject: [PATCH] Add a single pixel bitmap image, minimal script | ||
To: foo@example.com | ||
|
||
Demonstrate how Git generates a patch for a binary file when mixed with | ||
other file types. | ||
|
||
Signed-off-by: Stephen Finucane <stephen@that.guru> | ||
--- | ||
pixel.bmp | Bin 0 -> 142 bytes | ||
quit.sh | 3 +++ | ||
2 files changed, 3 insertions(+) | ||
create mode 100644 pixel.bmp | ||
create mode 100644 quit.sh | ||
|
||
diff --git pixel.bmp pixel.bmp | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..9710347a13c4336e7dbaafa69af0e44a40c21172 | ||
GIT binary patch | ||
literal 142 | ||
zcmZ?r?PGv|E+AC{#Eft(0hV9^lFE7z3>E+r{}~t{2+VVG4=P5;5yxUeQzj#`nE?RC | ||
Ceh3`^ | ||
|
||
literal 0 | ||
HcmV?d00001 | ||
|
||
diff --git quit.sh quit.sh | ||
new file mode 100644 | ||
index 0000000..f5f929a | ||
--- /dev/null | ||
+++ quit.sh | ||
@@ -0,0 +1,3 @@ | ||
+#/usr/bin/env bash | ||
+echo "Wuh wuh" | ||
+exit 1 | ||
-- | ||
2.35.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From 434fe33a7ed28cc8cd0b344e55f0be2c74f1a58c Mon Sep 17 00:00:00 2001 | ||
From: Stephen Finucane <stephen@that.guru> | ||
Date: Wed, 11 May 2022 11:46:10 +0100 | ||
Subject: [PATCH] Make changes to an existing binary file | ||
To: foo@example.com | ||
|
||
Signed-off-by: Stephen Finucane <stephen@that.guru> | ||
--- | ||
pixel.bmp | Bin 142 -> 0 bytes | ||
1 file changed, 0 insertions(+), 0 deletions(-) | ||
|
||
diff --git pixel.bmp pixel.bmp | ||
index 9710347a13c4336e7dbaafa69af0e44a40c21172..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 | ||
GIT binary patch | ||
literal 0 | ||
HcmV?d00001 | ||
|
||
literal 142 | ||
zcmZ?r?PGv|E+AC{#Eft(0hV9^lFE7z3>E+r{}~t{2+VVG4=P5;5yxUeQzj#`nE?RC | ||
Ceh3`^ | ||
|
||
-- | ||
2.35.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters