Re: [PATCH] Quick description of possible gitattributes system
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:42:57
On Fri, 2 Mar 2007, Jakub Narebski wrote:
Andy Parkins wrote:quoted
+ - 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