git.latest fails after first run
After running highstate with git.latest once, subsequent runs fail with:
----------
State: - git
Name: https://github.com/user/repo.git
Function: latest
Result: False
Comment: fatal: destination path '/home/user/repo' already exists and is not an empty directory.
Changes:
This error occurs even when using "- force: true".
I've noticed this, too.
is this because the proto is https://?
I use git latest a lot, and I didn't experienced that, and I always use git://
+1, also seeing this whether using git:// or https://
git pull after the initial clone is wigging out on me. The upstream branch isn't set.
You asked me to pull without telling me which branch you
want to merge with, and 'branch.dev.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "dev"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.
Edit: This is in the context of a private github repo. Using https works fine, but using ssh is totally choking with the above message.
I see this error too, but only when I execute state.highstate from within the local repository directory.
Can someone confirm that this is still broken? A number of recent code additions have been added to git.latest around this
I am also getting this error under 0.17.0-1353-ge6da579
Are the changes in that version already?
If not, how can I update salt to use the master / development branch?
That's only a couple hundred commits behind, but if you want to upgrade to latest develop, just get an up-to-date checkout of the develop branch (either via cloning or pulling) and then run sudo python setup.py install --force and restart your minion and master.
But if it's still broken in that version, it's likely just still broken.
I cannot replicate this error at all in the current develop branch. I suspect this was fixed around the flurry of changes a few weeks back. I'm going to set this to closed right now but if any of the original reporters continue to see this on the develop branch code, please don't hesitate to drop a comment here and we'll gladly re-open it.
I am seeing this error frequently still in 2014.4.4 using the https protocol (didn't see it using git://, not convinced that is relevant though):
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "master"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.
My state looks like
salt-extension-modules:
git.latest:
- name: https://username:[email protected]/repo/salt-states.git
- target: {{ salt['pillar.get']('salt_root', '/opt/local/salt-states') }}
- rev: master
The problem is clearly this:
[INFO ] Executing command 'git pull ' in directory '/opt/local/salt-states'
If I just do cd /opt/local/salt-states; git pull it fails with the same message.
Could be an issue with older version of git? I think they might have changed this behavior recently. (running in Ubuntu 12.04)
$ git --version
git version 1.7.9.5
@mhworth Definitely a possibility that they changed the behavior. Could you please file a new issue? Include as much information as possible, and we'll look into this!
@basepi Sure, no problem, see #14719