Re: [PATCH] Add bare repository indicator for __git_ps1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shawn O. Pearce said the following on 23.02.2009 16:42:
Marius Storm-Olsen <marius@xxxxxxxxxxxxx> wrote:
Anyways, I just thought it would fairly "low cost" to add, and
nice to have.

Its not that low of a cost, its an extra fork+exec per prompt when
in a .git/ or a bare repository.  Neither is very common when
compared to a workdir, Junio's right about that.  But its YAFE.  ;)

Consider it, as Linus coined the term, a throw-away patch. I can
easily put it in my .bashrc instead. :)

Like Junio, I'm not very compelled to include this patch. I just don't see enough to make including it worthwhile.

If so, then I'd like to argue to remove setting the fake "GIT_DIR!" branch in the ps, since it hinders me from constructing this, IMO useful prompt, "(BARE:master)" in my own .bashrc.

    ~/source/some_repo (GIT_DIR!)$
simply isn't useful to me, and neither is
    ~/source/some_repo (BARE:GIT_DIR!)$
of course. Now, if we remove setting the fake branch
    ~/source/some_repo (BARE:some/funky/branch)$
is doable for me in my own .bashrc, and by your argument, it would also make it more light weight, since you'd remove one extra fork+exec for *every single prompt* (and not just one extra when inside GIT_DIR).

^shrug^ at this point you and Junio can discuss what to do, as Junio already said

  | "I do not understand the need for GIT_DIR! thing even
  |  less, but since we have that there already, I do not
  |  see a reason not to add this to the queue."

And I have to agree with him. At this point, __git_ps1() is actually removing useful information from the prompt; at least it does for me.

--
.marius [@trolltech.com]
'if you know what you're doing, it's not research'

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux