Support using Git revisions as branch names
[?]
Jul 6, 2015, 1:55 PM
Y55DIQQUP3QCMCG4H2TBO7IEFB4XSBJPQVYXOHKMLHM35LMIY2EACDependencies
- [2]
3BTJRSU3GitInput.pm: Don't do a chdir to the Git clone - [3]
JAH3UPWASupport revision control systems via plugins - [4]
NB2VOKIRInclude names of committers in HipChat notifications
Change contents
- edit in src/lib/Hydra/Plugin/GitInput.pm at line 14
}sub _isHash {my ($rev) = @_;return length($rev) == 40 && $rev =~ /^[0-9a-f]+$/; - replacement in src/lib/Hydra/Plugin/GitInput.pm at line 32
# TODO: Optimize the first clone by using "git init $clonePath" and "git remote add origin $uri".$res = run(cmd => ["git", "clone", "--branch", $branch, $uri, $clonePath], timeout => 600);die "error cloning git repo at `$uri':\n$res->{stderr}" if $res->{status};$res = run(cmd => ["git", "init", $clonePath]);$res = run(cmd => ["git", "remote", "add", "origin", "--", $uri], dir => $clonePath) unless $res->{status};die "error creating git repo in `$clonePath':\n$res->{stderr}" if $res->{status}; - replacement in src/lib/Hydra/Plugin/GitInput.pm at line 40
$res = run(cmd => ["git", "fetch", "-fu", "origin", "+$branch:$branch"], dir => $clonePath, timeout => 600);my $localBranch = _isHash($branch) ? "_hydra_tmp" : $branch;$res = run(cmd => ["git", "fetch", "-fu", "origin", "+$branch:$localBranch"], dir => $clonePath, timeout => 600); - replacement in src/lib/Hydra/Plugin/GitInput.pm at line 87
my $revision = grab(cmd => ["git", "rev-parse", "$branch"], dir => $clonePath, chomp => 1);my $revision = _isHash($branch) ? $branch: grab(cmd => ["git", "rev-parse", "$branch"], dir => $clonePath, chomp => 1); - replacement in src/lib/Hydra/Plugin/GitInput.pm at line 114
# script. Thus, we leave `.git' in there. Same for# Subversion (e.g., libgcrypt's build system uses that.)# script. Thus, we leave `.git' in there. - edit in src/lib/Hydra/Plugin/GitInput.pm at line 124
# FIXME: Don't use nix-prefetch-git.