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

Re: [PATCH] Quick description of possible gitattributes system

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 2, 2007, 16:58 UTC
Message-ID
<Pine.LNX.4.64.0703020850470.3953@woody.linux-foundation.org>
In-Reply-To
<es9aal$5gf$1@sea.gmane.org>
On Fri, 2 Mar 2007, Jakub Narebski wrote:
Show 9 quoted lines
> Andy Parkins wrote:
> 
> > + - prettyfilter
> > +   Run by git-cat-file or git-show when content is being pretty-printed
> > +   for display to the user.  If no prettyfilter is set, then it should
> > +   default to outfilter.
> 
> I'd rather have plumbing operate without filters (if it is possible),
> so git-cat-file would not run prettyfilter, and git-show would run it.

That really sucks. I do "git show xyz > filname" all the time, and while it's been about diffs and commits, I could imagine doing the same thing for things like "git show v2.6.17:Documentation/logo.gif > some.gif" too.

Yes, I know could do "git cat-file -p .." instead, but since we added "git show", and made it do the Right Thing (tm) for blobs, I've come to use it more (which is as it should be: "cat-file" is low-level plumbing, while "git show" is what you'd expect users to use.

So I really think that the issue here is that the *pager* should do the right thing. Which gets us to:

> Or at least detect if output is tty, so one can do something like
> "git cat-file -p v1.0.0:gitweb/git-logo.png > git-logo.png" and get
> expected result, while "git show v1.0.0:gitweb/git-logo.png" would
> show the image.
Yes. How about just having the built-in git pager do the right thing?

Right now we actually wait for data to start arriving (commit 35ce862) due to working around a bug in less. But what if we could make the pager actually do the right thing here automatically? With "less" just being the default action for *text*?

			Linus
Previous: Jakub NarebskiNext: Andy Parkins
Message 13 of 20 in “Quick description of possible gitattributes system”
  1. Quick description of possible gitattributes systemAndy Parkins, Mar 1, 2007
  2. Brian GernhardtMar 1, 2007
  3. Andy ParkinsMar 2, 2007
  4. Brian GernhardtMar 2, 2007
  5. Andy ParkinsMar 2, 2007
  6. Brian GernhardtMar 2, 2007
  7. Robin RosenbergMar 1, 2007
  8. Junio C HamanoMar 2, 2007
  9. Junio C HamanoMar 2, 2007
  10. Andy ParkinsMar 2, 2007
  11. Andy ParkinsMar 2, 2007
  12. Jakub NarebskiMar 2, 2007
  13. Linus TorvaldsMar 2, 2007
  14. Andy ParkinsMar 2, 2007
  15. Linus TorvaldsMar 2, 2007
  16. Johannes SchindelinMar 2, 2007
  17. Andy ParkinsMar 2, 2007
  18. Andy ParkinsMar 2, 2007
  19. Junio C HamanoMar 3, 2007
  20. Jakub NarebskiMar 3, 2007

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.