{"thread":{"id":"61408","subject":"Chunk header @@@ counts wrong?","startedAt":"2024-05-02T16:51:59Z","lastAt":"2024-05-02T20:47:36Z","messageCount":3,"participants":["Johan Walles","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"493925","messageId":"CAKtyTbevS7W-X4qoO=uPnHmXCEtKhqycD8DZZY-oK-z0p4CEAQ@mail.gmail.com","threadId":"61408","inReplyTo":null,"subject":"Chunk header @@@ counts wrong?","fromName":"Johan Walles","fromEmail":"johan.walles@gmail.com","sentAt":"2024-05-02T16:51:47Z","receivedAt":"2024-05-02T16:51:59Z","isPatch":false,"sender":{"key":"johan.walles@gmail.com","avatar":null},"body":"Are these counts produced by git 2.44.0 correct, and in that case how?\n\nThe header says \"@@@ -6,6 -6,60 +6,60 @@@\", meaning \"six rows in v1,\nsixty in v2 and sixty in the merge result\".\n\nI think v2 contains 57 lines, but git says 60. What am I missing?\n\nI'm counting:\n* 6 space-space (context) lines\n* 51 plus-space (new to v1 but already in v2) lines\n* 3 plus-plus (new to both v1 and v2) lines\n\nDoesn't this mean that v2 contains 57 (51 plus-space + 6 context) lines?\n\nWhy does git say that v2 contains 60 lines?\n\nOriginally reported here: https://github.com/walles/riff/issues/63\n\n  Regards /Johan\n\n\"\ndiff --cc ansible/roles/zfsbootmenu/tasks/main.yaml\nindex 73fa864,08648fa..0000000\n--- a/ansible/roles/zfsbootmenu/tasks/main.yaml\n+++ b/ansible/roles/zfsbootmenu/tasks/main.yaml\n@@@ -6,6 -6,60 +6,60 @@@\n        - zfsbootmenu\n      state: present\n\n++<<<<<<< HEAD\n++=======\n+ - name: Create ESP mdadm config\n+   template:\n+     src: mdadm.conf.j2\n+     dest: /etc/mdadm.conf\n+     owner: root\n+     group: root\n+     mode: 0644\n+   when: esp_mdadm_array is defined\n+\n+ - name: Install dropbear\n+   xbps:\n+     pkg:\n+       - dropbear\n+       - mkinitcpio-dropbear\n+     state: present\n+\n+ - name: Create dropbear directory\n+   file:\n+     path: /etc/dropbear\n+     owner: root\n+     group: root\n+     mode: 0755\n+     state: directory\n+\n+ - name: Create dropbear keys\n+   command:\n+     cmd: /usr/bin/dropbearkey -t {{ item }} -f\n/etc/dropbear/dropbear_{{ item }}_host_key\n+     creates: /etc/dropbear/dropbear_{{ item }}_host_key\n+   loop:\n+     - rsa\n+     - ecdsa\n+     - ed25519\n+\n+ - name: Create dropbear authorised keys\n+   template:\n+     src: authorized_keys.j2\n+     dest: /etc/dropbear/root_key\n+     owner: root\n+     group: root\n+     mode: 0644\n+     lstrip_blocks: true\n+\n+ - name: Create dropbear config\n+   template:\n+     src: dropbear.conf.j2\n+     dest: /etc/dropbear/dropbear.conf\n+     owner: root\n+     group: root\n+     mode: 0644\n+     lstrip_blocks: true\n+\n++>>>>>>> 8eec118 (fixup! ansible/roles/zfsbootmenu: add role)\n  - name: Create zfsbootmenu config\n    template:\n      src: config.yaml.j2\n* Unmerged path ansible/host_vars/foo.yaml\n\"\n"},{"id":"493947","messageId":"xmqqmsp8c5d3.fsf@gitster.g","threadId":"61408","inReplyTo":"CAKtyTbevS7W-X4qoO=uPnHmXCEtKhqycD8DZZY-oK-z0p4CEAQ@mail.gmail.com","subject":"Re: Chunk header @@@ counts wrong?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-05-02T20:43:04Z","receivedAt":"2024-05-02T20:43:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johan Walles <johan.walles@gmail.com> writes:\n\n> Are these counts produced by git 2.44.0 correct, and in that case how?\n>\n> The header says \"@@@ -6,6 -6,60 +6,60 @@@\", meaning \"six rows in v1,\n> sixty in v2 and sixty in the merge result\".\n>\n> I think v2 contains 57 lines, but git says 60. What am I missing?\n\n> I'm counting:\n> * 6 space-space (context) lines\n> * 51 plus-space (new to v1 but already in v2) lines\n\nI think you failed to count three lines in v2 and merge result, they\nlook like \"<<< HEAD\" \"======\" \">>> 8eec118\"; new to v1 but already\nin v2 lines are 54, not 51, no?\n\n> * 3 plus-plus (new to both v1 and v2) lines\n>\n> Doesn't this mean that v2 contains 57 (51 plus-space + 6 context) lines?\n>\n> Why does git say that v2 contains 60 lines?\n>\n> Originally reported here: https://github.com/walles/riff/issues/63\n>\n>   Regards /Johan\n>\n> \"\n> diff --cc ansible/roles/zfsbootmenu/tasks/main.yaml\n> index 73fa864,08648fa..0000000\n> --- a/ansible/roles/zfsbootmenu/tasks/main.yaml\n> +++ b/ansible/roles/zfsbootmenu/tasks/main.yaml\n> @@@ -6,6 -6,60 +6,60 @@@\n>         - zfsbootmenu\n>       state: present\n>\n> ++<<<<<<< HEAD\n> ++=======\n> + - name: Create ESP mdadm config\n> +   template:\n> +     src: mdadm.conf.j2\n> +     dest: /etc/mdadm.conf\n> +     owner: root\n> +     group: root\n> +     mode: 0644\n> +   when: esp_mdadm_array is defined\n> +\n> + - name: Install dropbear\n> +   xbps:\n> +     pkg:\n> +       - dropbear\n> +       - mkinitcpio-dropbear\n> +     state: present\n> +\n> + - name: Create dropbear directory\n> +   file:\n> +     path: /etc/dropbear\n> +     owner: root\n> +     group: root\n> +     mode: 0755\n> +     state: directory\n> +\n> + - name: Create dropbear keys\n> +   command:\n> +     cmd: /usr/bin/dropbearkey -t {{ item }} -f\n> /etc/dropbear/dropbear_{{ item }}_host_key\n> +     creates: /etc/dropbear/dropbear_{{ item }}_host_key\n> +   loop:\n> +     - rsa\n> +     - ecdsa\n> +     - ed25519\n> +\n> + - name: Create dropbear authorised keys\n> +   template:\n> +     src: authorized_keys.j2\n> +     dest: /etc/dropbear/root_key\n> +     owner: root\n> +     group: root\n> +     mode: 0644\n> +     lstrip_blocks: true\n> +\n> + - name: Create dropbear config\n> +   template:\n> +     src: dropbear.conf.j2\n> +     dest: /etc/dropbear/dropbear.conf\n> +     owner: root\n> +     group: root\n> +     mode: 0644\n> +     lstrip_blocks: true\n> +\n> ++>>>>>>> 8eec118 (fixup! ansible/roles/zfsbootmenu: add role)\n>   - name: Create zfsbootmenu config\n>     template:\n>       src: config.yaml.j2\n> * Unmerged path ansible/host_vars/foo.yaml\n> \"\n"},{"id":"493948","messageId":"xmqqfrv0c55p.fsf@gitster.g","threadId":"61408","inReplyTo":"xmqqmsp8c5d3.fsf@gitster.g","subject":"Re: Chunk header @@@ counts wrong?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-05-02T20:47:30Z","receivedAt":"2024-05-02T20:47:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> * 51 plus-space (new to v1 but already in v2) lines\n>\n> I think you failed to count three lines in v2 and merge result, they\n> look like \"<<< HEAD\" \"======\" \">>> 8eec118\"; new to v1 but already\n> in v2 lines are 54, not 51, no?\n\nAh, I take that back.  These have ++ that are new relative to parent\n#1 and parent #2 (i.e. only the tentative merge result has them).\nSo, yes, I think you are counting correctly.\n\nSorry, but I do not know what's counting the hunk length numbers in\ntoday's code offhand, so I won't be digging it further for now.\n"}]}