Re: [PATCH] Quick description of possible gitattributes system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> 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;

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]