Skip to content

Commit 33b8b78

Browse files
author
Rakotomandimby Mihamina
authored
Merge pull request magicmonty#538 from fox-forks/hyperupcall-readme
readme: Cleanup inconsistent spacing and syntax
2 parents ec14bec + 3bc44fc commit 33b8b78

File tree

1 file changed

+48
-39
lines changed

1 file changed

+48
-39
lines changed

README.md

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This prompt is a port of the "Informative git prompt for zsh" which you can
66
find [here](https://github.com/olivierverdier/zsh-git-prompt)
77

8-
A ``bash`` prompt that displays information about the current git repository.
8+
A `bash``prompt that displays information about the current git repository.
99
In particular the branch name, difference with remote branch, number of files
1010
staged, changed, etc.
1111

@@ -25,11 +25,13 @@ The prompt may look like the following:
2525
* ``(experimental↓2↑3|✔)``: on branch ``experimental``; your branch has diverged by 3 commits, remote by 2 commits; the repository is otherwise clean
2626
* ``(:70c2952|✔)``: not on any branch; parent commit has hash ``70c2952``; the repository is otherwise clean
2727

28-
## Prompt Structure
28+
## Prompt Structure
2929

3030
By default, the general appearance of the prompt is::
3131

32-
(<branch> <upstream branch> <branch tracking>|<local status>)
32+
```plaintext
33+
(<branch> <upstream branch> <branch tracking>|<local status>)
34+
```
3335

3436
The symbols are as follows:
3537

@@ -51,7 +53,7 @@ The symbols are as follows:
5153
- ``↓m↑n``: branches diverged, other by ``m`` commits, yours by ``n`` commits
5254
- ``L``: local branch, not remotely tracked
5355
- Branch Symbol:<br />
54-
When the branch name starts with a colon ``:``, it means it's actually a hash, not a branch (although it should be pretty clear, unless you name your branches like hashes :-)
56+
- When the branch name starts with a colon ``:``, it means it's actually a hash, not a branch (although it should be pretty clear, unless you name your branches like hashes :-)
5557

5658
## Installation
5759

@@ -81,7 +83,8 @@ git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt -
8183
```
8284

8385
Add to the `~/.bashrc`:
84-
```
86+
87+
```bash
8588
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
8689
GIT_PROMPT_ONLY_IN_REPO=1
8790
source "$HOME/.bash-git-prompt/gitprompt.sh"
@@ -99,22 +102,22 @@ fi
99102
sudo install -m 666 gitprompt.fish /usr/share/fish/tools/web_config/sample_prompts/
100103
fish_config
101104
```
102-
to install the bash-git-prompt as a choice under the prompt tab of the web config. Selecting this will copy it to
103-
~/.config/fish/functions/fish_prompt.fish
105+
106+
&nbsp;to install the bash-git-prompt as a choice under the prompt tab of the web config. Selecting this will copy it to
107+
`~/.config/fish/functions/fish_prompt.fish`
104108

105109
- You can also do
106110

107111
```sh
108112
mkdir -p ~/.config/fish/functions/
109113
cp gitprompt.fish ~/.config/fish/functions/fish_prompt.fish
110114
```
111-
to overwrite the current prompt with the bash-git-prompt directly
112115

116+
&nbsp;to overwrite the current prompt with the bash-git-prompt directly
113117

114118
### All configs for .bashrc
115119

116120
```sh
117-
118121
# Set config variables first
119122
GIT_PROMPT_ONLY_IN_REPO=1
120123

@@ -171,6 +174,7 @@ in your home directory, then the Custom theme is used.**
171174
Ubuntu requires a bit more spacing for some characters so it has its own themes.
172175

173176
These can be listed with `git_prompt_list_themes`:
177+
174178
```sh
175179
git_prompt_list_themes | grep Ubuntu
176180
```
@@ -219,8 +223,8 @@ If you use a custom theme in `.git-prompt-colors.sh`, please set `GIT_PROMPT_THE
219223
- You can define `prompt_callback` function to tweak your prompt dynamically.
220224

221225
```sh
222-
function prompt_callback {
223-
if [ `jobs | wc -l` -ne 0 ]; then
226+
prompt_callback() {
227+
if [ $(jobs | wc -l) -ne 0 ]; then
224228
echo -n " jobs:\j"
225229
fi
226230
}
@@ -235,7 +239,6 @@ function prompt_callback {
235239

236240
- You can show an abbreviated `username/repo` in the prompt by setting `GIT_PROMPT_WITH_USERNAME_AND_REPO=1` and setting the placeholder `_USERNAME_REPO_` in your `GIT_PROMPT_PREFIX`. You can also add a `GIT_PROMPT_USERNAME_REPO_SEPARATOR=" | "` so the `username/repo` is nicely separated if there is a remote and if there is no remote, neither the username/repo part nor the separator will be shown. See the theme `Single_line_username_repo.bgptheme` for an example.
237241

238-
239242
- There is an indicator at the start of the prompt, which shows
240243
the result of the last executed command by if you put the placeholder
241244
`_LAST_COMMAND_INDICATOR_` in any of the prompt templates.
@@ -290,72 +293,78 @@ git_prompt_reset
290293
git_prompt_toggle
291294
```
292295

293-
294296
**Enjoy!**
295297

296298
## Alternative RPM Install
297299

298300
This project ships an RPM spec to simplify installation on RHEL and
299301
clones. If you wish to install from RPM, you may first build the RPM
300302
from scratch by following this procedure:
303+
301304
* Clone this repository and tag the release with a version number
302305

303306
````sh
304-
git tag -a -m "Tag release 1.1" 1.1
307+
git tag -a -m "Tag release 1.1" 1.1
305308
````
306309

307310
* Run the following command to create a tarball:
308311

309312
````sh
310-
VER=$(git describe)
311-
# replace dash with underscore to work around
312-
# rpmbuild does not allow dash in version string
313-
VER=${VER//\-/_}
314-
git archive \
315-
--format tar \
316-
--prefix=bash-git-prompt-${VER}/ \
317-
HEAD \
318-
-- *.sh \
319-
*.fish \
320-
README.md \
321-
themes \
322-
> bash-git-prompt-${VER}.tar
323-
mkdir -p /tmp/bash-git-prompt-${VER}
324-
sed "s/Version:.*/Version: ${VER}/" \
325-
bash-git-prompt.spec \
326-
> /tmp/bash-git-prompt-${VER}/bash-git-prompt.spec
327-
OLDDIR=$(pwd)
328-
cd /tmp
329-
tar -uf ${OLDDIR}/bash-git-prompt-${VER}.tar \
330-
bash-git-prompt-${VER}/bash-git-prompt.spec
331-
cd ${OLDDIR}
332-
gzip bash-git-prompt-${VER}.tar
333-
mv bash-git-prompt-${VER}.tar.gz bash-git-prompt-${VER}.tgz
313+
VER=$(git describe)
314+
# replace dash with underscore to work around
315+
# rpmbuild does not allow dash in version string
316+
VER=${VER//\-/_}
317+
git archive \
318+
--format tar \
319+
--prefix=bash-git-prompt-${VER}/ \
320+
HEAD \
321+
-- *.sh \
322+
*.fish \
323+
README.md \
324+
themes \
325+
> bash-git-prompt-${VER}.tar
326+
mkdir -p /tmp/bash-git-prompt-${VER}
327+
sed "s/Version:.*/Version: ${VER}/" \
328+
bash-git-prompt.spec \
329+
> /tmp/bash-git-prompt-${VER}/bash-git-prompt.spec
330+
OLDDIR=$(pwd)
331+
cd /tmp
332+
tar -uf ${OLDDIR}/bash-git-prompt-${VER}.tar \
333+
bash-git-prompt-${VER}/bash-git-prompt.spec
334+
cd ${OLDDIR}
335+
gzip bash-git-prompt-${VER}.tar
336+
mv bash-git-prompt-${VER}.tar.gz bash-git-prompt-${VER}.tgz
334337
````
335338

336339
* Log into an RHEL or clones host and run:
337340

338341
````sh
339342
rpmbuild -ta bash-git-prompt-xxx.tar.gz
340343
````
344+
341345
Then you may publish or install the rpm from "~/rpmbuild/RPMS/noarch".
342346

343347
## License
348+
344349
This code is under the [BSD 2 Clause (NetBSD) license][license].
345350

346351
## Who Are You?
352+
347353
The current maintainer of the original bash-git-prompt is [Martin Gondermann][magicmonty].
348354

349355
## Contributing
356+
350357
If you want to contribute you can look for issues with the label [up-for-grabs][upforgrabs].
351358
Please leave a comment on the issue, that you want to fix it, so others know, the labels are "taken".
352359

353360
Pull requests are welcome. I will check them and merge them, if I think they help the project.
354361

355362
## Similar projects
356-
https://github.com/ohmybash/oh-my-bash
363+
364+
- [oh-my-bash](https://github.com/ohmybash/oh-my-bash]
357365

358366
## Donations
367+
359368
I accept tips through [Flattr][flattr].
360369

361370
[![Flattr](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=magicmonty&url=https%3A%2F%2Fgithub.com%2Fmagicmonty%2Fbash-git-prompt)

0 commit comments

Comments
 (0)