org.springframework.roo.addon.git
Class GitOperationsImpl

java.lang.Object
  extended by org.springframework.roo.addon.git.GitOperationsImpl
All Implemented Interfaces:
GitOperations

@Service
public class GitOperationsImpl
extends Object
implements GitOperations

Operations for Git addon.

Since:
1.1
Author:
Stefan Schmidt

Constructor Summary
GitOperationsImpl()
           
 
Method Summary
 void commitAllChanges(String message)
          Triggers commit for all changes in the Git tree.
 boolean isAutomaticCommit()
          Check if automatic commit is enabled for successful Roo commands.
 boolean isGitCommandAvailable()
          Check if Git commands are available in Shell.
 boolean isGitInstallationPossible()
          Check if Git setup command is available in Shell.
 void log(int maxHistory)
          Present git log.
 void push()
          Trigger git push.
 void reset(int noOfCommitsToRevert, String message)
          Triggers Git reset (hard).
 void revertCommit(String revstr, String message)
          Trigger revert of commit with given rev string.
 void revertLastCommit(String message)
          Triggers revert of last commit.
 void setConfig(String category, String key, String value)
          Convenience access to the Git config (allows setting config options)
 void setup()
          Initial setup of git repository in target project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GitOperationsImpl

public GitOperationsImpl()
Method Detail

commitAllChanges

public void commitAllChanges(String message)
Description copied from interface: GitOperations
Triggers commit for all changes in the Git tree. (works like 'git commmit -a -m {message}')

Specified by:
commitAllChanges in interface GitOperations
Parameters:
message - Commit message

isAutomaticCommit

public boolean isAutomaticCommit()
Description copied from interface: GitOperations
Check if automatic commit is enabled for successful Roo commands.

Specified by:
isAutomaticCommit in interface GitOperations
Returns:
automaticCommit

isGitCommandAvailable

public boolean isGitCommandAvailable()
Description copied from interface: GitOperations
Check if Git commands are available in Shell. Depends on presence of .git repository.

Specified by:
isGitCommandAvailable in interface GitOperations
Returns:
availability

isGitInstallationPossible

public boolean isGitInstallationPossible()
Description copied from interface: GitOperations
Check if Git setup command is available in Shell.

Specified by:
isGitInstallationPossible in interface GitOperations
Returns:
availability

log

public void log(int maxHistory)
Description copied from interface: GitOperations
Present git log.

Specified by:
log in interface GitOperations

push

public void push()
Description copied from interface: GitOperations
Trigger git push.

Specified by:
push in interface GitOperations

reset

public void reset(int noOfCommitsToRevert,
                  String message)
Description copied from interface: GitOperations
Triggers Git reset (hard).

Specified by:
reset in interface GitOperations
Parameters:
noOfCommitsToRevert - number of commits to reset (HEAD - n)
message - Commit message

revertCommit

public void revertCommit(String revstr,
                         String message)
Description copied from interface: GitOperations
Trigger revert of commit with given rev string.

Specified by:
revertCommit in interface GitOperations

revertLastCommit

public void revertLastCommit(String message)
Description copied from interface: GitOperations
Triggers revert of last commit.

Specified by:
revertLastCommit in interface GitOperations
Parameters:
message - Commit message

setConfig

public void setConfig(String category,
                      String key,
                      String value)
Description copied from interface: GitOperations
Convenience access to the Git config (allows setting config options)

Specified by:
setConfig in interface GitOperations
Parameters:
category - The Git config category.
key - The config key.
value - The config value.

setup

public void setup()
Description copied from interface: GitOperations
Initial setup of git repository in target project.

Specified by:
setup in interface GitOperations


Copyright © 2009–2015. All rights reserved.