git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add bare repository indicator for __git_ps1

From
Marius Storm-Olsen <marius@trolltech.com>
Date
Feb 23, 2009, 16:03 UTC
Message-ID
<49A2C8D1.3080104@trolltech.com>
In-Reply-To
<20090223154237.GH22848@spearce.org>
Shawn O. Pearce said the following on 23.02.2009 16:42:
Show 13 quoted lines
> Marius Storm-Olsen <marius@trolltech.com> 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'
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 8 of 18 in “Add bare repository indicator for __git_ps1”
  1. Add bare repository indicator for __git_ps1Marius Storm-Olsen, Feb 21, 2009
  2. Marius Storm-OlsenFeb 21, 2009
  3. Junio C HamanoFeb 21, 2009
  4. Marius Storm-OlsenFeb 21, 2009
  5. Junio C HamanoFeb 22, 2009
  6. Marius Storm-OlsenFeb 23, 2009
  7. Shawn O. PearceFeb 23, 2009
  8. Marius Storm-OlsenFeb 23, 2009
  9. Shawn O. PearceFeb 23, 2009
  10. Marius Storm-OlsenFeb 23, 2009
  11. Junio C HamanoFeb 24, 2009
  12. Ted PavlicFeb 24, 2009
  13. Marius Storm-OlsenFeb 24, 2009
  14. Ted PavlicFeb 24, 2009
  15. Junio C HamanoFeb 24, 2009
  16. Marius Storm-OlsenFeb 24, 2009
  17. Junio C HamanoFeb 25, 2009
  18. Marius Storm-OlsenFeb 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.