All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: "Ted Pavlic" <ted@tedpavlic.com>,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	"Ville Skyttä" <ville.skytta@iki.fi>,
	"Thomas Rast" <trast@student.ethz.ch>,
	"Kerrick Staley" <mail@kerrickstaley.com>,
	"Dan McGee" <dan@archlinux.org>,
	"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>,
	git@vger.kernel.org, "Marius Storm-Olsen" <mstormo@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH 2/2] completion: split __git_ps1 into a separate script
Date: Fri, 25 May 2012 09:50:15 +0200	[thread overview]
Message-ID: <87ehq8its8.fsf@thomas.inf.ethz.ch> (raw)
In-Reply-To: <20120525073506.GD2052@goldbirke> ("SZEDER Gábor"'s message of "Fri, 25 May 2012 09:35:06 +0200")

SZEDER Gábor <szeder@ira.uka.de> writes:

> On Thu, May 24, 2012 at 11:36:45PM -0400, Ted Pavlic wrote:
>> > You mean a real git command, which does the same as __gitdir()?  I
>> > don't like that, because it will always require 2 fork()s and an
>> > exec() and would be slow on Windows.
>> 
>> Interesting. I guess I didn't realize bash completion was an issue for most
>> Windows users. Is it?
>
> It is.  Emulating fork() and exec() is very expensive, so every
> subshell, external command, or especially git command in a command
> substitution costs dearly.  And the completion script uses many git
> commands and even more subshells.
>
> Case in point is __git_ps1() and __gitdir().  There are scenarios
> where displaying the git-specific bash prompt takes more than 400ms on
> Windows, while displaying the same prompt takes only about 26ms on
> Linux on the same hardware.
>
>   http://thread.gmane.org/gmane.comp.version-control.git/197432

Why not make a git builtin command that figures out everything that
__git_ps1 does?  Perhaps in a format that can be eval'd and processed to
the user's taste.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2012-05-25  7:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 20:46 [PATCH 0/2] completion: split into git-prompt.sh Felipe Contreras
2012-05-22 20:46 ` [PATCH 1/2] completion: remove executable mode Felipe Contreras
2012-05-22 20:46 ` [PATCH 2/2] completion: split __git_ps1 into a separate script Felipe Contreras
2012-05-22 21:07   ` Zbigniew Jędrzejewski-Szmek
2012-05-22 22:29     ` Ted Pavlic
2012-05-23 11:56       ` Felipe Contreras
2012-05-23 11:59     ` Felipe Contreras
2012-05-23 14:54     ` Junio C Hamano
2012-05-23 15:40       ` Felipe Contreras
2012-05-23 16:30         ` Junio C Hamano
2012-05-23 17:03         ` Ted Pavlic
2012-05-23 20:50           ` Felipe Contreras
2012-05-23 21:55             ` Ted Pavlic
2012-05-24 20:35               ` SZEDER Gábor
     [not found]                 ` <CAOnadRFbrhrFz7Ya3Vhgsju9G723Qu0OdJnM31xFmBqQNgj6gA@mail.gmail.com>
2012-05-25  7:35                   ` SZEDER Gábor
2012-05-25  7:50                     ` Thomas Rast [this message]
2012-05-25 10:01                       ` Felipe Contreras
2012-05-25 18:03                       ` Junio C Hamano
2012-05-24 20:49         ` SZEDER Gábor
2012-05-22 22:27   ` Ted Pavlic
2012-05-23 11:53     ` Felipe Contreras
2012-05-23 14:59       ` Junio C Hamano
2012-05-24 20:47   ` SZEDER Gábor
2012-05-25 17:51     ` Ville Skyttä
2012-10-25  0:51   ` Where should git-prompt.sh be installed? Jonathan Nieder
2012-10-25  1:59     ` Drew Northup
2012-10-25  6:02     ` Danny Yates
2012-10-25  7:45       ` [RFC/PATCH] __git_ps1: migrate out of contrib/completion Jonathan Nieder
2012-10-25 14:19         ` Felipe Contreras
2012-11-08 13:19         ` Todd Zullinger
2012-10-25  8:10       ` Where should git-prompt.sh be installed? Anders Kaseorg
2012-10-25 15:11     ` SZEDER Gábor
2012-10-25 16:12       ` Jonathan Nieder
2012-05-23 16:33 ` [PATCH 0/2] completion: split into git-prompt.sh Junio C Hamano

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=87ehq8its8.fsf@thomas.inf.ethz.ch \
    --to=trast@inf.ethz.ch \
    --cc=dan@archlinux.org \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mail@kerrickstaley.com \
    --cc=mstormo@gmail.com \
    --cc=szeder@ira.uka.de \
    --cc=ted@tedpavlic.com \
    --cc=trast@student.ethz.ch \
    --cc=ville.skytta@iki.fi \
    --cc=zbyszek@in.waw.pl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.