mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
- move alias from git plugin to git-svn
- use local variables for the get_svnversion function
This commit is contained in:
parent
fcd318089d
commit
b3277242f0
2 changed files with 15 additions and 12 deletions
|
|
@ -1,14 +1,23 @@
|
|||
# Git and svn mix
|
||||
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
|
||||
compdef git-svn-dcommit-push=git
|
||||
|
||||
alias gsr='git svn rebase'
|
||||
alias gsd='git svn dcommit'
|
||||
|
||||
#
|
||||
# git equivalent of svnversion
|
||||
#
|
||||
get_svnversion()
|
||||
{
|
||||
alias git_svnversion="git svn find-rev `git describe --always` 2>/dev/null"
|
||||
LANG=C SVN_VERSION=`/usr/bin/svnversion`
|
||||
if [ "X$SVN_VERSION" == "Xexported" -o "X$SVN_VERSION" == "X" ]; then
|
||||
git_svnversion
|
||||
local git_version=`git describe --always 2>/dev/null`
|
||||
local git_svnversion=`git svn find-rev $git_version 2>/dev/null`
|
||||
local svn_version
|
||||
LANG=C svn_version=`/usr/bin/svnversion`
|
||||
if [ "X$svn_version" == "Xexported" -o "X$svn_version" == "X" ]; then
|
||||
echo $git_svnversion
|
||||
else
|
||||
echo $SVN_VERSION
|
||||
echo $svn_version
|
||||
fi
|
||||
}
|
||||
alias svnversion=get_svnversion
|
||||
|
|
|
|||
|
|
@ -39,12 +39,6 @@ compdef _git gm=git-merge
|
|||
alias grh='git reset HEAD'
|
||||
alias grhh='git reset HEAD --hard'
|
||||
|
||||
# Git and svn mix
|
||||
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
|
||||
compdef git-svn-dcommit-push=git
|
||||
|
||||
alias gsr='git svn rebase'
|
||||
alias gsd='git svn dcommit'
|
||||
#
|
||||
# Will return the current branch name
|
||||
# Usage example: git pull origin $(current_branch)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue