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

lib/git.zsh: Added git_commits_behind function #4450

Merged
merged 3 commits into from Jul 15, 2016

Conversation

stevenspasbo
Copy link
Contributor

When updating my git prompt, I noticed there was a function for git_commits_ahead, but not one for git_commits_behind. The whitespace edit was an unintentional side effect from emacs.

@dschaller
Copy link

👍

@robbyrussell robbyrussell added git Status: testers needed Pull Requests that are waiting for testers to merge Area: core Issue or PR related to core parts of the project labels Oct 3, 2015
@thuandt
Copy link
Contributor

thuandt commented Oct 21, 2015

👍

1 similar comment
@sachin21
Copy link
Contributor

👍

@warriorpostman
Copy link

Is this PR just in need of tester confirmation? I'd love to help out.

@mcornella
Copy link
Member

I'd expect this function to follow the same convention as the *_ahead function. That is, using appropriate variables and a similar algorithm, i.e. using git log, though the *_ahead function uses grep, wc and tr which could be dropped using the appropriate parameters to git log.

@mcornella
Copy link
Member

Ignore my last algorithm suggestion. It seems the fastest more concise way to get this is using git rev-list and the HEAD..@{upstream} range:

git rev-list HEAD..@{upstream}

No need for current_branch nor getting the revision hash of @{u} since rev-list already understands @{u}.

@stevenspasbo
Copy link
Contributor Author

stevenspasbo commented Jul 7, 2016

Changes were made and are ready for review/testing.

@mcornella
Copy link
Member

LGTM

@mcornella mcornella merged commit 96a2092 into ohmyzsh:master Jul 15, 2016
zoli added a commit to zoli/oh-my-zsh that referenced this pull request Jul 17, 2016
* 'master' of github.com:robbyrussell/oh-my-zsh: (44 commits)
  lib/git.zsh: Added git_commits_behind function (ohmyzsh#4450)
  Rename getgb plugin to gb
  Rename gb completion file to more conventional _gb
  Fix formatting of gb plugin completion
  Add more information to the README
  Add README to gb plugin
  Add plugin for Gb completion (http://getgb.io)
  bundler plugin: Simplify retrieval of cpu count on OSX (ohmyzsh#5180)
  Fix gfg function completion definition
  Fix man-preview completion definition
  Fix issue with `dash` as the default `/bin/sh` script executing program. (ohmyzsh#5177)
  znt: update to v2.2.1 (ohmyzsh#5174)
  emacs plugin tweak to open buffer from stdin (ohmyzsh#5126)
  Update taskwarrior completion to 2.5.1 (ohmyzsh#5171)
  Remove undesirable hardcoding of PATH into zshrc (ohmyzsh#4925)
  Add README for OSX plugin and refactor plugin file
  Open finder to PWD - part 2 (ohmyzsh#5165)
  Add ofd() to OSX plugin to open finder on current directory (ohmyzsh#5164)
  add 'mvn clean install -DskipTests --offline' alias to speed up maven compile (ohmyzsh#5153)
  Peepcode theme: Don't try to use RVM if it's not available (ohmyzsh#5154)
  ...
fdgogogo pushed a commit to fdgogogo/oh-my-zsh that referenced this pull request Jul 19, 2016
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
@stevenspasbo stevenspasbo deleted the git_commits_behind branch July 20, 2016 01:09
atsuya pushed a commit to atsuya/oh-my-zsh that referenced this pull request Jul 23, 2016
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
foobacca pushed a commit to foobacca/oh-my-zsh that referenced this pull request Jul 29, 2016
* origin/master:
  Fix hg call when missing on archlinux with command-not-found (ohmyzsh#5218)
  adding python virtualenv support to the prompt (ohmyzsh#5031)
  Updated _docker-compose to the latest version (from 0.1.0 to  1.5.0). (ohmyzsh#5215)
  Update emacs plugin. (ohmyzsh#5201)
  Remove warning lines from phing completion
  Cleans up phing plugin.
  lib/git.zsh: Added git_commits_behind function (ohmyzsh#4450)
freecastle added a commit to freecastle/oh-my-zsh that referenced this pull request Aug 22, 2016
* 'master' of https://github.com/robbyrussell/oh-my-zsh:
  Fix hg call when missing on archlinux with command-not-found (ohmyzsh#5218)
  adding python virtualenv support to the prompt (ohmyzsh#5031)
  Updated _docker-compose to the latest version (from 0.1.0 to  1.5.0). (ohmyzsh#5215)
  Update emacs plugin. (ohmyzsh#5201)
  Remove warning lines from phing completion
  Cleans up phing plugin.
  lib/git.zsh: Added git_commits_behind function (ohmyzsh#4450)
  Rename getgb plugin to gb
  Rename gb completion file to more conventional _gb
  Fix formatting of gb plugin completion
  Add more information to the README
  Add README to gb plugin
  Add plugin for Gb completion (http://getgb.io)
mhowell pushed a commit to mhowell/oh-my-zsh that referenced this pull request Aug 23, 2016
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
tedbundyjr pushed a commit to tedbundyjr/oh-my-zsh that referenced this pull request Sep 28, 2016
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
DennisDenuto pushed a commit to DennisDenuto/oh-my-zsh that referenced this pull request Oct 29, 2016
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
avleen pushed a commit to avleen/oh-my-zsh that referenced this pull request Dec 23, 2016
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
ekcode pushed a commit to ekcode/oh-my-zsh that referenced this pull request Apr 5, 2017
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
seth-cohen pushed a commit to seth-cohen/oh-my-zsh that referenced this pull request Oct 29, 2018
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
jmartindf pushed a commit to jmartindf/oh-my-zsh that referenced this pull request Nov 10, 2018
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
@mcornella mcornella removed the Status: testers needed Pull Requests that are waiting for testers to merge label Oct 24, 2019
spiliopoulos pushed a commit to spiliopoulos/zsh-config that referenced this pull request Jun 17, 2020
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Issue or PR related to core parts of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants