diff options
| author | Xu Cheng | 2015-12-19 18:18:56 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-12-19 22:05:30 +0800 |
| commit | 203000cee6432ba95c60db1c98c8fd9a2efa5532 (patch) | |
| tree | adbb6d2d88936f630ffde2944ff5d7157e99b0f2 /Library/Homebrew/dev-cmd | |
| parent | 0f60f76f26ca9fe26e1c10c72905a878a58e3c96 (diff) | |
| download | brew-203000cee6432ba95c60db1c98c8fd9a2efa5532.tar.bz2 | |
update-test: allow setting start commit
To use origin/master as start commit
brew update-test
To use <sha1> as start commit
brew update-test --commit=<sha1>
To use commit at <date> as start commit
brew update-test --before=<date>
Also print start/end commit for debug purpose
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/update-test.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 38220da26..b32dcf45a 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -1,11 +1,26 @@ require "extend/ENV" module Homebrew + # + # Usage: + # brew update-test # using origin/master as start commit + # brew update-test --commit=<sha1> # using <sha1> as start commit + # brew update-test --before=<date> # using commit at <date> as start commit + # def update_test cd HOMEBREW_REPOSITORY - start_sha1 = Utils.popen_read("git", "rev-parse", "origin/master").chomp + start_sha1 = if commit = ARGV.value("commit") + commit + elsif date = ARGV.value("before") + Utils.popen_read("git", "rev-list", "-n1", "--before=#{date}", "origin/master").chomp + else + Utils.popen_read("git", "rev-parse", "origin/master").chomp + end end_sha1 = Utils.popen_read("git", "rev-parse", "HEAD").chomp + puts "Start commit: #{start_sha1}" + puts "End commit: #{end_sha1}" + mktemp do curdir = Pathname.new(Dir.pwd) |
