All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Sean <seanlkml@sympatico.ca>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH 4/10] Add current branch in PS1 support to git-completion.bash.
Date: Mon, 27 Nov 2006 12:31:36 -0500	[thread overview]
Message-ID: <20061127173136.GD6616@spearce.org> (raw)
In-Reply-To: <20061127122653.3e801d7a.seanlkml@sympatico.ca>

Sean <seanlkml@sympatico.ca> wrote:
> On Mon, 27 Nov 2006 11:51:23 -0500
> Shawn Pearce <spearce@spearce.org> wrote:
> 
> > I actually started with the name __git_current_branch but changed
> > my mind on that and went with __git_ps1.
> > 
> > My rationale at the time was probably not correct (it was early this
> > morning) but I figured that the current branch name is "master"
> > while __git_ps1 prints " (master)".  Therefore __git_ps1 is not
> > really printing the current branch, its printing the current branch
> > and other stuff.  So I went with a name which implied its purpose.
> 
> Ahh, I had missed that, it makes some sense.  Although it goes a bit
> against the commit message that the user is free to construct whatever
> PS1 format they like (ie. they're stuck with parenthesis around the
> branch name).
> 
> Just thinking out loud, what about allowing __git_ps1 to take a
> format string of its own?  It could parse options like  "(\b)"
> to mean git branch surrounded by parenthesis.  But you could
> also do "[\b]" or "!\b" if you preferred.

I did that.  :-)

If you read the implementation of __git_ps1 the default format is
" (%s)" but you can pass anything you want as the first parameter.
 
-- 

  parent reply	other threads:[~2006-11-27 17:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <de7beb117fb963e68e1085b773593be326ffd495.1164616814.git.spearce@spearce.org>
2006-11-27  8:41 ` [PATCH 2/10] Hide plumbing/transport commands from bash completion Shawn O. Pearce
2006-11-27  8:41 ` [PATCH 3/10] Teach bash how to complete options for git-name-rev Shawn O. Pearce
2006-11-27  8:41 ` [PATCH 4/10] Add current branch in PS1 support to git-completion.bash Shawn O. Pearce
2006-11-27 15:31   ` Sean
     [not found]   ` <20061127103111.4835bffc.seanlkml@sympatico.ca>
2006-11-27 16:51     ` Shawn Pearce
2006-11-27 17:26       ` Sean
     [not found]       ` <20061127122653.3e801d7a.seanlkml@sympatico.ca>
2006-11-27 17:31         ` Shawn Pearce [this message]
2006-11-27 17:45           ` Sean
2006-11-27  8:41 ` [PATCH 5/10] Teach bash how to complete git-format-patch Shawn O. Pearce
2006-11-27  8:50   ` Jakub Narebski
2006-11-27  8:41 ` [PATCH 6/10] Teach bash how to complete git-cherry-pick Shawn O. Pearce
2006-11-27  8:42 ` [PATCH 7/10] Teach bash how to complete git-rebase Shawn O. Pearce
2006-11-27  8:42 ` [PATCH 8/10] Teach bash about git log/show/whatchanged options Shawn O. Pearce
2006-11-27  8:42 ` [PATCH 9/10] Allow completion of --committer and --author arguments to git log Shawn O. Pearce
2006-11-27 10:28   ` Nicolas Vilz
2006-11-27 16:46     ` Shawn Pearce
2006-11-27 20:20   ` Junio C Hamano
2006-11-27 20:49     ` Shawn Pearce
2006-11-27  8:42 ` [PATCH 10/10] Support bash completion of refs/remote Shawn O. Pearce

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=20061127173136.GD6616@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=seanlkml@sympatico.ca \
    /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.