git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Vilz <niv@iaglans.de>
To: Sean <seanlkml@sympatico.ca>
Cc: git@vger.kernel.org, Theodore Tso <tytso@mit.edu>
Subject: Re: git-PS1 bash prompt setting
Date: Fri, 17 Nov 2006 10:52:37 +0100	[thread overview]
Message-ID: <20061117095237.GD11468@fry.bender.fht> (raw)
In-Reply-To: <20061117042051.d2fbddb6.seanlkml@sympatico.ca>

On Fri, Nov 17, 2006 at 04:20:51AM -0500, Sean wrote:
> On Fri, 17 Nov 2006 09:38:02 +0100
> Nicolas Vilz <niv@iaglans.de> wrote:
> 
> > Just a note:
> > 
> > this doesn't work with bash 3.2. I think they altered the way of
> > trimming variables in this version.
> > 
> > on systems with bash 3.2 installed, i get
> > [master!linus-2.6/vm/vm]$ 
> > with the example above.
> > 
> > on systems with bash 3.1, it works properly.
> 
> Sorry bout that, I knew it was a bit fragile.  Was rather
> comical reading Junio's recent message about all the things not
> to do if you want portable shell code and noticing my 6 line script
> did 90% of them ;o)  Strange though, I downloaded Bash 3.2
> and gave it a try and didn't see the problem here..
> 
> Wanna try this small change, to see if it helps? :
> 
> #!/bin/bash
> BR=$(git symbolic-ref HEAD 2>/dev/null) || { echo "$@" ; exit ; }
> BR=${BR#refs/heads/}
> REL=$(git rev-parse --show-prefix)
> REL="${REL%\/}"
> LOC="${PWD%/$REL}"
> echo "[$BR!${LOC/*\/}${REL:+/$REL}]$ "
> 

That one did the job... funny, removing these two // did the job, for
both versions, 
GNU bash, version 3.1.17(1)-release (powerpc-unknown-linux-gnu) and
GNU bash, version 3.2.5(1)-release (x86_64-pc-linux-gnu).

Thx for fixing that script. It really helps me.

Sincerly
Nicolas

  parent reply	other threads:[~2006-11-17  9:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20061116130111.921396df.seanlkml@sympatico.ca>
2006-11-17  8:38 ` git-PS1 bash prompt setting Nicolas Vilz
2006-11-17  9:20   ` Sean
2006-11-19  6:28     ` Junio C Hamano
     [not found]   ` <20061117042051.d2fbddb6.seanlkml@sympatico.ca>
2006-11-17  9:52     ` Nicolas Vilz [this message]
2006-11-16 18:01 Sean
2006-11-16 18:35 ` Junio C Hamano
2006-11-26 14:27 ` Johannes Schindelin
2006-11-26 14:42   ` Sean
2006-11-26 15:18     ` Johannes Schindelin
     [not found]   ` <20061126094212.fde8cce7.seanlkml@sympatico.ca>
2006-11-26 15:05     ` Nicolas Vilz
2006-11-27  8:48       ` Junio C Hamano
2006-11-27 10:50         ` Nicolas Vilz
2006-11-27  6:54     ` Shawn Pearce
2006-11-27  7:49       ` Jakub Narebski
2006-11-27 12:56       ` Sean
     [not found]       ` <20061127075650.81a5a850.seanlkml@sympatico.ca>
2006-11-27 17:02         ` Shawn Pearce
2006-11-27 17:38           ` Sean

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=20061117095237.GD11468@fry.bender.fht \
    --to=niv@iaglans.de \
    --cc=git@vger.kernel.org \
    --cc=seanlkml@sympatico.ca \
    --cc=tytso@mit.edu \
    /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).