{"thread":{"id":"27746","subject":"Gitweb 1.7.5 and Textconv Configuration","startedAt":"2011-07-02T09:50:12Z","lastAt":"2011-07-06T15:13:30Z","messageCount":13,"participants":["Al Haraka","Jeff King","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"170767","messageId":"CALWDD1x-_rEx+c9bpAgVk-hvnGz1bt0mbJoDkSjZkbe=gLscUg@mail.gmail.com","threadId":"27746","inReplyTo":null,"subject":"Gitweb 1.7.5 and Textconv Configuration","fromName":"Al Haraka","fromEmail":"alharaka@gmail.com","sentAt":"2011-07-02T09:50:12Z","receivedAt":"2011-07-02T09:50:12Z","isPatch":false,"sender":{"key":"alharaka@gmail.com","avatar":"https://gravatar.com/avatar/8b6a6240c7c2bb87c4666923249f62cafed06f8c77ed90e189feafd1e627be79?d=mp&s=160"},"body":"All,\n\nI am sorry to bother the list with this question, but I have spent a\nlot of time searching and have never really found what I was looking\nfor.  No one had answers to my question on IRC either.  I am running\ngit/gitweb 1.7.5 on shared hosting (Dreamhost, if that matters).  I\ncompiled it and followed a tutorial\n(https://github.com/tmacam/private-git-on-dreamhost) on setting it up\nin my environment.  It worked great, but I have some stuff that is not\nsource code, namely PDF's and ODP/ODT/ODS files I want to see changes\nfrom beyond knowing they are binary files.  Enter the official wiki\npage explaining textconv\n(https://git.wiki.kernel.org/index.php/GitTips#How_to_use_git_to_track_OpenDocument_.28OpenOffice.2C_Koffice.29_files.3F).\n\nSo, I tried different variations of this, specifically for repos.\nNow, I have tried it globally as that was tedious and it was not\nworking anyway. That works some of the time if I try commands over the\nconsole (git log  -p for quick testing), but never in Gitweb.  It\ncontinues to only say they are differing binary files.  Does Gitweb\n1.7.5 support the use of this?  Is there something special I must do?\nBelow is my current config:\n\n[dreamhost-server]$ git config --list --global\ndiff.odf.textconv=odt2txt\ndiff.odf.binary=false\ndiff.pdf.textconv=pdftotext\ndiff.pdf.binary=false\ncore.attributesfile=~/.gitattributes\n[dreamhost-server]$ more ~/.gitattributes\n*.odf diff=odf\n*.odt diff=odf\n*.odp diff=odf\n*.pdf diff=pdf\n[jabbah]$ more ~/repos/gitweb_config.perl\n# where is the git binary?\n$GIT = \"/home/dreamhost_account/opt/bin/git\";\n# where are our git project repositories?\n$projectroot = $ENV{'GIT_PROJECT_ROOT'};\n# what do we call our projects in the gitweb UI?\n$home_link_str = \"~\";\n#  where are the files we need for gitweb to display?\n@stylesheets = (\"gitweb.css\");\n$logo = \"git-logo.png\";\n$favicon = \"/favicon.png\";\n# what do we call this site?\n$site_name = \"my personal git repos\";\n\nThe diff.<driver>.binary addition is new.  I tried with or without\nthem, hoping mention of this on a mailing list thread from a while\nback might help.  It was all in vain.  I also tried fiddling with\n$diff_opts for Gitweb after scanning the man page for git-diff, but I\nam not sure if there is anything helpful I missed.  I no this is a\nnewbish question, I am sure, so I apologize in advance.\n\nBest,\n_AJS\n"},{"id":"170772","messageId":"20110702104313.GA10245@sigill.intra.peff.net","threadId":"27746","inReplyTo":"CALWDD1x-_rEx+c9bpAgVk-hvnGz1bt0mbJoDkSjZkbe=gLscUg@mail.gmail.com","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-07-02T10:43:13Z","receivedAt":"2011-07-02T10:43:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jul 02, 2011 at 12:50:12PM +0300, Al Haraka wrote:\n\n> So, I tried different variations of this, specifically for repos.\n> Now, I have tried it globally as that was tedious and it was not\n> working anyway. That works some of the time if I try commands over the\n> console (git log  -p for quick testing), but never in Gitweb.  It\n> continues to only say they are differing binary files.  Does Gitweb\n> 1.7.5 support the use of this?  Is there something special I must do?\n> Below is my current config:\n\nThe default gitweb configuration doesn't allow textconv (or external\ndiff) for security reasons; it would mean repo owners could execute\narbitrary commands as the gitweb user.\n\nIf that's OK for your site, you can probably enable it with:\n\n  push @diff_opts, '--allow-textconv';\n\nI don't know that anybody has tested that, though. It will use textconv\n_everywhere_ in gitweb, including the \"format-patch\" invocation for\nshowing raw patches of commits. It might make sense in the long run for\ngitweb to have another variable like @diff_opts that is used for\nhuman-readable output (e.g., the HTML output, but not anything you might\nimport to a tool).\n\n-Peff\n"},{"id":"170773","messageId":"20110702104437.GA10538@sigill.intra.peff.net","threadId":"27746","inReplyTo":"20110702104313.GA10245@sigill.intra.peff.net","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-07-02T10:44:37Z","receivedAt":"2011-07-02T10:44:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jul 02, 2011 at 06:43:13AM -0400, Jeff King wrote:\n\n> The default gitweb configuration doesn't allow textconv (or external\n> diff) for security reasons; it would mean repo owners could execute\n> arbitrary commands as the gitweb user.\n> \n> If that's OK for your site, you can probably enable it with:\n> \n>   push @diff_opts, '--allow-textconv';\n\nOops, this option is just called \"--textconv\". I got it confused with\nthe flag in the code, which is ALLOW_TEXTCONV.\n\n-Peff\n"},{"id":"170774","messageId":"CALWDD1woB0ytL6T-DwD92f824dnpz0mek=SYgz5jwqR0efnkpw@mail.gmail.com","threadId":"27746","inReplyTo":"20110702104437.GA10538@sigill.intra.peff.net","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Al Haraka","fromEmail":"alharaka@gmail.com","sentAt":"2011-07-02T11:14:30Z","receivedAt":"2011-07-02T11:14:30Z","isPatch":false,"sender":{"key":"alharaka@gmail.com","avatar":"https://gravatar.com/avatar/8b6a6240c7c2bb87c4666923249f62cafed06f8c77ed90e189feafd1e627be79?d=mp&s=160"},"body":"On Sat, Jul 2, 2011 at 1:44 PM, Jeff King <peff@peff.net> wrote:\n> On Sat, Jul 02, 2011 at 06:43:13AM -0400, Jeff King wrote:\n>\n>> The default gitweb configuration doesn't allow textconv (or external\n>> diff) for security reasons; it would mean repo owners could execute\n>> arbitrary commands as the gitweb user.\n>>\n>> If that's OK for your site, you can probably enable it with:\n>>\n>>   push @diff_opts, '--allow-textconv';\n\nJust tried it.\n\n$ more ~/repos/gitweb_config.perl\n# where is the git binary?\n$GIT = \"/home/dreamhost_account/opt/bin/git\";\n# where are our git project repositories?\n$projectroot = $ENV{'GIT_PROJECT_ROOT'};\n# what do we call our projects in the gitweb UI?\n$home_link_str = \"~\";\n#  where are the files we need for gitweb to display?\n@stylesheets = (\"gitweb.css\");\n$logo = \"git-logo.png\";\n$favicon = \"/favicon.png\";\n# what do we call this site?\n$site_name = \"my personal git repos\";\n# Enable textconv\npush @diff_opts, '--textconv';\n\nReloaded the webpage; still does *not* show text diffs.  Any way to\ndebug what is going wrong?\n\n> Oops, this option is just called \"--textconv\". I got it confused with\n> the flag in the code, which is ALLOW_TEXTCONV.\n\nNo worries.  You are steering my in the right direction, typos or not.\n\n> -Peff\n>\n\n\n\n-- \nAlexander J. Stein\nCell:  +974 70013750\nEmail: alharaka@gmail.com\nSkype: alexander.j.stein\n"},{"id":"170782","messageId":"20110702185724.GA14390@sigill.intra.peff.net","threadId":"27746","inReplyTo":"CALWDD1woB0ytL6T-DwD92f824dnpz0mek=SYgz5jwqR0efnkpw@mail.gmail.com","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-07-02T18:57:24Z","receivedAt":"2011-07-02T18:57:24Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jul 02, 2011 at 02:14:30PM +0300, Al Haraka wrote:\n\n> # Enable textconv\n> push @diff_opts, '--textconv';\n> \n> Reloaded the webpage; still does *not* show text diffs.  Any way to\n> debug what is going wrong?\n\nYou could try setting \"$ENV{GIT_TRACE} = 1\", which will dump all of the\ngit commands being called to stderr (and presumaby your log). That would\ndouble-check that the option is being passed.\n\nI think what might be happening, though, is that git does not do a good\njob checking .gitattributes files inside trees; it only checks the\n.gitattributes in the working tree, even if you are diffing a tree. But\nin the case of a bare repository, we don't even have a working tree at\nall.\n\nYou can try working around it like this:\n\n  cd /path/to/bare/repo.git\n  git show HEAD:.gitattributes >info/attributes\n\nwhich will make the repository-wide non-version-controlled gitattributes\nthe same as the last committed version. The problem is that it won't be\nautomatically updated as you commit and push changes to .gitattributes.\n\nSo I think it's a bug in git. It seems like the tree being diffed is an\nobvious place for git to load gitattributes from. Though I'm not sure of\nthe precedence rules for interacting with the version of .gitattributes\nin the worktree (if any). In a situation like this:\n\n  $ git checkout master\n  $ git show master~50\n\nYou would probably want the more recent worktree attributes to take\nprecedence over the ones in the older tree.\n\nBut in this:\n\n  $ git checkout master~50\n  $ git show master\n\nyou would probably want the more recent tree attributes to take\nprecedence over what's in the working tree.\n\n-Peff\n"},{"id":"170783","messageId":"CALWDD1zrOUwS2FeQs1SsFuLnaDzhCHZVFLvFXv7aLex1K2v5zw@mail.gmail.com","threadId":"27746","inReplyTo":"20110702185724.GA14390@sigill.intra.peff.net","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Al Haraka","fromEmail":"alharaka@gmail.com","sentAt":"2011-07-02T19:18:55Z","receivedAt":"2011-07-02T19:18:55Z","isPatch":false,"sender":{"key":"alharaka@gmail.com","avatar":"https://gravatar.com/avatar/8b6a6240c7c2bb87c4666923249f62cafed06f8c77ed90e189feafd1e627be79?d=mp&s=160"},"body":"On Sat, Jul 2, 2011 at 9:57 PM, Jeff King <peff@peff.net> wrote:\n> You could try setting \"$ENV{GIT_TRACE} = 1\", which will dump all of the\n> git commands being called to stderr (and presumaby your log). That would\n> double-check that the option is being passed.\n\nGreat.  Thanks for the tip.\n\n> I think what might be happening, though, is that git does not do a good\n> job checking .gitattributes files inside trees; it only checks the\n> .gitattributes in the working tree, even if you are diffing a tree. But\n> in the case of a bare repository, we don't even have a working tree at\n> all.\n>\n> You can try working around it like this:\n>\n>  cd /path/to/bare/repo.git\n>  git show HEAD:.gitattributes >info/attributes\n\nThis did not work, for what I think might be an obvious reason; I do\nnot have a .gitattributes file *in* the repo or any repos anymore, but\na global one.  See below.\n\n[dreamhost-server]$ git show HEAD:.gitattributes >info/attributes\nfatal: Path '.gitattributes' exists on disk, but not in 'HEAD'.\n\n> which will make the repository-wide non-version-controlled gitattributes\n> the same as the last committed version. The problem is that it won't be\n> automatically updated as you commit and push changes to .gitattributes.\n\nI thought my plan was to try and avoid this by using the\ncore.attributesfile directive, forcing this stuff to operate system\n(well, account, besides the point here) wide on all repos with\nspecifying a .gitattributes (or, since it base bare, as you pointed\nout yourself, $GIT_REPO_DIR/info/attributes) every single time.  Did I\nmisunderstand the mailing list thread that mentioned this a while\nback?\n\n[dreamhost-server]$ git config --list --global\ndiff.odf.textconv=odt2txt\ndiff.odf.binary=false\ndiff.pdf.textconv=pdftotext\ndiff.pdf.binary=false\ncore.attributesfile=~/.gitattributes\n\nInside one of the troublesome repos (so resultant collection of global\nand repo-specific config):\n\n[dreamhost-server]$ git config --list\ndiff.odf.textconv=odt2txt\ndiff.odf.binary=false\ndiff.pdf.textconv=pdftotext\ndiff.pdf.binary=false\ncore.attributesfile=~/.gitattributes\ncore.repositoryformatversion=0\ncore.filemode=true\ncore.bare=true\ngitweb.owner=alharaka@gmail.com\ndiff.odf.textconv=odt2txt\n\nThis is the reason I went through the trouble of compiling an updated\nversion in my account (as opposed to the installed version on the\nDreamhost box; they are stuck at version 1.7.1.1; I saw this mentioned\non a thread somewhere and wanted to get the \"latest\" (well latest\nstable version) to avoid this kind of problem?  Was that the right\nthing to do?  Will it even work in this case?  I get the feeling from\nyour response I was expecting a lot with RTFM'ing more.  I have a\nscript, as described in the Github HOWTO, that creates the bare repo\nas desired for me.  So, if this will not work, I will just modify my\nversion of the bash script to handle this.  I just am obviously not\nsure what the \"proper\" approach or best practice is anymore.\n\nThanks again for your help.  I really appreciate it.  I am new to git,\nbut LOVE what you guys have being doing.  I never used any DRCS before\nthis, personally or professionally, but read snippets of howtos and so\nmuch good press I decided it was time I mooch off you guys to organize\nmy life.  :-)\n"},{"id":"170784","messageId":"20110702195735.GA15542@sigill.intra.peff.net","threadId":"27746","inReplyTo":"CALWDD1zrOUwS2FeQs1SsFuLnaDzhCHZVFLvFXv7aLex1K2v5zw@mail.gmail.com","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-07-02T19:57:36Z","receivedAt":"2011-07-02T19:57:36Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jul 02, 2011 at 10:18:55PM +0300, Al Haraka wrote:\n\n> > which will make the repository-wide non-version-controlled gitattributes\n> > the same as the last committed version. The problem is that it won't be\n> > automatically updated as you commit and push changes to .gitattributes.\n> \n> I thought my plan was to try and avoid this by using the\n> core.attributesfile directive, forcing this stuff to operate system\n> (well, account, besides the point here) wide on all repos with\n> specifying a .gitattributes (or, since it base bare, as you pointed\n> out yourself, $GIT_REPO_DIR/info/attributes) every single time.  Did I\n> misunderstand the mailing list thread that mentioned this a while\n> back?\n\nAh, I see. That seems like a reasonable solution. Are you sure that the\nuser running gitweb as a CGI is the same as the user you log in as? That\nis, are you sure that ~/.gitconfig is being parsed when it is called as\na CGI, and it's not looking in ~www/.gitconfig or something?\n\nIt would depend how your hosting is set up.\n\n> This is the reason I went through the trouble of compiling an updated\n> version in my account (as opposed to the installed version on the\n> Dreamhost box; they are stuck at version 1.7.1.1; I saw this mentioned\n> on a thread somewhere and wanted to get the \"latest\" (well latest\n> stable version) to avoid this kind of problem?  Was that the right\n> thing to do?  Will it even work in this case?  I get the feeling from\n> your response I was expecting a lot with RTFM'ing more.\n\nIt sounds like it should work to me, but I've not tested it (nor do I\neven run gitweb; I just have an interest in textconv).\n\n> Thanks again for your help.  I really appreciate it.  I am new to git,\n> but LOVE what you guys have being doing.  I never used any DRCS before\n> this, personally or professionally, but read snippets of howtos and so\n> much good press I decided it was time I mooch off you guys to organize\n> my life.  :-)\n\nYou're welcome. Hopefully we can resolve your problem and get the answer\nat least in the list archive. And then you will have made the world a\nbetter place. :)\n\n-Peff\n"},{"id":"170786","messageId":"m3aacw5t5x.fsf@localhost.localdomain","threadId":"27746","inReplyTo":"20110702195735.GA15542@sigill.intra.peff.net","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-07-02T20:23:38Z","receivedAt":"2011-07-02T20:23:38Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jeff King <peff@peff.net> writes:\n> On Sat, Jul 02, 2011 at 10:18:55PM +0300, Al Haraka wrote:\n> \n> > > which will make the repository-wide non-version-controlled gitattributes\n> > > the same as the last committed version. The problem is that it won't be\n> > > automatically updated as you commit and push changes to .gitattributes.\n> > \n> > I thought my plan was to try and avoid this by using the\n> > core.attributesfile directive, forcing this stuff to operate system\n> > (well, account, besides the point here) wide on all repos with\n> > specifying a .gitattributes (or, since it base bare, as you pointed\n> > out yourself, $GIT_REPO_DIR/info/attributes) every single time.  Did I\n> > misunderstand the mailing list thread that mentioned this a while\n> > back?\n> \n> Ah, I see. That seems like a reasonable solution. Are you sure that the\n> user running gitweb as a CGI is the same as the user you log in as? That\n> is, are you sure that ~/.gitconfig is being parsed when it is called as\n> a CGI, and it's not looking in ~www/.gitconfig or something?\n> \n> It would depend how your hosting is set up.\n\nWell, there is also system wide $(prefix)/etc/gitconfig file...\n \n> > This is the reason I went through the trouble of compiling an updated\n> > version in my account (as opposed to the installed version on the\n> > Dreamhost box; they are stuck at version 1.7.1.1; I saw this mentioned\n> > on a thread somewhere and wanted to get the \"latest\" (well latest\n> > stable version) to avoid this kind of problem?  Was that the right\n> > thing to do?  Will it even work in this case?  I get the feeling from\n> > your response I was expecting a lot with RTFM'ing more.\n> \n> It sounds like it should work to me, but I've not tested it (nor do I\n> even run gitweb; I just have an interest in textconv).\n\nThe question is if --textconv works with git-diff-tree, because that\nis what gitweb uses.\n\nBTW. we could use --textconv in 'blob' and 'blame' views (it is\ndocumented that git-cat-file supports --textconv, and it is checked in\ngit testsuite but not documented that git-blame supports --textconv).\nBut it would require changes to gitweb.\n\n\nHoping that this email will made it...\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"170787","messageId":"20110702211027.GA16294@sigill.intra.peff.net","threadId":"27746","inReplyTo":"m3aacw5t5x.fsf@localhost.localdomain","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-07-02T21:10:28Z","receivedAt":"2011-07-02T21:10:28Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jul 02, 2011 at 01:23:38PM -0700, Jakub Narebski wrote:\n\n> > Ah, I see. That seems like a reasonable solution. Are you sure that the\n> > user running gitweb as a CGI is the same as the user you log in as? That\n> > is, are you sure that ~/.gitconfig is being parsed when it is called as\n> > a CGI, and it's not looking in ~www/.gitconfig or something?\n> > \n> > It would depend how your hosting is set up.\n> \n> Well, there is also system wide $(prefix)/etc/gitconfig file...\n\nGood point. Though if he's on shared hosting, that might not be an\noption.\n\n> The question is if --textconv works with git-diff-tree, because that\n> is what gitweb uses.\n\nIt does. It just defaults to \"--no-textconv\", but you can enable it on\nthe command-line.\n\n-Peff\n"},{"id":"170788","messageId":"CALWDD1w-sVcPbU1_yHacw5yfrwoK1hOgfRu2X04JsFrq1WZJCg@mail.gmail.com","threadId":"27746","inReplyTo":"m3aacw5t5x.fsf@localhost.localdomain","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Al Haraka","fromEmail":"alharaka@gmail.com","sentAt":"2011-07-02T21:10:38Z","receivedAt":"2011-07-02T21:10:38Z","isPatch":false,"sender":{"key":"alharaka@gmail.com","avatar":"https://gravatar.com/avatar/8b6a6240c7c2bb87c4666923249f62cafed06f8c77ed90e189feafd1e627be79?d=mp&s=160"},"body":"On Sat, Jul 2, 2011 at 11:23 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> Jeff King <peff@peff.net> writes:\n>> On Sat, Jul 02, 2011 at 10:18:55PM +0300, Al Haraka wrote:\n>>\n>> > > which will make the repository-wide non-version-controlled gitattributes\n>> > > the same as the last committed version. The problem is that it won't be\n>> > > automatically updated as you commit and push changes to .gitattributes.\n>> >\n>> > I thought my plan was to try and avoid this by using the\n>> > core.attributesfile directive, forcing this stuff to operate system\n>> > (well, account, besides the point here) wide on all repos with\n>> > specifying a .gitattributes (or, since it base bare, as you pointed\n>> > out yourself, $GIT_REPO_DIR/info/attributes) every single time.  Did I\n>> > misunderstand the mailing list thread that mentioned this a while\n>> > back?\n>>\n>> Ah, I see. That seems like a reasonable solution. Are you sure that the\n>> user running gitweb as a CGI is the same as the user you log in as? That\n>> is, are you sure that ~/.gitconfig is being parsed when it is called as\n>> a CGI, and it's not looking in ~www/.gitconfig or something?\n>>\n>> It would depend how your hosting is set up.\n>\n> Well, there is also system wide $(prefix)/etc/gitconfig file...\n\nUnfortunately, this is on Dreamhost.  I do not have root access, and\nthis is a kludge.  I know what I am asking for is a very exclusive use\ncase, but I would love to have this kind of feature until people tell\nme it cannot be done.  Haha.\n\n>> > This is the reason I went through the trouble of compiling an updated\n>> > version in my account (as opposed to the installed version on the\n>> > Dreamhost box; they are stuck at version 1.7.1.1; I saw this mentioned\n>> > on a thread somewhere and wanted to get the \"latest\" (well latest\n>> > stable version) to avoid this kind of problem?  Was that the right\n>> > thing to do?  Will it even work in this case?  I get the feeling from\n>> > your response I was expecting a lot with RTFM'ing more.\n>>\n>> It sounds like it should work to me, but I've not tested it (nor do I\n>> even run gitweb; I just have an interest in textconv).\n>\n> The question is if --textconv works with git-diff-tree, because that\n> is what gitweb uses.\n\nIt does work on git-dif-tree when I just checked.  So, I presume that\nthis means Jeff is right, and it must be not pulling the config from\nthe right location?\n\nJeff, on that note, I fear you are right about the appropriate user\nexecuting the script:\n\nhttp://wiki.dreamhost.com/Suexec\n\nI get the feeling this is the case because in several instances I\nthought I was clever with my use of ~ or $HOME, or the tutorial writer\nhad been himself.  In those instances, using full paths and not\nuser-specific environment vars fixed the issues.  So, I guess I need\nto figure a way to pass the config vars appropriately?  I already\nchanged the core.attributesfile from ~/.gitattributes to\n/home/dreamhost_user/.gitattributes in anticipation, but I know that\nis only the first step.  I need to go to head out for a bit.  I will\nrevisit the issue tomorrow morning when I have time to think about the\nright way to fix passing the environment variables for suexec.  I am\nan idiot.\n\n> BTW. we could use --textconv in 'blob' and 'blame' views (it is\n> documented that git-cat-file supports --textconv, and it is checked in\n> git testsuite but not documented that git-blame supports --textconv).\n> But it would require changes to gitweb.\n>\n>\n> Hoping that this email will made it...\n\nIt made it indeed.  Much appreciated for both your efforts so far.\n\n> --\n> Jakub Narebski\n> Poland\n> ShadeHawk on #git\n>\n\n\n\n-- \nAlexander J. Stein\nCell:  +974 70013750\nEmail: alharaka@gmail.com\nSkype: alexander.j.stein\n"},{"id":"170789","messageId":"201107022322.24832.jnareb@gmail.com","threadId":"27746","inReplyTo":"20110702211027.GA16294@sigill.intra.peff.net","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-07-02T21:22:23Z","receivedAt":"2011-07-02T21:22:23Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sat, 2 Jul 2011, Jeff King wrote:\n> On Sat, Jul 02, 2011 at 01:23:38PM -0700, Jakub Narebski wrote:\n> \n> > > Ah, I see. That seems like a reasonable solution. Are you sure that the\n> > > user running gitweb as a CGI is the same as the user you log in as? That\n> > > is, are you sure that ~/.gitconfig is being parsed when it is called as\n> > > a CGI, and it's not looking in ~www/.gitconfig or something?\n> > > \n> > > It would depend how your hosting is set up.\n> > \n> > Well, there is also system wide $(prefix)/etc/gitconfig file...\n> \n> Good point. Though if he's on shared hosting, that might not be an\n> option.\n\nThough on the other hand if he is compiling git himself, $prefix can\nbe $HOME...\n\n> > The question is if --textconv works with git-diff-tree, because that\n> > is what gitweb uses.\n> \n> It does. It just defaults to \"--no-textconv\", but you can enable it on\n> the command-line.\n\nUndocumented.\n\n  $ git grep -e --textconv Documentation/\n  Documentation/RelNotes/1.6.3.3.txt: * \"git diff --textconv\" leaked memory badly when the tex\n  Documentation/git-cat-file.txt:'git cat-file' (-t | -s | -e | -p | <type> | --textconv ) <ob\n  Documentation/git-cat-file.txt:object type, or '-s' is used to find the object size, or '--t\n  Documentation/git-cat-file.txt:--textconv::\n\n(on current 'master').\n\n-- \nJakub Narebski\nPoland\n"},{"id":"170919","messageId":"m3r5634ijc.fsf@localhost.localdomain","threadId":"27746","inReplyTo":"20110702104313.GA10245@sigill.intra.peff.net","subject":"Re: Gitweb 1.7.5 and Textconv Configuration","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-07-06T13:59:53Z","receivedAt":"2011-07-06T13:59:53Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sat, Jul 02, 2011 at 12:50:12PM +0300, Al Haraka wrote:\n> \n> > So, I tried different variations of this, specifically for repos.\n> > Now, I have tried it globally as that was tedious and it was not\n> > working anyway. That works some of the time if I try commands over the\n> > console (git log  -p for quick testing), but never in Gitweb.  It\n> > continues to only say they are differing binary files.  Does Gitweb\n> > 1.7.5 support the use of this?  Is there something special I must do?\n> > Below is my current config:\n> \n> The default gitweb configuration doesn't allow textconv (or external\n> diff) for security reasons; it would mean repo owners could execute\n> arbitrary commands as the gitweb user.\n> \n> If that's OK for your site, you can probably enable it with:\n> \n>   push @diff_opts, '--allow-textconv';\n> \n> I don't know that anybody has tested that, though. It will use textconv\n> _everywhere_ in gitweb, including the \"format-patch\" invocation for\n> showing raw patches of commits. It might make sense in the long run for\n> gitweb to have another variable like @diff_opts that is used for\n> human-readable output (e.g., the HTML output, but not anything you might\n> import to a tool).\n\nActually I think neither git-format-patch (which is used by 'patch'\nand 'patches' views), not git-diff-tree (used by 'commitdiff' and\n'blobdiff' views, and their *_plain versions) supports --textconv,\nand that it is supported only by git-diff.  But you better check that.\n\nNb documentation as of 1.7.5 is entirely unhelpful.  Only git-cat-file\nis documented as using --textconv... though this option is examined\nin diff.c, and there is test for git-blame supporting it.\n\n\nBy the way, I don't know if git read .gitattributes file (which\ndefines textconv... unless you use per repository instance\n.git/info/attributes) from tree for given commit, or only from working\narea.  \n\ngit-chec-attr (official script API) can check only state of\ngitattributes in working area.\n\n\nSo I don't think that gitweb can support textconv in diffs; it should\nbe quite easy to add suppport for --textconv in 'blob' view, ...\n\n... but it wouldn't be in gitweb 1.7.5 ;-)\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"170925","messageId":"20110706151330.GA13790@sigill.intra.peff.net","threadId":"27746","inReplyTo":"m3r5634ijc.fsf@localhost.localdomain","subject":"[PATCH] docs: document --textconv diff option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-07-06T15:13:30Z","receivedAt":"2011-07-06T15:13:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 06, 2011 at 06:59:53AM -0700, Jakub Narebski wrote:\n\n> Actually I think neither git-format-patch (which is used by 'patch'\n> and 'patches' views), not git-diff-tree (used by 'commitdiff' and\n> 'blobdiff' views, and their *_plain versions) supports --textconv,\n> and that it is supported only by git-diff.  But you better check that.\n\nI did. It works for both.\n\n> Nb documentation as of 1.7.5 is entirely unhelpful.  Only git-cat-file\n> is documented as using --textconv... though this option is examined\n> in diff.c, and there is test for git-blame supporting it.\n\nPatch below.\n\n> By the way, I don't know if git read .gitattributes file (which\n> defines textconv... unless you use per repository instance\n> .git/info/attributes) from tree for given commit, or only from working\n> area.\n\nIt's not currently read from the tree; see earlier in the thread for\nsome discussion.\n\n-Peff\n\n-- >8 --\nSubject: [PATCH] docs: document --textconv diff option\n\nThis has been there since textconv existed, but was never\ndocumented. There is some overlap with what's in\ngitattributes(5), but it's important to warn in both places\nthat textconv diffs probably can't be applied.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/diff-options.txt |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex 4235302..b620b3a 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -422,6 +422,17 @@ endif::git-format-patch[]\n --no-ext-diff::\n \tDisallow external diff drivers.\n \n+--textconv::\n+--no-textconv::\n+\tAllow (or disallow) external text conversion filters to be run\n+\twhen comparing binary files. See linkgit:gitattributes[5] for\n+\tdetails. Because textconv filters are typically a one-way\n+\tconversion, the resulting diff is suitable for human\n+\tconsumption, but cannot be applied. For this reason, textconv\n+\tfilters are enabled by default only for linkgit:git-diff[1] and\n+\tlinkgit:git-log[1], but not for linkgit:git-format-patch[1] or\n+\tdiff plumbing commands.\n+\n --ignore-submodules[=<when>]::\n \tIgnore changes to submodules in the diff generation. <when> can be\n \teither \"none\", \"untracked\", \"dirty\" or \"all\", which is the default\n-- \n1.7.6.20.g45f3f.dirty\n"}]}