[PATCH RFC:modular] release.sh: Attempt to autodetect section and current/previous tags

Jeremy Huddleston jeremyhu at apple.com
Wed Sep 21 13:01:22 PDT 2011


On Sep 16, 2011, at 12:38, Gaetan Nadon wrote:

>> +
>> +# Attempt to auto-detect values if not specified
>> +if [ -z "$section" ]; then
>> +    section="$(git config --get "remote.${remote}.url" | sed -n 's%^.*freedesktop.org/git/xorg/\([^/]*\).*$%\1%p')"
> 
> The parsing of the git url will not work for xcb, which is now part of
> x.org.
> 
>        git://anongit.freedesktop.org/git/xcb/libxcb
> 
> The best, but not the easiest, solution is for x.org to complete the
> hosting of the xcb reposiroties. The git url is the only indication
> about which repositories belong to x.org and which don't.

Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

This sed-fu also doesn't work for xorg/xserver.git.  Since we can easily provide that information on the command line, I'm ok with it not working for some edge cases which we can fixup in subsequent commits.

I would like to add user verification of the detected values though:

diff --git a/release.sh b/release.sh
index 073114d..546d253 100755
--- a/release.sh
+++ b/release.sh
@@ -145,21 +145,36 @@ done
 
 
 # Attempt to auto-detect values if not specified
+auto_detected="no"
+
 if [ -z "$section" ]; then
     section="$(git config --get "remote.${remote}.url" | sed -n 's%^.*freedesktop.org/git/xorg/\([^/]*\).*$%\1%p')"
     echo "Detected section: $section"
+    auto_detected="yes"
 fi
 
 if [ -z "$tag_previous" ]; then
     tag_previous="$(git describe --abbrev=0 HEAD^)"
     echo "Detected previous tag: $tag_previous"
+    auto_detected="yes"
 fi
 
 if [ -z "$tag_current" ]; then
     tag_current="$(git describe --abbrev=0)"
     echo "Detected current tag: $tag_current"
+    auto_detected="yes"
 fi
 
+if [ "${auto_detected}" = "yes" ] ; then
+    echo -n "Proceed? (Y/N) "
+    while read answer ; do
+        case "$answer" in
+            y*|Y*) break ;;
+            n*|N*) exit 1 ;;
+            *) echo -n "Incorrect Response.  Proceed? (Y/N) " ; continue ;;
+        esac
+    done    
+fi
 
 # Check for required values
 if [ -z "$section" ]; then



More information about the xorg-devel mailing list