salt icon indicating copy to clipboard operation
salt copied to clipboard

git.latest fails after first run

Open erasmussen-cars opened this issue 13 years ago • 13 comments

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".

erasmussen-cars avatar May 07 '13 23:05 erasmussen-cars

I've noticed this, too.

UtahDave avatar May 08 '13 00:05 UtahDave

is this because the proto is https://?

I use git latest a lot, and I didn't experienced that, and I always use git://

bclermont avatar May 08 '13 08:05 bclermont

+1, also seeing this whether using git:// or https://

jescalan avatar Jun 10 '13 22:06 jescalan

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.

erickyellott avatar Jul 01 '13 22:07 erickyellott

I see this error too, but only when I execute state.highstate from within the local repository directory.

markisus avatar Aug 09 '13 00:08 markisus

Can someone confirm that this is still broken? A number of recent code additions have been added to git.latest around this

thatch45 avatar Oct 17 '13 19:10 thatch45

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?

vespakoen avatar Oct 25 '13 13:10 vespakoen

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.

basepi avatar Oct 25 '13 22:10 basepi

But if it's still broken in that version, it's likely just still broken.

basepi avatar Oct 25 '13 22:10 basepi

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.

cachedout avatar Oct 30 '13 19:10 cachedout

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 avatar Jul 31 '14 14:07 mhworth

@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 avatar Aug 01 '14 21:08 basepi

@basepi Sure, no problem, see #14719

mhworth avatar Aug 04 '14 19:08 mhworth