{"thread":{"id":"31933","subject":"git-gui: textconv not used on unstaged files","startedAt":"2012-10-24T18:33:35Z","lastAt":"2012-11-27T20:37:12Z","messageCount":4,"participants":["Peter Oberndorfer","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"201818","messageId":"5088347F.50503@arcor.de","threadId":"31933","inReplyTo":null,"subject":"git-gui: textconv not used on unstaged files","fromName":"Peter Oberndorfer","fromEmail":"kumbayo84@arcor.de","sentAt":"2012-10-24T18:33:35Z","receivedAt":"2012-10-24T18:33:35Z","isPatch":false,"sender":{"key":"kumbayo84@arcor.de","avatar":"https://avatars.githubusercontent.com/u/1041267?v=4"},"body":"Hi,\n\ni am using a textconv filter to display .doc files as plain text.\nIt seems git gui does not use this textconv filter for displaying new \nunstaged files\n(other files? = _O)\nIt seems diff.tcl start_show_diff calls show_other_diff because of this.\nThis manually loads the file and does not care about textconv filters.\n\nIs this manual loading really necessary or can't we just ask git?\nIf it is can it be modified to use the textconv filter?\n\nThanks,\nGreetings Peter\n\n.gitattributes:\n*.doc    diff=astextplain\n\ngitconfig:\n[diff \"astextplain\"]\n     textconv = astextplain\n"},{"id":"203916","messageId":"50B3D0D2.6060308@arcor.de","threadId":"31933","inReplyTo":"5088347F.50503@arcor.de","subject":"Re: git-gui: textconv not used on unstaged files","fromName":"Peter Oberndorfer","fromEmail":"kumbayo84@arcor.de","sentAt":"2012-11-26T20:28:02Z","receivedAt":"2012-11-26T20:28:02Z","isPatch":false,"sender":{"key":"kumbayo84@arcor.de","avatar":"https://avatars.githubusercontent.com/u/1041267?v=4"},"body":"On 2012-10-24 20:33, Peter Oberndorfer wrote:\n> Hi,\n>\n> i am using a textconv filter to display .doc files as plain text.\n> It seems git gui does not use this textconv filter for displaying new unstaged files\n> (other files? = _O)\n> It seems diff.tcl start_show_diff calls show_other_diff because of this.\n> This manually loads the file and does not care about textconv filters.\n>\n> Is this manual loading really necessary or can't we just ask git?\n> If it is can it be modified to use the textconv filter?\n>\nDoes anybody have a idea which git command\nwould output the diff of a untracked file against /dev/null?\nSo I can show the textconved version of the file in git gui.\n(and not reinvent the code to apply textconv already in git)\n\nThanks,\nGreetings Peter\n\n>\n> .gitattributes:\n> *.doc    diff=astextplain\n>\n> gitconfig:\n> [diff \"astextplain\"]\n>     textconv = astextplain\n"},{"id":"203923","messageId":"7vk3t8qe4s.fsf@alter.siamese.dyndns.org","threadId":"31933","inReplyTo":"50B3D0D2.6060308@arcor.de","subject":"Re: git-gui: textconv not used on unstaged files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-26T20:54:11Z","receivedAt":"2012-11-26T20:54:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter Oberndorfer <kumbayo84@arcor.de> writes:\n\n> Does anybody have a idea which git command would output the diff\n> of a untracked file against /dev/null?\n\nThe \"--no-index\" option is meant as a bolt-on to let you use various\nfeatures of \"git diff\" that is missing from other people's \"diff\" in\na context where git does not know anything about that file.  It\nshould be usable even outside a git repository.\n\n    $ git diff --no-index /dev/null new-file.txt\n\nI do not know offhand (and didn't bother to check) if textconv\napplies, though.  It does need access to a git repository as it\nreads from the $GIT_DIR/config to learn what to do.\n"},{"id":"204022","messageId":"50B52478.2070701@arcor.de","threadId":"31933","inReplyTo":"7vk3t8qe4s.fsf@alter.siamese.dyndns.org","subject":"Re: git-gui: textconv not used on unstaged files","fromName":"Peter Oberndorfer","fromEmail":"kumbayo84@arcor.de","sentAt":"2012-11-27T20:37:12Z","receivedAt":"2012-11-27T20:37:12Z","isPatch":false,"sender":{"key":"kumbayo84@arcor.de","avatar":"https://avatars.githubusercontent.com/u/1041267?v=4"},"body":"On 2012-11-26 21:54, Junio C Hamano wrote:\n> Peter Oberndorfer <kumbayo84@arcor.de> writes:\n>\n>> Does anybody have a idea which git command would output the diff\n>> of a untracked file against /dev/null?\n> The \"--no-index\" option is meant as a bolt-on to let you use various\n> features of \"git diff\" that is missing from other people's \"diff\" in\n> a context where git does not know anything about that file.  It\n> should be usable even outside a git repository.\n>\n>     $ git diff --no-index /dev/null new-file.txt\n>\n> I do not know offhand (and didn't bother to check) if textconv\n> applies, though.  It does need access to a git repository as it\n> reads from the $GIT_DIR/config to learn what to do.\nHi,\n\nthis seems to work when adding the --textconv option.\nI will try to see if I can modify git gui to use this command\nwhen clicking a unstaged file.\n\nThanks,\nGreetings Peter\n"}]}