Commit Graph

120 Commits

Author SHA1 Message Date
Jeremy Mathevet
7e26ae28bf Add kubernetes-context segment to powerline 2018-11-13 12:29:53 +00:00
sharils
d0f76548ce Add SCM_GIT_SHOW_STASH_INFO flag #914
In order to make `git_prompt_vars` run faster
As a user with slow `git stash list`
I want to be able to optionally disable running `git stash list` when
`git_prompt_vars` is executed
2018-10-16 22:05:06 +08:00
Nils Winkler
3d6d42ec2f Merge pull request #1211 from dracorp/fork
The function _git-hide-status is invoked to late
2018-07-18 09:19:42 +02:00
Gabriel Smadi
af16e9e68b Display only first line of Python 3.7 version 2018-07-14 20:39:19 -04:00
Piotr Rogoza
f484fadbb1 The function _git-hide-status is invoked to late 2018-07-12 06:32:11 +00:00
Ethan Edwards
1a7ebf4da7 change to setting variables to empty value before use 2018-04-30 13:40:08 -05:00
Ethan Edwards
10d075c9c5 merge latest upstream 2018-04-30 13:36:39 -05:00
Piotr Rogoża
67629aba2d On some hosts scm* functions does not work properly if a vcs tool is missing 2018-04-24 21:50:34 +02:00
Shashank Bharadwaj
353cb210d4 Add priliminary support for perforce SCM
This patch adds very simple support for the Perforce SCM:
    https://www.perforce.com/

Although perforce is proprietary software, it's somewhat prevalent in enterprise
companies. This patch looks to provide some basic bash_it functionality that
I've come to love for git. I base everything off of two perforce commands:
    $ p4 set
This command does not require a connection the perforce server, it simply tells
us if a directory is managed by the Perforce SCM or not. In addition the
command:
    $ p4 opened

is used to provide the list of pending changes in the client and the number of
opened files in the client. The `p4 opened` command requires a connection to the
perforce server, hence it's run under a `timeout` command. The "p4 opened"
processing into it's own bash file that now has to be sourced at the top-level
bash-it.sh. Since the processing in simple the newly added: _p4-opened-counts
function returns a number of things that are not currently used, but since I had
awk open and doing the processing, I've chosen to include them in the output
anyway.

Testing:
  - Tested with the powerline-multiline theme in a few perforce based
    workspaces/clients
  - Ran:
      ❯ shellcheck themes/p4helpers.theme.bash
    and fixed all the errors
  - Ran the test suite:
      ❯ test/run
      [...]
      182 tests, 0 failures, 1 skipped
2018-02-14 17:53:09 -08:00
Ethan Edwards
3eb5e037f9 GH-1140 add safe usage of SCM variable 2018-02-06 03:32:08 -06:00
Nils Winkler
fe1ae061cc Merge pull request #1018 from wendorf/git-helpers
Allow non-alphanumeric git branch names
2017-12-19 09:19:38 +01:00
Dan Wendorf
c5f2c408e7 SCM_CURRENT_USER supports accented characters
`tr 'A-Z' 'a-z'` will only convert non-accented characters. Switching to
`[:upper:]` and `[:lower:]` adds support for accents.
See https://github.com/koalaman/shellcheck/wiki/SC2018

Additionally, printf's character splitting does not support accented
characters, so output isn't as expected. Using bash's variable expansion
syntax instead will correctly get the full accented character.
2017-12-18 09:05:33 -08:00
Dan Wendorf
150e82b221 Refactor git functionality into githelpers.theme.bash
- Add unit tests around git functionality
2017-12-18 09:05:33 -08:00
Nils Winkler
0267554c22 Fixed issue introduced in #1109
With the added $ in there, it would show an error in Git repos:

