Code Monkey home page Code Monkey logo

git-prompt's Issues

Option for switching off exit code

(reinmar=fa04877) piotrus@dragonus /www/repo/dt/core> grep -R getCustomData *
1 (reinmar=fa04877) piotrus@dragonus /www/repo/dt/core> 

Hi, git-prompt is really cool, but one thing is missing - option for switching off displaying exit code in prompt. I don't like it, but I haven't found how to get rid of it :).

BTW. Why there's no link to this github project on http://volnitsky.com/project/git-prompt/ ?

Thanks,
Piotrek.

Overriding PROMPT_COMMAND breaks autojump

I'm a bit ignorant on the topic, but figured i'd post this anyway. git-prompt dosn't seem to be compatible with autojump (http://github.com/joelthelion/autojump), because it overwrites PROMPT_COMMAND.

I've tried guessing about how to fix it:
PROMPT_COMMAND_FUNCTION=prompt_command_function
PROMPT_COMMAND="$PROMPT_COMMAND_FUNCTION && ${PROMPT_COMMAND:-:}"

However my limited knowledge of PROMPT_COMMAND leaves me wanting.

Color issue with SHA1 hash on CentOS55

I am running the same script on OSX and CentOS 55: It's a colorization issue.

On CentOS, the following prompt
(M=f7e6a) [email protected] ~/test#

Will show =f7e6a black (it shows white on osx). Since my terminal has a black background, it appears invisible.

I tried changing a few settings with no success.

Please advise,
Thank you

rxvt-unicode doesn't like long command lines

Some commands (e.g. "ls *" in a directory with many files) produce very long command lines. git-prompt tries to set the title of the window to the currently-executing command line, and rxvt-unicode doesn't work correctly when the line is about 2000 or more characters long. (It puts the part after the first ~2000 characters into the terminal, which is very ugly.)

I think the solution is to truncate the command line before trying to use it as the terminal title. E.g.:

set_shell_label() {
    command_line="${@}"
    truncated_command_line=${command_line:0:200}
    xterm_label() { echo  -n "�]2;${truncated_command_line}�" ; }   # FIXME: replace hardcodes with terminfo codes
    [...]

This truncates the command line to 200 characters before sending it to the terminal.

Also, in exploring this problem I noticed that disable_set_shell_label doesn't work correctly for me. I fixed this problem by declaring disable_set_shell_label and enable_set_shell_label to have the "trace" attribute in bash. This is done by adding:

declare -ft disable_set_shell_label

and

declare -ft enable_set_shell_label

after the definitions of those functions in git-prompt.sh.

P.S. git-prompt is great; thanks for developing it!

changed files from parent dir leaks into the prompt

Below cut-n-past shows "cups/" in prompt. It shouldn't becase cups is from parent dir.

git status
On branch master
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified:   ../cups/printers.conf
modified:   ../cups/printers.conf.O
modified:   ../cups/subscriptions.conf
modified:   ../cups/subscriptions.conf.O

no changes added to commit (use "git add" and/or "git commit -a")
(M=78a58 cups/) root /etc/portage>

branch detection with new git

new git ( in my case 1.8.5.1 ) changed git status output, the '# ' prefix is gone

So I have to use now:

        eval " $(
                git status 2>/dev/null |
                    sed -n '
                        s/^On branch /branch=/p
                        s/^nothing to commi.*/clean=clean/p
                        s/^Initial commi.*/init=init/p
                        s/^Your branch is ahead of \(.\).\+\1 by [[:digit:]]\+ commit.*/freshness=${WHITE}↑/p
                        s/^Your branch is behind \(.\).\+\1 by [[:digit:]]\+ commit.*/freshness=${YELLOW}↓/p
                        s/^Your branch and \(.\).\+\1 have diverged.*/freshness=${YELLOW}↕/p
                    '
        )"

sed doesn't understand s/^(# )?On branch /branch=/p
so I fear the change has to check the git version

quote not properly escaped

consider the following output generated by a git status

#   new file:   jPDF_Test_V7/src/testdocs/ReleaseNotes.15.pdf
#   new file:   jPDF_Test_V7/src/testdocs/ReleaseNotes.pdf 
#   new file:   "jPDF_Test_V7/src/testdocs/Ringkj\302\257bing_01.pdf"

the last line will make git prompt fail

-bash: eval: line 1033: syntax error in conditional expression
-bash: eval: line 1033: syntax error near `added_files[${#added_files[@]}]=""jPDF_Test_V7/"'
-bash: eval: line 1033: `   [[ " ${added_files[*]} " =~ " "jPDF_Test_V7/ " ]] || added_files[${#added_files[@]}]=""jPDF_Test_V7/"'

cd -

I have problems with this command

 $ cd -
 bash: cd: OLDPWD not set

Where is the hash ?

when I use git-prompt in a ubuntu, this is the appearance of the prompt

 (M      )

don't see the hash.

the characteristics of my system

 $ git --version
 git version 1.7.1
 $ bash --version
 GNU bash, versión 4.1.5(1)-release (x86_64-pc-linux-gnu)
 $ cat /etc/*ele*
 DISTRIB_ID=Ubuntu
 DISTRIB_RELEASE=10.10
 DISTRIB_CODENAME=maverick
 DISTRIB_DESCRIPTION="Ubuntu 10.10"

Cannot enter 'Changed but not updated:'

Hi,

I never enter git status 'Changed but not updated:', can you give more comments?
I only see git status ' Changes not staged for commit:', which confuse me.

Thanks,
Steven.l

su support

I see there's even a TODO inside the code. Do you have any ideas how to fix these yet @lvv?

  • the screen title showing "su" and getting stuck there once you su
  • I thought I might need to also add the git-prompt stuff for root, but that doesn't seem to be the case, and it starts spitting out "No screen session found." after every command.

Thanks.

option for not showing screen's $WINDOW

Since I use a hardstatus that shows all the screen windows already, I don't need to see it on the prompt, so for now I set tty to empty in git-prompt.sh, but it'd be good to get a variable for it in the conf.

Syntax error expression in bash-completion repo

I have cloned the bash-completion repository.

when I move the dir repository I get

 $ cd bash-completion
 bash: eval: line 68: syntax error in conditional expression
 bash: eval: line 68: syntax error near `untracked_files[${#untracked_files[@]}]=""test/"'
 bash: eval: line 68: `          [[ " ${untracked_files[*]} ${modified_files[*]} ${added_files[*]} " =~ " "test/ " ]] || untracked_files[${#untracked_files[@]}]=""test/"'

MSys GIT support

Love you script.. I mean prompt.
It only it could work on msysgit...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.