git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Gitweb 1.7.5 and Textconv Configuration

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 6, 2011, 13:59 UTC
Message-ID
<m3r5634ijc.fsf@localhost.localdomain>
In-Reply-To
<20110702104313.GA10245@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 24 quoted lines
> On Sat, Jul 02, 2011 at 12:50:12PM +0300, Al Haraka wrote:
> 
> > So, I tried different variations of this, specifically for repos.
> > Now, I have tried it globally as that was tedious and it was not
> > working anyway. That works some of the time if I try commands over the
> > console (git log  -p for quick testing), but never in Gitweb.  It
> > continues to only say they are differing binary files.  Does Gitweb
> > 1.7.5 support the use of this?  Is there something special I must do?
> > Below is my current config:
> 
> The default gitweb configuration doesn't allow textconv (or external
> diff) for security reasons; it would mean repo owners could execute
> arbitrary commands as the gitweb user.
> 
> If that's OK for your site, you can probably enable it with:
> 
>   push @diff_opts, '--allow-textconv';
> 
> I don't know that anybody has tested that, though. It will use textconv
> _everywhere_ in gitweb, including the "format-patch" invocation for
> showing raw patches of commits. It might make sense in the long run for
> gitweb to have another variable like @diff_opts that is used for
> human-readable output (e.g., the HTML output, but not anything you might
> import to a tool).

Actually I think neither git-format-patch (which is used by 'patch' and 'patches' views), not git-diff-tree (used by 'commitdiff' and 'blobdiff' views, and their *_plain versions) supports --textconv, and that it is supported only by git-diff. But you better check that.

Nb documentation as of 1.7.5 is entirely unhelpful. Only git-cat-file is documented as using --textconv... though this option is examined in diff.c, and there is test for git-blame supporting it.

By the way, I don't know if git read .gitattributes file (which defines textconv... unless you use per repository instance .git/info/attributes) from tree for given commit, or only from working area.

git-chec-attr (official script API) can check only state of gitattributes in working area.

So I don't think that gitweb can support textconv in diffs; it should be quite easy to add suppport for --textconv in 'blob' view, ...

... but it wouldn't be in gitweb 1.7.5 ;-)
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Al HarakaNext: Jeff King
Message 12 of 13 in “Gitweb 1.7.5 and Textconv Configuration”
  1. Al HarakaJul 2, 2011
  2. Jeff KingJul 2, 2011
  3. Jeff KingJul 2, 2011
  4. Al HarakaJul 2, 2011
  5. Jeff KingJul 2, 2011
  6. Al HarakaJul 2, 2011
  7. Jeff KingJul 2, 2011
  8. Jakub NarebskiJul 2, 2011
  9. Jeff KingJul 2, 2011
  10. Jakub NarebskiJul 2, 2011
  11. Al HarakaJul 2, 2011
  12. Jakub NarebskiJul 6, 2011
  13. docs: document --textconv diff optionJeff King, Jul 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.