-bash: ##: command not found
2017-12-11 11:35:52 +01:00
Robin Richtsfeld
c86038d61d Fix some Bash issues 2017-12-09 15:06:22 +01:00
Nils Winkler
68409f3566 Revert "Update base.theme.bash with RUBY interpreter version check" 2017-11-28 08:25:25 +01:00
Luis Felipe Sánchez
31a0c6a9fd Update base.theme.bash
Added feature to detect the ruby version interpreter
```bash
       rb_interp_prompt
```
and added to the existing function to be used in any theme.
2017-11-22 10:14:38 -05:00
Telmo Costa
1fd3fa2440 Allow theming git stash chars 2017-11-12 17:42:11 +00:00
Wei-Han Chen
5ff7df1607 support bash-preexec 2017-11-07 02:59:25 +08:00
Nils Winkler
145ec5dfaa Copied command_exists function to the helpers lib so that there is no hidden dependency on the base plugin
The original command_exists function will stay in the base plugin, but will no longer be used by other plugins or themes.
2017-09-17 21:05:59 +02:00
Nils Winkler
c33861a9b0 Change dependency check for battery_char function 2017-06-24 17:31:31 +02:00
Nils Winkler
3fac1c7ea5 Fix checks for battery plugin
These now check for the presence of the required function instead of
checking for the battery file in the enabled directory.
2017-06-24 17:31:31 +02:00
林博仁
e2d3419639 Fix more space-in-path-proof issues
Signed-off-by: 林博仁 <Buo.Ren.Lin@gmail.com>
2017-05-02 11:11:13 +08:00
Ivan Font
0ce7b8f4e0 Add function for user@host in prompt 2017-04-23 18:02:27 -07:00
DenMat
01e5cee40c make this consistent like other declarations 2017-04-19 19:03:40 +10:00
DenMat
a5c693b6bc Addresses vulnerability describe here https://github.com/Bash-it/bash-it/issues/920
* white lists acceptable characters and replaces dangerous characters with '-'
2017-04-19 18:45:50 +10:00
Nils Winkler
889ce4a9f3 Merge pull request #886 from font/scm_prompt_char_info
Add AIO function to echo scm prompt char and info
2017-02-12 10:15:58 +01:00
Ivan Font
31e3d78ae4 Fix exact match regular expression for macOS 2017-01-29 22:38:58 -08:00
Ivan Font
1f0108193d Fix for issue #883 2017-01-17 21:21:19 -08:00
Ivan Font
48d4ad274a Add prefix and suffix capability to SCM char 2017-01-16 23:20:31 -08:00
Ivan Font
9e4f1d6d80 Refactor common code into scm_prompt_info_common 2017-01-16 22:14:15 -08:00
Ivan Font
f9b1dcee26 Add AIO function to echo scm prompt char and info
Invoking the scm_char and scm_prompt_info functions separately for PS1
duplicates calls to the scm and scm_prompt_char functions to check what
${SCM}, if any, we currently reside in. This problem was exacerbated
when working outside of any repo as we had to go through all the
conditionals just to determine we're not in any scm repo. Unnecessary
conditionals slows down the prompt so this adds a new function that
streamlines printing out both the scm char and scm prompt info with one
invocation.
2017-01-16 22:14:15 -08:00
Ivan Font
a70b769817 Remove references to GIT_THEME_* variables 2017-01-04 17:43:56 -08:00
Ivan Font
1d55249181 Refactor functions and update documentation
Add new variable to enable/disable git prompt minimal status information
and consolidate functions for code re-use. Also update README
documentation to capture the usage of new variable.
2017-01-04 15:48:32 -08:00
Ivan Font
a068e3b66e Add option for basic git status prompt
Fixes #873
2016-12-31 12:43:23 -08:00
Ivan Font
771082cdc2 Add prefix/suffix for clock prompt and clock char 2016-12-05 09:04:29 -08:00
MunifTanjim
8c9777df43 revert pull 797 2016-10-21 21:03:51 +06:00
MunifTanjim
a2a6fa2812 refactor themes to support standardized clock functions 2016-10-18 20:58:07 +06:00
MunifTanjim
8dde691671 standardize clock functions 2016-10-18 20:31:07 +06:00
MunifTanjim
08fba38c43 fix backward compatibility 2016-10-17 16:10:44 +06:00
MunifTanjim
7d901b11b6 seperate clock_char function 2016-10-17 04:11:09 +06:00
MunifTanjim
01dab32683 modify clock prompt for better customizability 2016-10-17 03:37:25 +06:00
MunifTanjim
4468c1b126 improve scm_prompt_info 2016-10-08 12:44:34 +06:00
Sam Gunaratne
1a4c03b08c Fixes issue with PROMPT_COMMAND ending in semi-colon 2016-08-03 10:04:24 +01:00
Yuhao Wu
af96da5d11 Fix bug: themes break global $PROMPT_COMMAND variable
Safely append functions to $PROMPT_COMMAND instead of setting it.
2016-07-07 17:13:00 +09:00
Robert Rauch
669d068b12 Support HG_ROOT containing whitespaces 2016-06-02 10:36:37 +02:00
Konstantin Gredeskoul
36d994dec5 Explained git pair and a more reliable fallback
- Added more information to the README about the practice of using `git
  pair`, and provided instructions on installing the support.

- Write a more reliable fallback that uses `user.name` to extract user
  initials, when `user.initials` aren't set.
2016-03-16 20:15:20 -07:00
Konstantin Gredeskoul
b70018e531 Adding support for git user & git pair 2016-03-14 03:42:38 -07:00
Robert Rauch
ba5e7c9268 Speed up $PROMPT_COMMAND by using rvm-prompt
Running `rvm tools identifier` seems to be really slow. Using [`rvm-prompt`](https://rvm.io/workflow/prompt) greatly speeds up the evaluation of `$PROMPT_COMMAND`.
2016-02-06 21:19:30 +01:00
Eduardo Bellido Bellido
c290aa9638 Fix an error when showing the status of a git repo 2016-02-03 22:58:19 +01:00