{"thread":{"id":"19898","subject":"git diff --chunk-pickaxe?","startedAt":"2009-06-22T12:07:22Z","lastAt":"2009-06-22T13:04:06Z","messageCount":4,"participants":["Nguyen Thai Ngoc Duy","Jakub Narebski","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"116757","messageId":"fcaeb9bf0906220507q45a61dc3w25ad41a4a65a2d5a@mail.gmail.com","threadId":"19898","inReplyTo":null,"subject":"git diff --chunk-pickaxe?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2009-06-22T12:07:22Z","receivedAt":"2009-06-22T12:07:22Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\n\nAnother use case for Git. This time for .po translations. In GNOME,\n.po files are usually updated with intltool, then translations are\nupdated manually by translators. Intltool updates comments too and\nmakes it extremely hard to review translations, something like this:\n\n-#. http://en.wikipedia.org/wiki/HD_DVD\n #: ../data/nautilus.xml.in.h:8\n+#. http://en.wikipedia.org/wiki/HD_DVD\n msgid \"Blank HD DVD Disc\"\n msgstr \"Đĩa HD DVD trắng\"\n\n-#. http://en.wikipedia.org/wiki/Blu-ray_Disc\n #: ../data/nautilus.xml.in.h:10\n+#. http://en.wikipedia.org/wiki/Blu-ray_Disc\n msgid \"Blu-Ray Video\"\n msgstr \"Phim Blu-Ray\"\n\n-#. http://en.wikipedia.org/wiki/Red_Book_(audio_CD_standard)\n #: ../data/nautilus.xml.in.h:12\n+#. http://en.wikipedia.org/wiki/Red_Book_(audio_CD_standard)\n msgid \"Compact Disc Audio\"\n msgstr \"Đĩa nhạc Compact Disc\"\n\nWhat I want is only show diff chunks that add or remove a line that\ndoes not start with '#', something like a chunk-level pickaxe. Any\npointer where to start? It looks like I can start from\nxdi_diff_outf(). Just wanted to make sure I won't follow a wrong way\nfrom the beginning.\n-- \nDuy\n"},{"id":"116759","messageId":"h1nt21$lk4$1@ger.gmane.org","threadId":"19898","inReplyTo":"fcaeb9bf0906220507q45a61dc3w25ad41a4a65a2d5a@mail.gmail.com","subject":"Re: git diff --chunk-pickaxe?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-06-22T12:27:46Z","receivedAt":"2009-06-22T12:27:46Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Nguyen Thai Ngoc Duy wrote:\n\n> What I want is only show diff chunks that add or remove a line that\n> does not start with '#', something like a chunk-level pickaxe. Any\n> pointer where to start? It looks like I can start from\n> xdi_diff_outf(). Just wanted to make sure I won't follow a wrong way\n> from the beginning.\n\nPerhaps you can use textconv here?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"116761","messageId":"4A3F7DAC.3090709@lsrfire.ath.cx","threadId":"19898","inReplyTo":"fcaeb9bf0906220507q45a61dc3w25ad41a4a65a2d5a@mail.gmail.com","subject":"Re: git diff --chunk-pickaxe?","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2009-06-22T12:48:44Z","receivedAt":"2009-06-22T12:48:44Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Nguyen Thai Ngoc Duy schrieb:\n> What I want is only show diff chunks that add or remove a line that\n> does not start with '#', something like a chunk-level pickaxe. Any\n> pointer where to start? It looks like I can start from\n> xdi_diff_outf(). Just wanted to make sure I won't follow a wrong way\n> from the beginning.\n\nHow about creating an external diff driver instead?  It could remove all\nlines starting with '#', or normalize such lines to just '#' in case you\nneed the line numbers to remain unchanged, then write the filtered\nresult into temporary files and compare them with diff.  Perhaps this is\nsufficient for your purposes?  It should be easier to implement.\n\n(Keywords: GIT_EXTERNAL_DIFF, --ext-diff, diff.<name>.command)\n\nRené\n"},{"id":"116762","messageId":"fcaeb9bf0906220604ubb9db7v9ea37416080eecd7@mail.gmail.com","threadId":"19898","inReplyTo":"4A3F7DAC.3090709@lsrfire.ath.cx","subject":"Re: git diff --chunk-pickaxe?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2009-06-22T13:04:06Z","receivedAt":"2009-06-22T13:04:06Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Jun 22, 2009 at 10:48 PM, René\nScharfe<rene.scharfe@lsrfire.ath.cx> wrote:\n> Nguyen Thai Ngoc Duy schrieb:\n>> What I want is only show diff chunks that add or remove a line that\n>> does not start with '#', something like a chunk-level pickaxe. Any\n>> pointer where to start? It looks like I can start from\n>> xdi_diff_outf(). Just wanted to make sure I won't follow a wrong way\n>> from the beginning.\n>\n> How about creating an external diff driver instead?  It could remove all\n> lines starting with '#', or normalize such lines to just '#' in case you\n> need the line numbers to remain unchanged, then write the filtered\n> result into temporary files and compare them with diff.  Perhaps this is\n> sufficient for your purposes?  It should be easier to implement.\n\nYep. Jakub mentioned textconv privately, which should be enough for\nreview purpose. However I'm not completely satisfied with it. Let's\nsay I'm done review and happy with most of the translated strings. I'd\nlike to commit those strings only (whether comments are committed does\nnot really matter because I can filter them out with textconv). If I\nstart \"git add -p\" up, I'm in trouble again.\n-- \nDuy\n"}]}