git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Tabs in commit messages - de-tabify option in strbuf_stripspace()?
Date: Tue, 15 Mar 2016 21:57:16 -0700	[thread overview]
Message-ID: <CA+55aFyFHmmoHMgRkuBqNUho=tiJ=VwxHWzcGw3pRjr+aGS7ZQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqzitz58si.fsf@gitster.mtv.corp.google.com>

On Tue, Mar 15, 2016 at 9:46 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> It also ignores that byte counts of non-HT bytes may not necessarily
> match display columns.  There is utf8_width() function exported from
> utf8.c for that purpose.

Hmm. I did that to now make it horribly slower. Doing the
per-character widths really does horrible things for performance.

That said, I think I can make it do the fast thing for lines that have
no tabs at all, which is the big bulk of it. So it would do the width
calculations only in the rare "yes, I found a tab" case.

I already wrote it in a way that non-tab lines end up just looping
over the line looking for a tab and then fall back to the old code.

I might just have to make that behavior a bit more explicit. Let me
stare at it a bit, but it won't happen until tomorrow, I think.

                 Linus

  reply	other threads:[~2016-03-16  4:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16  0:16 Tabs in commit messages - de-tabify option in strbuf_stripspace()? Linus Torvalds
2016-03-16  0:23 ` Stefan Beller
2016-03-16  0:45   ` Linus Torvalds
2016-03-16  0:34 ` Randall S. Becker
2016-03-16  0:45 ` Junio C Hamano
2016-03-16  0:48   ` Linus Torvalds
2016-03-16  1:00     ` Stefan Beller
2016-03-16  1:02       ` Stefan Beller
2016-03-16 14:27         ` Marc Branchaud
2016-03-16 14:50           ` Duy Nguyen
2016-03-16 16:15           ` Linus Torvalds
2016-03-16 16:47             ` Junio C Hamano
2016-03-20 13:29           ` Matthieu Moy
2016-03-16  4:05     ` Linus Torvalds
2016-03-16  4:46       ` Junio C Hamano
2016-03-16  4:57         ` Linus Torvalds [this message]
2016-03-16  5:17           ` Jeff King

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='CA+55aFyFHmmoHMgRkuBqNUho=tiJ=VwxHWzcGw3pRjr+aGS7ZQ@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).