Commit 4aff646
archive-zip: mark text files in archives
Set the text flag for ZIP archive entries that look like text files so
that unzip -a can be used to perform end-of-line conversions. Info-ZIP
zip does the same.
Detect binary files the same way as git diff and git grep do, namely by
checking for the attribute "diff" and its negation "-diff", and if none
is found by falling back to checking for the presence of NUL bytes in
the first few bytes of the file contents.
7-Zip, Windows' built-in ZIP functionality and Info-ZIP unzip without
the switch -a are not affected by the change and still extract text
files without doing any end-of-line conversions.
NB: The actual end-of-line style used in the archive entries doesn't
matter to unzip -a, as it converts any CR, CRLF and LF to the line end
characters appropriate for the platform it is running on.
Suggested-by: Ulrike Fischer <luatex@nililand.de>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 282616c commit 4aff646
2 files changed
+70
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
192 | 204 | | |
193 | 205 | | |
194 | 206 | | |
| |||
210 | 222 | | |
211 | 223 | | |
212 | 224 | | |
| 225 | + | |
| 226 | + | |
213 | 227 | | |
214 | 228 | | |
215 | 229 | | |
| |||
256 | 270 | | |
257 | 271 | | |
258 | 272 | | |
| 273 | + | |
| 274 | + | |
259 | 275 | | |
260 | 276 | | |
261 | 277 | | |
| |||
300 | 316 | | |
301 | 317 | | |
302 | 318 | | |
303 | | - | |
304 | 319 | | |
305 | 320 | | |
306 | 321 | | |
| |||
328 | 343 | | |
329 | 344 | | |
330 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
331 | 349 | | |
332 | 350 | | |
333 | 351 | | |
| |||
361 | 379 | | |
362 | 380 | | |
363 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
364 | 385 | | |
365 | 386 | | |
366 | 387 | | |
| |||
405 | 426 | | |
406 | 427 | | |
407 | 428 | | |
| 429 | + | |
| 430 | + | |
408 | 431 | | |
409 | 432 | | |
410 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
36 | 67 | | |
37 | 68 | | |
38 | 69 | | |
| |||
41 | 72 | | |
42 | 73 | | |
43 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
44 | 87 | | |
45 | 88 | | |
46 | 89 | | |
| |||
70 | 113 | | |
71 | 114 | | |
72 | 115 | | |
73 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
74 | 119 | | |
75 | 120 | | |
76 | 121 | | |
| |||
0 commit comments