Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier install #10

Open
jart opened this issue Aug 26, 2015 · 23 comments
Open

Easier install #10

jart opened this issue Aug 26, 2015 · 23 comments

Comments

@jart
Copy link

jart commented Aug 26, 2015

Why go to the trouble of installing a package through homebrew in order to customize PS1? What about Linux users?

Consider instead maintaining a "binary" release file in your repository. You could just have a makefile cat everything together, so long as you remember to run it before each commit.

Then your install instructions could be simple and transparent:

wget -O ~/.git-radar.bashrc https://raw.githubusercontent.com/michaeldfallen/git-radar/master/.git-radar.bashrc
sed -i -e '/.git-radar.bashrc/d' ~/.bashrc
echo source ~/.git-radar.bashrc >>~/.bashrc
source ~/.git-radar.bashrc
@emirozer
Copy link

+1

1 similar comment
@codelitt
Copy link

+1

@michaeldfallen
Copy link
Owner

Awesome, thanks for the suggestion. As I work mostly on mac when I release something that's usually my first port of call. Sorry about that.

Would this assume that the PS1 set in the .git-radar.bashrc file you propose would augment the existing PS1? Something like:

export PS1="$PS1$(render-radar)"

Just trying to think through how this hangs together. It's definitely something I'm interested in doing, especially since I'm switching soon off Mac (sore wrists from the crappy keyboards).

@michaeldfallen
Copy link
Owner

👍

1 similar comment
@TinOo512
Copy link

+1

@Fuxy22
Copy link

Fuxy22 commented Aug 26, 2015

👍 Wish there was a fast and easy way to install in Linux to.

@DanielJonesEB
Copy link

+1, not least of all to get this working on Bash in MinGW on Windows.

@paddykontschak
Copy link

+1

@jdutriaux
Copy link

👍 for easy install on Linux. (Particularly for zsh)

@jackmaney
Copy link

👍

1 similar comment
@hallzy
Copy link
Contributor

hallzy commented Aug 27, 2015

+1

@otoolep
Copy link

otoolep commented Aug 27, 2015

+1

Interesting project, but yeah, I ain't going to mess with my existing git setup without explicit directions on installing on Linux. Suggested instructions for Linux could act as a guide.

@hallzy
Copy link
Contributor

hallzy commented Aug 27, 2015

What I was able to is clone this repo, add the git-radar executable to a bin (some directory like /bin or something you have added to your path), and add that export command that is in the readme of this repo to my bashrc and that seems to have made it work on ubuntu.

As per issue #16 I did need to make that quick fix given by dbrown, but we should not need that soon as it seems that issue should be resolved once the pull request is merged.

@marcvangend
Copy link

Great to see you're working on this, I'd love to give git-radar a try on Linux.

@jart
Copy link
Author

jart commented Aug 27, 2015

@michaeldfallen No I would propose the .git-radar.bashrc replace the existing PS1 entirely. If someone installs your script, they've given you permission to replace their bash prompt. If they want their own prefix, they can add it in their own .bashrc after your script is sourced. Also embedding the override in the file itself also makes it easier for people to upgrade.

@marcvangend
Copy link

@jart I wouldn't be so sure. Someone may have committed to the git-radar prompt for git-controlled directories, but what if you want to include something similar for bzr-controlled directories, for instance? IMHO users should be able to add the git-radar output to the prompt the way he/she wants to.

@jart
Copy link
Author

jart commented Aug 27, 2015

@marcvangend Then they would just say in their .bashrc:

source ~/.git-radar.bashrc
PS1="rofl bzr $PS1"

@sargas
Copy link

sargas commented Aug 27, 2015

Have you guys realized that parts of git-radar doesn't pass existing tests under Linux? The first priority should be getting the tests to pass on a GNU userland. As of right now, the code uses BSD touch and stat options that probably break the auto-fetching capability (and makes some wrong assumptions about padding).

@jart 👎 to overriding PS1. I'm trying to picture how this would work in oh-my-zsh:

source ~/.git-radar.zshrc
git_radar_prompt=$PROMPT
source $ZSH/oh-my-zsh.sh
export PROMPT="$PROMPT$git_radar_prompt"

As opposed to:

source ~/.git-radar.sh
source $ZSH/oh-my-zsh.sh
export PROMPT="$PROMPT$(git-radar --zsh --fetch)"

where git-radar is now a shell function and .git-radar.sh is a generated file that works in zsh or bash (although the option to the function would still control what control characters are outputted)

or a simple:

source $ZSH/oh-my-zsh.sh
export PROMPT="$PROMPT$(git-radar --zsh --fetch)"

where git-radar is just a self-contained program from cat-ing the existing git-radar and radar-base.sh files, with prompt.* turned into shell functions in radar-base.sh

And what is the motivation for the sed line in your example instructions? It'll give anyone who already has source ~/.git-radar.bashrc in their ~/.bashrc an error on shell startup.

@mtyurt
Copy link

mtyurt commented Aug 28, 2015

Is there any official instruction to install on Linux? I couldn't manage to do it, I'm a shame to my father...

@cbandera
Copy link

@mtyurt There are no "official" instructions. But I just symlinked the git-radar executable into /usr/local/bin and added the export PS1... line into my .bashrc

@oceatoon
Copy link

+1 to make simple linux install instructions

@vladimir-1980
Copy link

👍

@kain88-de
Copy link
Contributor

Solved by #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests