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

Re: Gitweb 1.7.5 and Textconv Configuration

From
Jeff King <peff@peff.net>
Date
Jul 2, 2011, 18:57 UTC
Message-ID
<20110702185724.GA14390@sigill.intra.peff.net>
In-Reply-To
<CALWDD1woB0ytL6T-DwD92f824dnpz0mek=SYgz5jwqR0efnkpw@mail.gmail.com>
On Sat, Jul 02, 2011 at 02:14:30PM +0300, Al Haraka wrote:
Show 5 quoted lines
> # Enable textconv
> push @diff_opts, '--textconv';
> 
> Reloaded the webpage; still does *not* show text diffs.  Any way to
> debug what is going wrong?

You could try setting "$ENV{GIT_TRACE} = 1", which will dump all of the git commands being called to stderr (and presumaby your log). That would double-check that the option is being passed.

I think what might be happening, though, is that git does not do a good job checking .gitattributes files inside trees; it only checks the .gitattributes in the working tree, even if you are diffing a tree. But in the case of a bare repository, we don't even have a working tree at all.

You can try working around it like this:
  cd /path/to/bare/repo.git
  git show HEAD:.gitattributes >info/attributes

which will make the repository-wide non-version-controlled gitattributes the same as the last committed version. The problem is that it won't be automatically updated as you commit and push changes to .gitattributes.

So I think it's a bug in git. It seems like the tree being diffed is an obvious place for git to load gitattributes from. Though I'm not sure of the precedence rules for interacting with the version of .gitattributes in the worktree (if any). In a situation like this:

  $ git checkout master
  $ git show master~50

You would probably want the more recent worktree attributes to take precedence over the ones in the older tree.

But in this:
  $ git checkout master~50
  $ git show master

you would probably want the more recent tree attributes to take precedence over what's in the working tree.

-Peff
Previous: Al HarakaNext: Al Haraka
Message 5 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.