View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000176 | file | General | public | 2020-08-05 12:24 | 2020-08-09 16:57 |
Reporter | vinc17 | Assigned To | christos | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 5.38 | ||||
Fixed in Version | 5.40 | ||||
Summary | 0000176: Messages for Git objects have an incorrect id | ||||
Description | The messages for Git objects have an incorrect id: only the first sequence of decimal digits is retrieved instead of the full sequence of hexadecimal digits. This is due to a bad regexp in "magic/Magdir/git". | ||||
Steps To Reproduce | $ echo "commit d617e0c0ca8fac42361b00c8861eb2a59ab7a7d8" | file - /dev/stdin: Git commit 617 | ||||
Additional Information | This issue is present in file 5.38 (current version in Debian/unstable), but according to https://github.com/file/file/blob/master/magic/Magdir/git it is still not fixed (thus present in file 5.39 too, I suppose). To fix it, replace each occurrence of "[0-9]+" by "[0-9a-f]+" (I've attached a patch). After this change, $ echo "commit d617e0c0ca8fac42361b00c8861eb2a59ab7a7d8" | file - /dev/stdin: Git commit d617e0c0ca8fac42361b00c8861eb2a59ab7a7d8 | ||||
Tags | No tags attached. | ||||
|
file-git-messages.patch (566 bytes)
Description: Fix messages for Git objects. Author: Vincent Lefevre <vincent@vinc17.net> Last-Update: 2020-08-05 --- file-5.38-a/magic/Magdir/git 2019-10-04 18:46:29.000000000 +0000 +++ file-5.38-b/magic/Magdir/git 2020-08-05 11:56:09.704167516 +0000 @@ -4,10 +4,10 @@ # git: file(1) magic for Git objects 0 string blob\040 ->5 regex [0-9]+ Git blob %s +>5 regex [0-9a-f]+ Git blob %s 0 string tree\040 ->5 regex [0-9]+ Git tree %s +>5 regex [0-9a-f]+ Git tree %s 0 string commit\040 ->7 regex [0-9]+ Git commit %s +>7 regex [0-9a-f]+ Git commit %s |
|
Thanks! |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-08-05 12:24 | vinc17 | New Issue | |
2020-08-05 12:24 | vinc17 | File Added: file-git-messages.patch | |
2020-08-09 16:57 | christos | Assigned To | => christos |
2020-08-09 16:57 | christos | Status | new => assigned |
2020-08-09 16:57 | christos | Status | assigned => resolved |
2020-08-09 16:57 | christos | Resolution | open => fixed |
2020-08-09 16:57 | christos | Fixed in Version | => 5.40 |
2020-08-09 16:57 | christos | Note Added: 0003444 |