diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2015-07-30 12:30:34 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-08-24 22:42:31 -0500 |
commit | c3bd7db6f10804eb660f1e2cbe82d2afefe1ba9d (patch) | |
tree | 4cded453cb239f8d236c5ca96e4b4987da92bf3e /src | |
parent | 25db842c3ace36b0b34e29ff2bbfa43ade619c4f (diff) | |
download | talos-hostboot-c3bd7db6f10804eb660f1e2cbe82d2afefe1ba9d.tar.gz talos-hostboot-c3bd7db6f10804eb660f1e2cbe82d2afefe1ba9d.zip |
Fix determination of commit dependencies in regards to new files
Change-Id: I5722c58644c606e63a9935732a4d026038dd3231
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19451
Tested-by: Jenkins Server
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Reviewed-by: Jay M. Azurin <jmazurin@us.ibm.com>
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/build/tools/hbRelease | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/build/tools/hbRelease b/src/build/tools/hbRelease index bda4e33af..7970e73b1 100755 --- a/src/build/tools/hbRelease +++ b/src/build/tools/hbRelease @@ -772,21 +772,30 @@ sub git_commit_deps { my $base = shift; my $commit = shift; + chomp($base); + chomp($commit); my @deps = (); print "Searching for deps for $commit against $base\n" if $debug; - open COMMAND, "git diff-tree --name-only --no-commit-id -r $commit | ". - "xargs git rev-list $commit~1 ^$base -- |"; - while (my $line = <COMMAND>) + my @files = split('\n',`git diff-tree --name-only --no-commit-id -r $commit`); + foreach my $file (@files) { - print "Found dep: $line" if $debug; + # If a commit introduces a new file, don't run rev-list as it fails + # when the file does not exists in base. + my $file_in_base = `git log $base -n1 --oneline -- $file`; + next if ($file_in_base eq ""); - chomp $line; - push @deps, $line; + my $dep_commit = `git rev-list $commit~1 ^$base $file`; + if ($dep_commit ne "") + { + print "Found dep: $dep_commit" if $debug; + + chomp $dep_commit; + push @deps, $dep_commit; + } } - close COMMAND; return \@deps; } |