Skip to content

diff against HEAD to fix #153 #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions gitFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,24 @@ class Commiter:
isattachedtoaworkitemregex = re.compile("^\d*:.*-")
findignorepatternregex = re.compile("\{([^\{\}]*)\}")

@staticmethod
def justadd(changeentry):
Commiter.handleignore()
Commiter.replaceauthor(changeentry.author, changeentry.email)
shell.execute("git add -A")

Commiter.handle_captitalization_filename_changes()

@staticmethod
def justcommit(changeentry):
shell.execute(Commiter.getcommitcommand(changeentry))
Commiter.commitcounter += 1
if Commiter.commitcounter is 30:
shouter.shout("30 Commits happend, push current branch to avoid out of memory")
Commiter.pushbranch("")
Commiter.commitcounter = 0
shouter.shout("Commited change in local git repository")

@staticmethod
def addandcommit(changeentry):
Commiter.handleignore()
Expand Down Expand Up @@ -339,8 +357,11 @@ def ignorejazzignore(repositoryfiles):

class Differ:
@staticmethod
def has_diff():
return shell.execute("git diff --quiet") is 1
def has_diff(diff_to_HEAD=False):
if diff_to_HEAD:
return shell.execute("git diff --cached --quiet") is 1
else:
return shell.execute("git diff --quiet") is 1


class ExtensionFilter:
Expand Down
8 changes: 5 additions & 3 deletions rtcFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,18 @@ def acceptchangesintoworkspace(self, changeentries):
"Change wasnt succesfully accepted into workspace, please load your workspace in eclipse and check whats wrong")
self.is_user_aborting(changeEntry)
# self.retryacceptincludingnextchangesets(changeEntry, changeentries)
if not Differ.has_diff():
Commiter.justadd(changeEntry)
if not Differ.has_diff(True):
# no differences found - force reload of the workspace
shouter.shout("No changes for commiting in git detected, going to reload the workspace")
WorkspaceHandler().load()
if not Differ.has_diff():
Commiter.justadd(changeEntry)
if not Differ.has_diff(True):
shouter.shout("Still no changes... Please load your workspace in eclipse and check whats wrong")
# still no differences, something wrong
self.is_user_aborting(changeEntry)
shouter.shout("Accepted change %d/%d into working directory" % (amountofacceptedchanges, amountofchanges))
Commiter.addandcommit(changeEntry)
Commiter.justcommit(changeEntry)
return amountofacceptedchanges

@staticmethod
Expand Down