git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Quick description of possible gitattributes system
Date: Sat, 3 Mar 2007 21:27:55 +0100	[thread overview]
Message-ID: <200703032127.56343.jnareb@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0703020850470.3953@woody.linux-foundation.org>

On Fri, 2 Mar 2007, Linus Torvalds wrote:
> 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.
[...]
> 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*?

Wouldn't it be better and simplier instead of creating built-in magic
(as in DWIM) pager, to have in place of "prettyfilter", "pretty",
"show" handler "pager" handler, which would define _default_ pager for
given attributes.

It would mean that the filter/sink would be run only when pager is run,
i.e. for "git show" and "git -p cat-file"/"git --paginate cat-file".
I guess that would mean that handler action would be run only for tty.
And you could always override it by setting PAGER environmental variable.

So it would be:

+ - pager
+   Change default pager for this content. If it is not set, it defaults
+   to `less'. You can always override default pager by setting PAGER
+   environmental variable.

-- 
Jakub Narebski
ShadeHawk on #git
Poland

      parent reply	other threads:[~2007-03-03 20:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-01 12:06 [PATCH] Quick description of possible gitattributes system Andy Parkins
2007-03-01 16:06 ` Brian Gernhardt
2007-03-02 12:00   ` Andy Parkins
2007-03-02 18:05     ` Brian Gernhardt
2007-03-02 19:35       ` Andy Parkins
2007-03-02 20:35         ` Brian Gernhardt
2007-03-01 18:01 ` Robin Rosenberg
2007-03-02  0:09 ` Junio C Hamano
2007-03-02  4:46   ` Junio C Hamano
2007-03-02  8:58     ` Andy Parkins
2007-03-02  8:56   ` Andy Parkins
2007-03-02 13:56 ` Jakub Narebski
2007-03-02 16:58   ` Linus Torvalds
2007-03-02 19:37     ` Andy Parkins
2007-03-02 21:02       ` Linus Torvalds
2007-03-02 21:45         ` Johannes Schindelin
2007-03-02 22:21         ` Andy Parkins
2007-03-02 22:24           ` Andy Parkins
2007-03-03 13:11     ` Junio C Hamano
2007-03-03 20:27     ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703032127.56343.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).