Home | History | Annotate | Download | only in checkout

Lines Matching refs:Git

30 # Python module for interacting with an SCM system (like SVN or Git)
87 if Git.in_working_directory(absolute_path):
88 return Git(cwd=absolute_path)
323 # A mixin class that represents common functionality for SVN and Git-SVN.
403 # svn revert -R is not as awesome as git reset --hard.
405 # calls to fail on the bots. We make this mirror git reset --hard
554 log("WARNING: svn merge has been known to take more than 10 minutes to complete. It is recommended you use git for rollouts.")
564 # git-commit and force are not used by SVN.
604 # All git-specific logic should go here.
605 class Git(SCM, SVNRepository):
634 git_path = self.run(['which', 'git']).rstrip()
639 log("Warning: This machine is 64-bit, but the git binary (%s) does not support 64-bit.\nInstall a 64-bit git for better performance, see:\n%s\n" % (git_path, webkit_dev_thead_url))
643 return run_command(['git', 'rev-parse', '--is-inside-work-tree'], cwd=path, error_handler=Executive.ignore_error).rstrip() == "true"
647 # "git rev-parse --show-cdup" would be another way to get to the root
648 (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=(path or "./")))
650 if not os.path.isabs(checkout_root): # Sometimes git returns relative paths
663 return run_command(["git", "config", "--get-all", key],
672 self.run(['git', 'reset', '--hard', self.remote_branch_ref()])
676 return self.run(['git', 'log', '--pretty=oneline', 'HEAD...' + self.remote_branch_ref()]).splitlines()
679 return os.path.exists(os.path.join(self.checkout_root, '.git/rebase-apply'))
683 return self.run(['git', 'diff', 'HEAD', '--name-only']) == ""
687 # Could run git clean here too, but that wouldn't match working_directory_is_clean
688 self.run(['git', 'reset', '--hard', 'HEAD'])
691 self.run(['git', 'rebase', '--abort'])
694 # git status returns non-zero when there are changes, so we use git diff name --name-status HEAD instead.
696 return ["git", "diff", "--name-status", "HEAD"]
702 return self.run(["git", "add", path], return_exit_code=return_exit_code)
705 return self.run(["git", "rm", "-f", path])
721 status_command = ['git', 'diff', '-r', '--name-status', '-C', '-M', "--no-ext-diff", "--full-index", self.merge_base(git_commit)]
727 # --pretty="format:" makes git show not print the commit log header,
728 changed_files = self.run(["git", "show", "--pretty=format:", "--name-only", git_commit]).splitlines()
737 # git rev-list head --remove-empty --limit=5 -- path would be equivalent.
738 commit_ids = self.run(["git", "log", "--remove-empty", "--pretty=format:%H", "-%s" % limit, "--", path]).splitlines()
744 status_command = ['git', 'diff', '--name-status', '-C', '-M', '--diff-filter=U']
758 return "git"
761 git_log = self.run(['git', 'log', '-25'])
762 match = re.search("^\s*git-svn-id:.*@(?P<svn_revision>\d+)\ ", git_log, re.MULTILINE)
772 command = ['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit), "--"]
778 # git svn find-rev always exits 0, even when the revision or commit is not found.
779 return self.run(['git', 'svn', 'find-rev', arg], cwd=self.checkout_root).rstrip()
792 raise ScriptError(message='Failed to find git
803 return self.run(["git", "show", "%s:%s" % (self.git_commit_from_svn_revision(revision), path)], decode_output=False)
810 return self.run(['git', 'diff', 'HEAD', '--', path])
813 return self.run(['git', 'show', 'HEAD:' + self.to_object_name(path)], decode_output=False)
817 committer_email = self.run(["git", "log", "-1", "--pretty=format:%ce", git_commit])
818 # Git adds an extra @repository_hash to the end of every committer email, remove it:
825 self.run(['git', 'revert', '--no-commit', git_commit], error_handler=Executive.ignore_error)
828 self.run(['git', 'checkout', 'HEAD'] + file_paths)
831 squash = Git.read_git_config('webkit-patch.commit-should-always-squash')
841 # Username is ignored during Git commits.
848 raise ScriptError(message="The working copy is not modified. --git-commit=HEAD.. only commits working copy changes.")
862 self.run(['git', 'reset', '--soft', self.remote_merge_base()])
867 branch_ref = self.run(['git', 'symbolic-ref', 'HEAD']).strip()
877 # trunk. Move up to the top of the tree so that git commands that expect a
885 self.run(['git', 'checkout', '-q', '-b', MERGE_BRANCH_NAME, self.remote_branch_ref()])
892 self.run(['git', 'cherry-pick', '--no-commit', commit])
894 self.run(['git', 'commit', '-m', message])
903 self.run(['git', 'checkout', '-q', branch_name])
910 return self.run(['git', 'svn', 'log', '-r', svn_revision])
913 return self.run(['git', 'svn', 'log', '--limit=1'])
915 # Git-specific methods:
917 return self.run(['git', 'show-ref', '--quiet', '--verify', branch_ref], return_exit_code=True) == 0
921 self.run(['git', 'branch', '-D', branch_name])
924 return self.run(['git', 'merge-base', self.remote_branch_ref(), 'HEAD']).strip()
928 remote_branch_refs = Git.read_git_config('svn-remote.svn.fetch')
932 raise ScriptError(message="Can't find a branch to diff against. svn-remote.svn.fetch is not in the git config and %s does not exist" % remote_master_ref)
941 self.run(['git', 'commit', '--all', '-F', '-'], input=message)
944 dcommit_command = ['git', 'svn', 'dcommit']
961 # A B : [A, B] (different from git diff, which would use "rev-list A..B")
971 commit_ids += reversed(self.run(['git', 'rev-list', commitish]).splitlines())
974 commit_ids += self.run(['git', 'rev-parse', '--revs-only', commitish]).splitlines()
978 commit_lines = self.run(['git', 'cat-file', 'commit', commit_id]).splitlines()
980 # Skip the git headers.
989 return self.run(['git', 'diff-tree', '--shortstat', '--no-commit-id', commit_id])