Commit b4f1ac57 authored by Samuel Sirois's avatar Samuel Sirois
Browse files

Check if local branch is ahead of remote branch

We wouldn't want to loose unpushed code!
parent cd8c4c85
......@@ -84,7 +84,12 @@ def verif():
print red('Local branch "' + localBranch + '" is not present on "' + remoteName + '" remote.')
# to do, la pusher (git push remoteName localBranch)
# - pour chaque Branch, est ce qu'il y a des commits non-pushes (git branch -vv)
print green('Verify branches status against remote...');
branches = local('git branch --list -vv', capture=True).splitlines()
pattern = re.compile('.*\[.* ahead .*\].*')
for branch in branches:
if (pattern.match(branch)):
print red('Local branch "' + branch.replace('*', '').strip().split()[0] + '" is ahead of remote branch.');
# - est ce qu'il y a du code non-stage (git status -s)
# on s'arrete a chaque alerte, et on demande quoi faire...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment