git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: knittl <knittl89@googlemail.com>
To: git@vger.kernel.org, Shawn Pearce <spearce@spearce.org>
Subject: [PATCH v2] bash: Match lightweight tags in prompt
Date: Wed, 1 Dec 2010 14:17:00 +0100	[thread overview]
Message-ID: <AANLkTinvAnGh6PU2bRrx_uGU81zjVHcFmZWwqpKpjO=1@mail.gmail.com> (raw)

>From 6be63c5bc1a411a13a012a6508a7301bed7faec6 Mon Sep 17 00:00:00 2001
From: Daniel Knittl-Frank <knittl89+git@googlemail.com>
Date: Fri, 19 Nov 2010 16:40:02 +0100
Subject: [PATCH] bash: Match lightweight tags in prompt

the bash prompt would display a commit's SHA1 when having checked out a
lightweight tag.  provide `--tags` to `git describe` in the completion
script, so it will display lightweight tag names (as it already does for
annotated tags)

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
---
version two of my patch, adding the missing s-o-b and extending commit message

the diff is still the same as v1

 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index f710469..604fa79 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -261,7 +261,7 @@ __git_ps1 ()
 				(describe)
 					git describe HEAD ;;
 				(* | default)
-					git describe --exact-match HEAD ;;
+					git describe --tags --exact-match HEAD ;;
 				esac 2>/dev/null)" ||

 				b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." ||
-- 
1.7.3.2.334.gd1031



-- 
typed with http://neo-layout.org
myFtPhp -- visit http://myftphp.sf.net -- v. 0.4.7 released!

             reply	other threads:[~2010-12-01 13:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 13:17 knittl [this message]
2010-12-01 19:53 ` [PATCH v2] bash: Match lightweight tags in prompt 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='AANLkTinvAnGh6PU2bRrx_uGU81zjVHcFmZWwqpKpjO=1@mail.gmail.com' \
    --to=knittl89@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /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).