Commit Graph

39 Commits (a26188e55d581c0be75de7163ff873ea8f4325ca)

Author SHA1 Message Date
Robin Roth b9e55a0877 make git updates respect depth (#3254)
* make git updates respect depth

until now `fetch` gets all tags and heads at full depth, this change
* uses `depth` argument for `fetch`
* only get the specified `version` in `fetch`

* fixes #14954

* treat combination of refspec and depth correctly

* be more conservative for non-depth fetch
2016-12-08 11:24:18 -05:00
Toshio Kuratomi 40948cfcc4 git still needs to have abspath applied to dest 2016-12-08 11:24:16 -05:00
Michael Scherer 3d415ac2da Use type='path' for path arguments for git module 2016-12-08 11:24:14 -05:00
Toshio Kuratomi f8f84f0491 Since we screenscrape output from git to tell us information we need to use the C locale when running commands.
Using another locale would mean that we get information that may have
the strings that we are looking for.

Fixes #2449
Fixes #2462
2016-12-08 11:24:03 -05:00
Jordan Bach b6213ffa80 git: set remote branch before switching versions when using depth argument 2016-12-08 11:23:59 -05:00
Jan Duzinkiewicz 9c6db69827 forcing git fetch if sha1 are equal between repos but branch exists only at remote
Add an explanatory comment to the code
2016-12-08 11:23:57 -05:00
Dmitry Labutin 60b1273d55 Github uses both HTTP and HTTPS protocols 2016-12-08 11:23:56 -05:00
Chris Streeter 04b52efb64 Fix name of ssh_opts arg 2016-12-08 11:23:48 -05:00
Andrew Widdersheim 7d174daa77 Fix detached head detection in is_not_a_branch()
Detached head detection seems to have broken somewhere a long the way
because git decided to change how that situation looks when doing a 'git
branch -a' which is performed by get_branches().

This is how git 1.7.1 displays this situation (which works):

shell> git branch -a
* (no branch)
  master

This is the output from git 1.8.3.1 (which does not work):

shell> git branch -a
* (detached from e132711)
  master

It looks like this same wording is used in the most recent version of
git (2.6.1 as of writing this).
2016-12-08 11:23:39 -05:00
Jan Inowolski 3d45384aed update git remote url before ls-remote
related to #8177
2016-12-08 11:23:28 -05:00
Brian Coca b261fd8d3e added doc to note that git the command line tool is required for this moduel to function fixes http://github.com/ansible/ansible/issues/11358 2016-12-08 11:23:14 -05:00
Greg DeKoenigsberg eb881d7d5d Proper author info for all remaining modules 2016-12-08 11:23:07 -05:00
Brian Coca 3d42d8897e fixed doc issue with git 2016-12-08 11:23:06 -05:00
Dionysis Grigoropoulos 59f7db899d git: Add option to verify GPG signature of commit 2016-12-08 11:23:05 -05:00
Toshio Kuratomi 49f5b28fbd Change the git force parameter to default to no as a safety change.
Fixes #306
2016-12-08 11:22:40 -05:00
Toshio Kuratomi 1be539d870 git fetch --tags overwrites normal fetching with git < 1.8.x so do a normal fetch followed by using the refspec format for fetching tags 2016-12-08 11:22:34 -05:00
Toshio Kuratomi 73b7d6ea7b Fix typo in git refspec code. Change lists to tuples 2016-12-08 11:22:34 -05:00
Toshio Kuratomi 5c090207ff Make documentation clear about update=no vs clone=no 2016-12-08 11:22:34 -05:00
Rohan McGovern b607ffb7c6 git: add 'refspec' argument
This argument may be used to fetch additional refs beyond the default
refs/heads/* and refs/tags/*.  Checking out GitHub pull requests or Gerrit
patch sets are two examples where this is useful.

Without this, specifying version=<sha1> with a SHA1 unreachable from any
tag or branch can't work.
2016-12-08 11:22:34 -05:00
Rohan McGovern 06ff34f364 git: clean up "fetch" method
De-duplicate repetitive code checking the exit code.

Include the stdout/stderr of the failed process in all cases.

Remove the returned values because no caller uses them.

Combine git commands where possible.  There is no need to fetch branches
and tags as two separate operations.
2016-12-08 11:22:34 -05:00
Toshio Kuratomi 8af70de1fc Probably would make clone a 1.9 feature rather than 1.8.3 2016-12-08 11:22:33 -05:00
Toshio Kuratomi a7ff6c4cba Make git's update parameter revert to its old behaviour and add new clone parameter to take its place.
Fixes #426
Fixes https://github.com/ansible/ansible/issues/8630
2016-12-08 11:22:33 -05:00
Toshio Kuratomi 123c99f879 Add error message from git to message returned from ansible
Fixes #81
2016-12-08 11:22:33 -05:00
Toshio Kuratomi 88ccfc219a Change git update param documentation to match reality 2016-12-08 11:22:32 -05:00
Toshio Kuratomi 8b586ad055 Before pulling submodules from repos add ssh hostkeys for those submodules
Fixes #9655
2016-12-08 11:22:32 -05:00
Toshio Kuratomi 6f3f0904eb Fix git mod so that we switch to the desired version even if it was previously downloaded 2016-12-08 11:22:32 -05:00
Toshio Kuratomi 59066f6138 Some cleanups to the git module 2016-12-08 11:22:32 -05:00
Toshio Kuratomi fc15177e6e Revert git module doc update because it appears ssh:// works and bare ssh repo does not
This reverts commit e715909831e27cbfed2ae86e886bf154cefd7b6c.
2016-12-08 11:22:31 -05:00
Lorin Hochstein 0cf3cfbf5a git doc: don't prepend ssh:// for ssh repo
The github ssh example has ssh:// at the beginning of the url. However, this doesn't
work. It does work if the ssh:// is removed.
2016-12-08 11:22:31 -05:00
Jérémie Astori c52bfe3e35 Fix #91: Expand user home folder for the key_file path of the git module 2016-12-08 11:22:30 -05:00
Antti Salminen 75e15e2ae9 Find the actual commit annotated tags refer to instead of the tag object. 2016-12-08 11:22:29 -05:00
Toshio Kuratomi b00e6464e9 Fix cornercase tracebaxk when detecting whether submodules changed 2016-12-08 11:22:28 -05:00
Toshio Kuratomi 3e09de7aef Fix git module checking out correct version after initial clone
Fixes #313
2016-12-08 11:22:27 -05:00
Toshio Kuratomi dfd4433fba Fix git module handling of the recursive flag
Fixes: #169
2016-12-08 11:22:24 -05:00
Toshio Kuratomi 5fc463eee7 Update desctiprion, parameter name, and default value as discussed in #55 2016-12-08 11:22:24 -05:00
CptLausebaer a572f85d43 correct requirement of parameter dest
The parameter "dest:" is required, but it is documented as "required: false".
2016-12-08 11:22:24 -05:00
Chad Nelson 20706f5f4d Chnge option name to track_submodule_branches.
Update documentation to reflect what the actual effect of the option.
2016-12-08 11:22:23 -05:00
Chad Nelson 5f30157a05 Give option on how git tracks submodules.
Allows user to decide if git submodule should track branches/tags or track commit hashes defined in the superproject.

Add track_branches parameter to the git module.

Defaults to track branches behavior.
2016-12-08 11:22:23 -05:00
Michael DeHaan 213e518165 file extensions! 2016-12-08 11:22:22 -05:00