Commit Graph

18 Commits (487c826700ebaa54f9ecf6d1f2409345b330fdfe)

Author SHA1 Message Date
Lorin Hochstein 9253d89280 git module: Don't pass rc as separate arg to fail_json 12 years ago
Stephen Fromm 1727bd3b7a Update git module to handle branches better
This drops the branch option.  The version option is overloaded
to mean either a sha1, branch, or tag.  This also adds the option
'remote' which defaults to 'origin'.
clone() was simplified by removing the checkout operation.  That
happens later when switch_version() is called.

Added the methods get_branches(), is_remote_branch(), and
is_local_branch().  get_branches() returns an array listing all
of the branches for the git repository.  is_remote_branch() checks
whether the arguments supplied correspond to a remote branch.
Similarly, is_local_branch() checks for a local branch.

The pull() method now checks to see if it is on the desired branch.
If not, it checks out the requested branch and then does a pull.
This should keep issue #604 still fixed.

switch_version(), formerly switchver(), looks to see if it is
checking out a branch.  If a branch, it checks it out with the --track
option.  This type of checkout was in pull() before.

Updated pull, clone, and switch_version to return (rc, out, err).
12 years ago
Stephen Fromm fd059a3df2 Fix for issue 604
Do not switch to master branch in pull()
Add --track to git checkout, when checking out a remote branch to track.
12 years ago
Michael DeHaan 70ef8e9ebb Merge pull request #637 from goozbach/git-mkdir
git mkdir causes problems with older git (can't c/o to existing directory)
12 years ago
Derek Carter f0f8eb3445 git mkdir causes problems with older git (can't checkout to existing directory) 12 years ago
Peter Sankauskas 5e35cd6466 Pass through error message when repo not found 12 years ago
Michael DeHaan 45100f03b1 Default git module to master branch so branch= is not required. 13 years ago
Michael DeHaan e6416def6b update comment about branch support, now that supported 13 years ago
Michael DeHaan d118cf3e31 Merge pull request #336 from sfromm/issue122
Issue122 - have all modules log to syslog
13 years ago
Stephen Fromm aea022b002 Apply logging of arguments to modules (issue #122)
The ohai and facter modules use /usr/bin/logger to log the fact that
they have been invoked.  I added 'import os' to the ping module
so that it could have the same syslog statements as the other modules.
I separated the condensed:
    shlex.split(open(argfile, 'r').read())
into two separate statements similar to the other modules.
13 years ago
felix 7ee6ae3663 removed unecessary branch addition from switchver 13 years ago
felix c9fafcecbe added in support for branches in git module (now takes optional "branch") 13 years ago
Stephen Fromm 887d293a3b Add git reset --hard support to git module
Resets working tree to what is in HEAD and discards any
uncommitted changes.
13 years ago
Stephen Fromm 40dbd9b3d7 Add exit_json and fail_json to git module
This adds exit_json() and fail_json() to git module.  It also sets
version to 'HEAD', if not provided.
13 years ago
Seth Vidal 1f53c89b14 convert so they handle argsfiles rather than arguments 13 years ago
Michael DeHaan be4cb64c92 Relicensing to GPLv3, all previous committers ok'd on mailing list. 13 years ago
Michael DeHaan ba4e36a9a9 Rename 'ensure' to 'state' because I think it's a bit cleaner and doesn't imply
all modules take a common parameter name.  But more or less we still work idempotently
in modules.
13 years ago
Michael DeHaan 228d1a0834 A really basic git module. Improvements welcome. 13 years ago