Обсуждение: gitweb tab width

Поиск
Список
Период
Сортировка

gitweb tab width

От
"Kevin Grittner"
Дата:
Is there some way to convince gitweb that a tab goes to the next
four character boundary rather than eight?  (This seems to affect
raw, blob, and diff displays.)
-Kevin


Re: gitweb tab width

От
Magnus Hagander
Дата:
On Thu, Sep 23, 2010 at 19:11, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Is there some way to convince gitweb that a tab goes to the next
> four character boundary rather than eight?  (This seems to affect
> raw, blob, and diff displays.)

At a first look, it seems not easily. It has:
sub untabify {       my $line = shift;
       while ((my $pos = index($line, "\t")) != -1) {               if (my $count = (8 - ($pos % 8))) {
     my $spaces = ' ' x $count;                       $line =~ s/\t/$spaces/;               }       } 
       return $line;
}


Which can do it, but if that's what's used, it'll have an effect on
all the other repositories on the server as well. You'd want it to be
configurable on a per-repository basis.

Now, gitweb is also "just a perlscript", so it can probably be adapted
to read that from the config file :-)


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: gitweb tab width

От
"Kevin Grittner"
Дата:
Magnus Hagander <magnus@hagander.net> wrote:
> Which can do it, but if that's what's used, it'll have an effect
> on all the other repositories on the server as well. You'd want it
> to be configurable on a per-repository basis.
Is that as a matter of principle or are there actually repositories
on http://git.postgresql.org/gitweb which use a tab width other than
four characters?
-Kevin


Re: gitweb tab width

От
Magnus Hagander
Дата:
On Thu, Sep 23, 2010 at 23:36, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Magnus Hagander <magnus@hagander.net> wrote:
>
>> Which can do it, but if that's what's used, it'll have an effect
>> on all the other repositories on the server as well. You'd want it
>> to be configurable on a per-repository basis.
>
> Is that as a matter of principle or are there actually repositories
> on http://git.postgresql.org/gitweb which use a tab width other than
> four characters?

I think it's mostly a matter of not knowing :-)

If we *know* all other projects on git.postgresql.org are happy with
4-space tabs, we can change it (and then forget it every time we
upgrade the system). But someone would have to do inventory of all
that's there before we change it...


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: gitweb tab width

От
Alvaro Herrera
Дата:
Excerpts from Magnus Hagander's message of vie sep 24 03:44:56 -0400 2010:

> If we *know* all other projects on git.postgresql.org are happy with
> 4-space tabs, we can change it (and then forget it every time we
> upgrade the system). But someone would have to do inventory of all
> that's there before we change it...

Since the most important project there uses 4-spaces tabs, and a lot of
the other projects are clones of that one, I think we should err in the
other direction.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: gitweb tab width

От
Magnus Hagander
Дата:
On Fri, Sep 24, 2010 at 16:47, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> Excerpts from Magnus Hagander's message of vie sep 24 03:44:56 -0400 2010:
>
>> If we *know* all other projects on git.postgresql.org are happy with
>> 4-space tabs, we can change it (and then forget it every time we
>> upgrade the system). But someone would have to do inventory of all
>> that's there before we change it...
>
> Since the most important project there uses 4-spaces tabs, and a lot of
> the other projects are clones of that one, I think we should err in the
> other direction.

Turns out it was a trivial patch to gitweb to allow a per-repository
configuration of this. So I've patched the gitweb we're running on
git.postgresql.org to do this, and will submit that patch upstream.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: gitweb tab width

От
Alvaro Herrera
Дата:
Excerpts from Magnus Hagander's message of mar sep 28 07:16:03 -0400 2010:

> Turns out it was a trivial patch to gitweb to allow a per-repository
> configuration of this. So I've patched the gitweb we're running on
> git.postgresql.org to do this, and will submit that patch upstream.

Excellent, thanks!  Now the indentation even makes sense!

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: gitweb tab width

От
"Kevin Grittner"
Дата:
Magnus Hagander <magnus@hagander.net> wrote:
> Turns out it was a trivial patch to gitweb to allow a per-
> repository configuration of this. So I've patched the gitweb we're
> running on git.postgresql.org to do this, and will submit that
> patch upstream.
The postgresql.git repository looks great now!  So how do I
configure the users/kgrittn/postgres.git repository to a four
character tab width?  I logged in to gitweb and went to the
administration page for the repo, but didn't see any option
there....
-Kevin


Re: gitweb tab width

От
Magnus Hagander
Дата:
On Tue, Sep 28, 2010 at 18:16, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Magnus Hagander <magnus@hagander.net> wrote:
>
>> Turns out it was a trivial patch to gitweb to allow a per-
>> repository configuration of this. So I've patched the gitweb we're
>> running on git.postgresql.org to do this, and will submit that
>> patch upstream.
>
> The postgresql.git repository looks great now!  So how do I
> configure the users/kgrittn/postgres.git repository to a four
> character tab width?  I logged in to gitweb and went to the
> administration page for the repo, but didn't see any option
> there....

Well, you need to modify the config file for the repository - which
you can't... Meh, didn't think of that.

I've just modified it manually for your repo. I wonder if I should add
a checkbox to the admin interface for it.. I doubt we need to support
anything other than 4 and 8, right?


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: gitweb tab width

От
Magnus Hagander
Дата:
On Tue, Sep 28, 2010 at 18:16, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Magnus Hagander <magnus@hagander.net> wrote:
>
>> Turns out it was a trivial patch to gitweb to allow a per-
>> repository configuration of this. So I've patched the gitweb we're
>> running on git.postgresql.org to do this, and will submit that
>> patch upstream.
>
> The postgresql.git repository looks great now!  So how do I
> configure the users/kgrittn/postgres.git repository to a four
> character tab width?  I logged in to gitweb and went to the
> administration page for the repo, but didn't see any option
> there....

Well, you need to modify the config file for the repository - which
you can't... Meh, didn't think of that.

I've just modified it manually for your repo. I wonder if I should add
a checkbox to the admin interface for it.. I doubt we need to support
anything other than 4 and 8, right?


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: gitweb tab width

От
"Kevin Grittner"
Дата:
Magnus Hagander <magnus@hagander.net> wrote:
> I've just modified it manually for your repo.
Thanks.
> I wonder if I should add a checkbox to the admin interface for
> it.. I doubt we need to support anything other than 4 and 8,
> right?
I'm not aware of anything that needs other than 4, but I haven't
looked very hard.  I'd go with whatever is easiest.  If a checkbox
or a number with a range limit (maybe 2 to 8) are equal in
difficulty, I'd go with the number.
-Kevin


Re: gitweb tab width

От
Magnus Hagander
Дата:
On Wed, Oct 6, 2010 at 17:39, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Magnus Hagander <magnus@hagander.net> wrote:
>
>> I've just modified it manually for your repo.
>
> Thanks.
>
>> I wonder if I should add a checkbox to the admin interface for
>> it.. I doubt we need to support anything other than 4 and 8,
>> right?
>
> I'm not aware of anything that needs other than 4, but I haven't
> looked very hard.  I'd go with whatever is easiest.  If a checkbox
> or a number with a range limit (maybe 2 to 8) are equal in
> difficulty, I'd go with the number.

Hey, look, I found a really old email :-)

I've added this to the git admin interface, and it's now possible to
set the width to anything you want in the admin page - normally you'd
pick 4 or 8 :-)

Better late than never, I hope...

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/