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

Re: [PATCH] Quick description of possible gitattributes system

From
Junio C Hamano <junkio@cox.net>
Date
Mar 3, 2007, 13:11 UTC
Message-ID
<7vlkiebhfl.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0703020850470.3953@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 23 quoted lines
> On Fri, 2 Mar 2007, Jakub Narebski wrote:
>
>> 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...

Sorry, but I do not think that would work because of the way we setup our pager. The original process turns into the PAGER and child ships the data to it.

	$ git show -s master maint :t/test4012.png

I do not particularly think the prettyfilter is useful in practice (it was just a fun toy I did to convince me that I can use it for things other than input/output munging), but at least we could make it a bit more usable by this, on top of 'pu':

diff --git a/builtin-log.c b/builtin-log.c
index 86062d3..bc26358 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -116,7 +116,7 @@ static int show_object(const unsigned char *sha1, const char *path, int nohead)
 	if (size <= offset)
 		goto finish;
 
-	if (path) {
+	if (pager_in_use && path) {
 		const struct pathattr *a = pathattr_lookup(path);
 		if (a && a->pretty) {
 			pretty = a->pretty;
Previous: Andy ParkinsNext: Jakub Narebski
Message 19 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.