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

Re: [PATCH] Bash snippet to show branch and patch in bash prompt

From
CMCatalin Marinas <catalin.marinas@arm.com>
Date
Oct 30, 2006, 10:46 UTC
Message-ID
<tnxhcxm2i9j.fsf@arm.com>
In-Reply-To
<20061030104225.11875.57076.stgit@lathund.dewire.com>
Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
Show 30 quoted lines
> From: Robin Rosenberg <robin.rosenberg@dewire.com>
>
> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
> ---
>
>  contrib/stgbashprompt.sh |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/contrib/stgbashprompt.sh b/contrib/stgbashprompt.sh
> new file mode 100755
> index 0000000..792da53
> --- /dev/null
> +++ b/contrib/stgbashprompt.sh
> @@ -0,0 +1,16 @@
> +# include this in your bashrc or copy to /etc/bash_completions.d
> +
> +if [ "$PS1" ]; then
> +    # trap 'PS1="\u@\h [$(stg top)] \w]\$ "' DEBUG
> +    function stgtag
> +    {
> +	br=$(stg branch 2>/dev/null)
> +	top=$(stg top 2>/dev/null)
> +	if [[ -n "$br$top" ]];then
> +	    echo "[$top@$br]"
> +	    return
> +	fi
> +    }
> +    PS1='\u@\h$(stgtag)\w\$ '
> +
> +fi
Isn't this the same patch? "stg refresh" :-)?
-- 
Catalin

P.S. could you please send them to my catalin.marinas@gmail.com
Previous: Robin RosenbergNext: Robin Rosenberg
Message 2 of 4 in “Bash snippet to show branch and patch in bash prompt”
  1. Bash snippet to show branch and patch in bash promptRobin Rosenberg, Oct 30, 2006
  2. Catalin MarinasOct 30, 2006
  3. Robin RosenbergOct 30, 2006
  4. Robin RosenbergOct 30, 2006

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.