{"thread":{"id":"692","subject":"git-diff-files -z output","startedAt":"2005-05-22T17:05:40Z","lastAt":"2005-05-22T17:49:28Z","messageCount":6,"participants":["Thomas Glanzmann","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"3755","messageId":"20050522170540.GO15178@cip.informatik.uni-erlangen.de","threadId":"692","inReplyTo":null,"subject":"git-diff-files -z output","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2005-05-22T17:05:40Z","receivedAt":"2005-05-22T17:05:40Z","isPatch":false,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\nis this correct?\n\n(faui00u) [~/work/git/yagf] git-diff-files -z | xxd\n0000000: 3a31 3030 3634 3420 3030 3030 3030 2031  :100644 000000 1\n0000010: 6663 3834 3639 6366 6332 6631 3436 3332  fc8469cfc2f14632\n0000020: 3734 3333 3363 3062 6562 6162 3065 3465  74333c0bebab0e4e\n0000030: 3439 3562 6336 6220 3030 3030 3030 3030  495bc6b 00000000\n0000040: 3030 3030 3030 3030 3030 3030 3030 3030  0000000000000000\n0000050: 3030 3030 3030 3030 3030 3030 3030 3030  0000000000000000\n0000060: 0064 6966 662e 6800 6469 6666 2e68 003a  .diff.h.diff.h.:\n0000070: 3130 3037 3535 2031 3030 3735 3520 6464  100755 100755 dd\n0000080: 3633 6533 3535 3463 3137 6431 3861 3039  63e3554c17d18a09\n0000090: 3137 3931 3038 3264 3164 3632 3864 3835  1791082d1d628d85\n00000a0: 3162 3933 3038 2030 3030 3030 3030 3030  1b9308 000000000\n00000b0: 3030 3030 3030 3030 3030 3030 3030 3030  0000000000000000\n00000c0: 3030 3030 3030 3030 3030 3030 3030 3000  000000000000000.\n00000d0: 6769 7400 6769 7400                      git.git.\n\nEg the fields are seperated by space/tab and only the filenames by \\0?\n\nI am adopting to the new format.\n\nAre the fields supposed to be seperated by space or tab?\n\nstatic void diff_flush_raw(struct diff_filepair *p)\n{\n        /*\n         * We used to reject rename/copy but new diff-raw can express them.\n         */\n        printf(\":%06o %06o %s \",\n               p->one->mode, p->two->mode, sha1_to_hex(p->one->sha1));\n        printf(\"%s%c%s%c%s%c\",\n               sha1_to_hex(p->two->sha1), inter_name_termination,\n               p->one->path, inter_name_termination,\n               p->two->path, line_termination);\n}\n\n\nGruesse,\n\tThomas\n"},{"id":"3757","messageId":"7v3bsffadn.fsf@assigned-by-dhcp.cox.net","threadId":"692","inReplyTo":"20050522170540.GO15178@cip.informatik.uni-erlangen.de","subject":"Re: git-diff-files -z output","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-22T17:17:40Z","receivedAt":"2005-05-22T17:17:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"TG\" == Thomas Glanzmann <sithglan@stud.uni-erlangen.de> writes:\n\nTG> I am adopting to the new format.\nTG> Are the fields supposed to be seperated by space or tab?\n\nPlease see Documentation/diff-format.txt; find the below in the\narchive for the full description of why we wanted this format\nupdate.\n\n    From:\tJunio C Hamano <junkio@cox.net>\n    Subject: Re: updated design for the diff-raw format.\n    To:\tgit@vger.kernel.org\n    Date:\tSat, 21 May 2005 16:17:33 -0700\n\n    (second of the replayed message, with blessing from Linus)\n\n    Date: Sat, 21 May 2005 11:24:31 -0700 (PDT)\n    From: Linus Torvalds <torvalds@osdl.org>\n    To: Junio C Hamano <junkio@cox.net>\n    Subject: Re: [PATCH 3/3] Diff overhaul, adding the other half of copy detection.\n    Message-ID: <Pine.LNX.4.58.0505211107160.2206@ppc970.osdl.org>\n\n    On Sat, 21 May 2005, Junio C Hamano wrote:\n    > \n    > Once we start to think of it this way, it becomes quite tempting\n    > to change the diff-raw format to actually match the above\n    > concept.\n\n    I agree, and I was going to suggest changing the \"raw\" diff output for all\n    the same reasons. So I think you should do it, as the old format was based\n    on not really knowing where this all would take us. I think your proposed\n    format is visually nicer, and it's obviously more flexible.\n\n\n"},{"id":"3758","messageId":"20050522172737.GB17570@cip.informatik.uni-erlangen.de","threadId":"692","inReplyTo":"7v3bsffadn.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-diff-files -z output","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2005-05-22T17:27:37Z","receivedAt":"2005-05-22T17:27:37Z","isPatch":false,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\n\n> Please see Documentation/diff-format.txt; find the below in the\n> archive for the full description of why we wanted this format\n> update.\n\ngot it thanks. I read that eMail before. But I thought that the\ntab -> space was a mistake, but it wasn't. So I am fine. I use the\nfollowing code fragment to match it. Gitweb and co have to be adopted as\nwell:\n\nsub\nprocess_git_diff_output\n{\n        my $str = shift || die(\"Need Input\");\n\n        my @in  = split(\"\\0\", $str);\n        my @out = ();\n\n        while (@in) {\n                my @tmp = split(' ', shift(@in));\n                push(@tmp, shift(@in), shift(@in));\n                push(@out, [@tmp]);\n        }\n\n        return(@out);\n}\n\n\tThomas\n"},{"id":"3759","messageId":"20050522173243.GA18500@cip.informatik.uni-erlangen.de","threadId":"692","inReplyTo":"20050522172737.GB17570@cip.informatik.uni-erlangen.de","subject":"Re: git-diff-files -z output","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2005-05-22T17:32:43Z","receivedAt":"2005-05-22T17:32:43Z","isPatch":false,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\nthis is better (it strips the colon from the first mode):\n\nsub\nprocess_git_diff_output\n{\n        my $str = shift || die(\"Need Input\");\n\n        my @in  = split(\"\\0\", $str);\n        my @out = ();\n\n        while (@in) {\n                my @tmp = split(' ', shift(@in));\n                $tmp[0] =~ s/^://g;\n                push(@tmp, shift(@in), shift(@in));\n                push(@out, [@tmp]);\n        }\n\n        return(@out);\n}\n\n\tThomas\n"},{"id":"3760","messageId":"20050522173846.GB18500@cip.informatik.uni-erlangen.de","threadId":"692","inReplyTo":"20050522173243.GA18500@cip.informatik.uni-erlangen.de","subject":"Re: git-diff-files -z output","fromName":"Thomas Glanzmann","fromEmail":"sithglan@stud.uni-erlangen.de","sentAt":"2005-05-22T17:38:46Z","receivedAt":"2005-05-22T17:38:46Z","isPatch":false,"sender":{"key":"sithglan@stud.uni-erlangen.de","avatar":null},"body":"Hello,\n\n>                 $tmp[0] =~ s/^://g;\n                                   ^ -> This is useless.\n\n\tThomas\n"},{"id":"3766","messageId":"7vwtprduc7.fsf@assigned-by-dhcp.cox.net","threadId":"692","inReplyTo":"20050522173243.GA18500@cip.informatik.uni-erlangen.de","subject":"Re: git-diff-files -z output","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-22T17:49:28Z","receivedAt":"2005-05-22T17:49:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"TG\" == Thomas Glanzmann <sithglan@stud.uni-erlangen.de> writes:\n\nI do not do Porcelain, but...\n\nTG> this is better (it strips the colon from the first mode):\n\nI think you are also stripping the colon at the beginning of the\nfilename if I am not mistaken.  Also posting only this part is\nnot very useful because I cannot tell what parameter this sub is\nbeing fed.  I am presuming that you are either feeding a single\nline from DIFF_FORMAT_HUMAN format output, or three lines\n(unless dealing with 'U' entry in which case you have to do only\na single line) from DIFF_FORMAT_MACHINE format output.  When in\ndoubt, seeing what diff-helper does would help.\n\n"}]}