summaryrefslogtreecommitdiff
path: root/lib/git.zsh
AgeCommit message (Collapse)Author
2022-05-12Revert "fix(lib): don't return clean with `hide-dirty=1` in ↵Marc Cornellà
`parse_git_dirty`" (#10927)
2022-05-12fix(lib): don't return clean with `hide-dirty=1` in `parse_git_dirty` (#10897)Will LE
2022-01-03fix(lib): quote % in `git_remote_status`Marc Cornellà
2021-12-13fix(lib): %-quote git prompt functionsMarc Cornellà
2021-11-09style: use `-n` flag in `head` and `tail` commands (#10391)Kevin Burke
Co-authored-by: Marc Cornellà <hello@mcornella.com>
2021-10-09fix(lib): fix status exit code check in `git_prompt_status` (#10275)Pooya Vahidi
2021-01-16fix(lib): use -N syntax in `head` and `tail` to support Solaris (#6391)Marc Cornellà
Closes #6391 Co-authored-by: Sergey Mashkov <cy6erGn0m@gmail.com>
2021-01-02fix(lib): mark changes as MODIFIED on 'MM' in `git_prompt_status` (#9552)Seamile
In the output of `git status -sb`, 'MM' indicates there are both added and modified changes. This change marks that case as MODIFIED instead of ADDED.
2020-12-10chore!: notify breaking change in `git_prompt_info`Marc Cornellà
BREAKING CHANGE: the git config option to skip running `git_prompt_info` has changed from `oh-my-zsh.hide-status` to `oh-my-zsh.hide-info` (#9188).
2020-12-10feat(lib): show upstream branch in `git_prompt_info` (#9188)Bruno Borges
Show the remote branch the local branch is tracking if `ZSH_THEME_GIT_SHOW_UPSTREAM` is set, like so: `ZSH_THEME_GIT_SHOW_UPSTREAM=1`. Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-10-10lib: fix regex bug in git_prompt_statusMarc Cornellà
Fixes #9326
2020-10-09Fix performance drop of iterating over lines and other stuffMarc Cornellà
- Fix 'STASHED' key and unsupported syntax in 5.0.2 - Optimise `if` statement to make it more idiomatic.
2020-10-09git_prompt_status now uses hash lookups instead of multiple grepsBilly Conn
2020-10-09lib: hide git_prompt_status when hide-status is setMichał Dębski
Closes #4912 Closes #5137 Closes #8071
2020-07-06lib: safety fix and speed-ups for git.zsh prompt functions (#7804)Robert Estelle
2020-06-30Handle unset variables in various parts of the codebase (#8944)Patrick Moore
DISABLE_UNTRACKED_FILES_DIRTY, DISABLE_AUTO_TITLE, GIT_STATUS_IGNORE_SUBMODULES are not set Handle these variables not being set with conditional access. If the user has set -u option to report attempts to use undeclared / unassigned variable, accessing the variables needs to be conditional.
2020-02-10lib: add git function to determine repository name (#4989)Evan Chiu
Closes #4989 Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2019-11-06Fix badly resolved rebase conflictMarc Cornellà
2019-11-06Clean up ignore submodules logic in parse_git_dirtyMarc Cornellà
2019-11-06Add an option about git submodules to ignoreWang Guan
$GIT_STATUS_IGNORE_SUBMODULES can be used to specify handling of submodules. It can be: not set : ignore dirty submodules (this was default zsh behavior) "git" : do not use "--ignore-submodules" and let git choose, this obeys setting in .gitmodules other : comes into "--ignore-submodules=$GIT_STATUS_IGNORE_SUBMODULES"
2019-04-09lib: stop detecting git versions prior to 1.7.2Marc Cornellà
The 1.7.2 release was published in July 2010 [1]. It's about time to stop supporting older versions. Fixes #4583 [1] https://github.com/git/git/releases/tag/v1.7.2
2018-09-08lib: small change to git_compare_versionMarc Cornellà
Fixes #7118
2018-04-15Fix git_commits_{ahead,before} when no upstream branch is defined (#6658)Jacopo De Simoi
If @{u} is not defined, git rev-list will give an error; redirect to stderr the error and deal with this case in what follows.
2018-01-22Add match for `MM` (result of `git commit -p` on a single changed file) to ↵Kimberly Zick
git_prompt_status (#3632)
2017-11-14With zsh 5.4 a simple "local FLAGS" meant as an array must be explicitly ↵catull
declared so. This fix avoids the dreaded "parse_git_dirty:3: FLAGS: attempt to assign array value to non-array". (#6414)
2016-09-08Fix git_prompt_status() not showing ahead/behind/diverged status correctly ↵Yuichi Tanikawa
(#5388)
2016-09-05git: output nothing when no commits ahead or behindMarc Cornellà
This fixes old git_commits_ahead behavior and changes git_commits_behind to have the same behavior. Fixes #5355
2016-08-01Updated git_commits_ahead function (#5247)Steven
* Function wasn't returning correct value * Updated underlying git command * Kept echo command from previous function for backwards compatibility * Kept function consistent with git_commits_behind
2016-07-15lib/git.zsh: Added git_commits_behind function (#4450)Steven
* Added git_commits_behind function * Added 'command' to git_commits_behind function * git_commits_behind code review changes
2016-03-31Add git user profile functions for prompt displayAesop Wolf
2016-01-13Re-added $ZSH_THEME_GIT_PROMPT_EQUAL_REMOTEMichele Bologna
Re-added $ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE variable which was removed in 9f55213
2015-12-17Put `local var` declaration in its own line in lib/git.zshMarc Cornellà
In places, the local statement will override the exit code and the written command won't have the effect intended when it was written. For example, when it's not inside a git repo the exit code won't be true, but the local statement will make it true regardless. See #4708.
2015-12-14Move current_branch() from git plugin to core lib/git.zshAndrew Janke
Fixes #4085: core -> plugin dependency issue. Rename it to git_current_branch for clarity that it's git-specific. Update all plugins that were calling it to use new name. Fix variable leaks by making more variables in lib/git.zsh local. Have lib/git.zsh use [[ ]] instead of [ ] everywhere.
2015-09-23fix indentationMichele Bologna
2015-09-23Uniform git prompt equal remoteMichele Bologna
Uniform git prompt equal remote to all others prompts, setting the correct symbol (if applicable) to $git_remote_status, instead of echoing it. It also solves the problem pointed out in #3911
2015-06-15In addition to the already existing variables ZSH_THEME_GIT_PROMPT for behind,Michele Bologna
ahead and diverged remote, I added ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE.
2015-06-10Add git_prompt_behind and git_prompt_existsAdam Lindberg
This adds two new theme functions for git: * `git_prompt_behind` works in a identical fashion to `git_prompt_ahead` and will output a format variable (`ZSH_THEME_GIT_PROMPT_BEHIND`) if the branch is behind. * `git_prompt_remote` will output one format variable if the branch exists on remote (`ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS`), and another if the branch is unpublished (`ZSH_THEME_GIT_PROMPT_REMOTE_MISSING`). The old `git_prompt_ahead` has been changed. Using git log is subject to formatting in .gitconfig, which can be overridden and will break this function. Relying on rev-list is much more stable.
2015-06-10Added a possibility to display the remote branch and the number of commits ↵leif.hanack
you are ahead or behind
2014-12-14Merge pull request #3326 from DanielFGray/masterRobby Russell
ignore any grep aliases that might be defined
2014-11-19Switch back to oh-my-zsh.hide-dirty setting againMarc Cornellà
Commit 81004dfaba509ff62a13ba303ab941938d619326 reverted the change in 9b811fb625c03c30a766191cdf65a1c7c1fd96b2 when editing the merge conflict from #2928. This commit fixes that so that we don't make the same mistake again. First seen in http://git.io/Cdaj5Q
2014-11-16ignore any grep aliases that might be definedDanielFGray
2014-11-062928 merge conflictRobby Russell
2014-11-06Merge pull request #2323 from michaelorr/slow-git-fixRobby Russell
Renaming config for parse_git_dirty() to avoid collision
2014-07-15Merge pull request #2828 from r3dDoX/masterRobby Russell
removed a hardcoded 'origin' in git.zsh and added new function for number of commits ahead of remote
2014-07-03Fix POST_1_7_2_GIT check for parse_git_dirty submodules.Simon Buchan
2014-07-03Fix parse_git_dirty() when status.branch is set.Simon Buchan
2014-06-28git_prompt_info: ignore git-config errorsAlbert Krewinkel
Merged from #2906 The function `git_prompt_info` calls `git config` for its stdout output, but doesn't handle the stderr output. This can lead to problems, e.g. if the git config file is unreadable for some reason (permissions etc). This fixes the issue by simply ignoring the stderr output.
2014-06-28Add missing `command` wrapper for gitMikhail S. Pobolovets
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2014-06-10return 0 when not a git reponcanceill
before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes #2226
2014-05-26added prefix/suffix variable for customizabilityr3dDoX