[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] Re: [PATCH] pager support like git
From: |
Bert Wesarg |
Subject: |
[Quilt-dev] Re: [PATCH] pager support like git |
Date: |
Wed, 18 Nov 2009 18:14:35 +0100 |
On Wed, Nov 18, 2009 at 17:41, Andreas Gruenbacher <address@hidden> wrote:
> Bert,
>
> I like this feature. There are a few little remaining problems though.
>
>> diff --git a/quilt/diff.in b/quilt/diff.in
>> index 8435024..866d61c 100644
>> --- a/quilt/diff.in
>> +++ b/quilt/diff.in
>> @@ -196,7 +196,7 @@ do
>> opt_color=1 ;;
>> auto | tty)
>> opt_color=
>> - [ -t 1 ] && opt_color=1 ;;
>> + [ -t 1 -o -n "${QUILT_PAGER_IN_USE-}" ] && opt_color=1
>> ;;
>> never)
>> opt_color= ;;
>> *)
>> @@ -310,6 +310,8 @@ then
>> || die 1
>> fi
>>
>> +setup_pager
>> +
>> for file in "address@hidden"
>> do
>> if [ -n "$opt_snapshot" -a -e "$QUILT_PC/$snap_subdir/$file" ]
>
> Here and in some other places, setup_pager is called after evaluating
> QUILT_PAGER_IN_USE though. This looks wrong.
It is, I need to look how to solve this. I don't want to start the
pager before we actually do the job though.
>
>> diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
>> + export LESS="${LESS:-FRSX}" # as in pager.c:pager_preexec()
>
> Hmm, what is FRSX here?
These are options for less, these defaults come from git:
I will quote the man page for these options:
-F or --quit-if-one-screen
Causes less to automatically exit if the entire file can be dis-
played on the first screen.
-R or --RAW-CONTROL-CHARS
Like -r, but only ANSI "color" escape sequences are output in
"raw" form. Unlike -r, the screen appearance is maintained cor-
rectly in most cases.
-S or --chop-long-lines
Causes lines longer than the screen width to be chopped rather
than folded.
-X or --no-init
Disables sending the termcap initialization and deinitialization
strings to the terminal. This is sometimes desirable if the
deinitialization string does something unnecessary, like clear-
ing the screen.
I for myslef add these two options:
-i or --ignore-case
Causes searches to ignore case; that is, uppercase and lowercase
are considered identical. This option is ignored if any upper-
case letters appear in the search pattern; in other words, if a
pattern contains uppercase letters, then that search does not
ignore case.
-M or --LONG-PROMPT
Causes less to prompt even more verbosely than more.
> Do we really need a named pipe here, or would an unnamed pipe do? Example:
>
> #! /bin/bash
> exec > >(sed -e 's/^/FILTERED: /')
> echo foo
That may work. But I don't know if we need the wait though.
Bert
>
>
> Thanks,
> Andreas
>