ruby-changes:51671
From: k0kubun <ko1@a...>
Date: Sun, 8 Jul 2018 14:52:18 +0900 (JST)
Subject: [ruby-changes:51671] k0kubun:r63883 (trunk): tool/git-refresh: skip git fetch and checkout
k0kubun 2018-07-08 14:52:12 +0900 (Sun, 08 Jul 2018) New Revision: 63883 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63883 Log: tool/git-refresh: skip git fetch and checkout if the tag is already checked out, to optimize the execution time. I'm going to prepare a task depending on this tool, and I want that to finish fast and output nothing when it's already up-to-date. Modified files: trunk/tool/git-refresh Index: tool/git-refresh =================================================================== --- tool/git-refresh (revision 63882) +++ tool/git-refresh (revision 63883) @@ -31,6 +31,9 @@ dir="$2" https://github.com/ruby/ruby/blob/trunk/tool/git-refresh#L31 shift 2 [ x"$branch" = x ] && unset branch || : if [ -d "$dir" ]; then + if [ x"$(git -C "$dir" describe --tags)" = x"$branch" ]; then + exit 0 # already up-to-date + fi echo updating `expr "/$dir/" : '.*/\([^/][^/]*\)/'` ... [ $quiet ] || set -x $CHDIR "$dir" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/