diff --git a/obs-service-tar_scm.changes b/obs-service-tar_scm.changes index e050b5f..73417b1 100644 --- a/obs-service-tar_scm.changes +++ b/obs-service-tar_scm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Aug 25 13:52:06 UTC 2011 - adrian@suse.de + +- add support for (git) checkout depth, original patch by + Markus Lehtonen + ------------------------------------------------------------------- Wed Aug 17 07:54:29 UTC 2011 - adrian@suse.de diff --git a/tar_scm b/tar_scm index 90b82da..bbe283b 100644 --- a/tar_scm +++ b/tar_scm @@ -18,6 +18,7 @@ MYPREFIX="" MYFILENAME="" MYREVISION="" MYPACKAGEMETA="" +MYGITARGS="--depth 1" while test $# -gt 0; do case $1 in @@ -61,6 +62,14 @@ while test $# -gt 0; do MYOUTDIR="$2" shift ;; + *-history-depth) + if [ "$2" == "full" ]; then + MYGITARGS="" + else + MYGITARGS="--depth $2" + fi + shift + ;; *) echo Unknown parameter $1. echo 'Usage: tar_scm --scm $SCM --url $URL --outdir $OUT' @@ -166,7 +175,7 @@ elif [ "$MYSCM" == "git" ]; then # update existing content for speed/bandwidth reasons cd "$TAR_DIRECTORY" OLDVERSION=`git show --pretty=%at | head -n 1` - git pull || exit 1 + git pull $MYGITARGS || exit 1 if [ -n "$MYREVISION" ]; then git checkout "$MYREVISION" || exit 1 fi @@ -180,7 +189,7 @@ elif [ "$MYSCM" == "git" ]; then mv "$TAR_DIRECTORY" "${FILE}" || exit 1 else # new checkout - git clone --depth 1 "$MYURL" "${FILE}" || exit 1 + git clone "$MYGITARGS" "$MYURL" "${FILE}" || exit 1 if [ -n "$MYREVISION" ]; then cd "$FILE" git checkout "$MYREVISION" || exit 1 diff --git a/tar_scm.service b/tar_scm.service index 19abc80..e260a38 100644 --- a/tar_scm.service +++ b/tar_scm.service @@ -35,5 +35,8 @@ Package the meta data of SCM to allow the user or OBS to update after un-tar yes + + Stored history depth. Special value "full" clones/pulls full history. Only valid if SCM git is used. +