Skip to content

Instantly share code, notes, and snippets.

@akoumjian
Last active July 17, 2016 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akoumjian/d464a69fa3b3cce8f0d5ad27a8e6f42c to your computer and use it in GitHub Desktop.
Save akoumjian/d464a69fa3b3cce8f0d5ad27a8e6f42c to your computer and use it in GitHub Desktop.
webapp:
git.latest:
- name: [revoked]
- rev: {{ git_rev }}
- target: /var/www/
- force_checkout: True
- force_reset: True
- force_fetch: True
- force_clone: True
- require:
- pkg: app-pkgs
- file: /var/www
- file: ssh_config
- file: deploykey
- file: publickey
ID: webapp
Function: git.latest
Name: [revoked]
Result: False
Comment: error: Your local changes to the following files would be overwritten by merge:
appname/settings.py
Please, commit your changes or stash them before you can merge.
Aborting
Changes already made: [revoked] was fetched, resulting in updated refs
Started: 02:41:19.819761
Duration: 367.149 ms
Changes:
[DEBUG ] LazyLoaded git.latest
[INFO ] Running state [redacted] at time 03:01:11.384449
[INFO ] Executing state git.latest for [redacted]
[INFO ] Checking remote revision for [redacted]
[INFO ] Executing command ['git', 'ls-remote', '[redacted]'] in directory '/home/ubuntu'
[DEBUG ] stdout: 2b873be167cd15a67828c31290d7a04f80a6c0f0 HEAD
2b873be167cd15a67828c31290d7a04f80a6c0f0 refs/heads/master
[INFO ] Executing command ['git', 'for-each-ref', '--format', '%(refname:short)', 'refs/heads/'] in directory '/var/www/'
[DEBUG ] stdout: master
[INFO ] Executing command ['git', 'for-each-ref', '--format', '%(refname:short)', 'refs/tags/'] in directory '/var/www/'
[INFO ] Checking local revision for /var/www/
[INFO ] Executing command ['git', 'rev-parse', 'HEAD'] in directory '/var/www/'
[DEBUG ] stdout: 129f4a6bf0f58ec44e7881a49cef0ac22226e489
[INFO ] Checking local branch for /var/www/
[INFO ] Executing command ['git', 'rev-parse', '--abbrev-ref', 'HEAD'] in directory '/var/www/'
[DEBUG ] stdout: master
[INFO ] Executing command ['git', 'remote', '--verbose'] in directory '/var/www/'
[DEBUG ] stdout: origin [redacted] (fetch)
origin [redacted] (push)
[INFO ] Executing command ['git', 'rev-parse', '2b873be167cd15a67828c31290d7a04f80a6c0f0^{commit}'] in directory '/var/www/'
[DEBUG ] stdout: 2b873be167cd15a67828c31290d7a04f80a6c0f0
[INFO ] Executing command ['git', 'rev-parse', 'origin/master'] in directory '/var/www/'
[DEBUG ] stdout: 2b873be167cd15a67828c31290d7a04f80a6c0f0
[INFO ] Executing command ['git', 'merge-base', '--is-ancestor', '129f4a6bf0f58ec44e7881a49cef0ac22226e489', '2b873be167cd15a67828c31290d7a04f80a6c0f0'] in directory '/var/www
/'
[INFO ] Executing command ['git', 'rev-parse', '--abbrev-ref', 'master@{upstream}'] in directory '/var/www/'
[DEBUG ] stdout: origin/master
[INFO ] Executing command ['git', 'symbolic-ref', '--quiet', 'HEAD'] in directory '/var/www/'
[DEBUG ] stdout: refs/heads/master
[INFO ] Executing command ['git', 'merge', '--ff-only', 'origin/master'] in directory '/var/www/'
[ERROR ] Command '['git', 'merge', '--ff-only', 'origin/master']' failed with return code: 1
[ERROR ] stdout: Updating 129f4a6..2b873be
[ERROR ] stderr: error: Your local changes to the following files would be overwritten by merge:
appname/settings.py
Please, commit your changes or stash them before you can merge.
Aborting
[ERROR ] retcode: 1
[ERROR ] Unexpected exception in git.latest state
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/states/git.py", line 1252, in latest
user=user
File "/usr/lib/python2.7/dist-packages/salt/modules/git.py", line 2222, in merge
ignore_retcode=ignore_retcode)['stdout']
File "/usr/lib/python2.7/dist-packages/salt/modules/git.py", line 299, in _git_run
raise CommandExecutionError(msg)
CommandExecutionError: Command 'git merge --ff-only origin/master' failed: error: Your local changes to the following files would be overwritten by merge:
appname/settings.py
Please, commit your changes or stash them before you can merge.
Aborting
[ERROR ] error: Your local changes to the following files would be overwritten by merge:
appname/settings.py
Please, commit your changes or stash them before you can merge.
Aborting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment