Merge branch 'bugfix-2.1.x' into Raptor_2.0.X_Devel
This commit is contained in:
@@ -16,7 +16,7 @@ BRANCH=${INFO[5]}
|
||||
|
||||
git push --set-upstream origin HEAD:$BRANCH
|
||||
|
||||
OPEN=$(echo $(which gnome-open xdg-open open) | awk '{ print $1 }')
|
||||
OPEN=$( which gnome-open xdg-open open | head -n1 )
|
||||
URL="https://github.com/$FORK/$REPO/commits/$BRANCH"
|
||||
|
||||
if [ -z "$OPEN" ]; then
|
||||
|
||||
Executable → Regular
+20
-48
@@ -34,8 +34,8 @@ COMMIT_STEPS=0
|
||||
#cd "$CONFIGREPO" 2>/dev/null || { echo "Can't find Configurations repo!" ; exit 1; }
|
||||
|
||||
ACTION=${1:-init}
|
||||
IMPORT=${2:-"import-2.0.x"}
|
||||
EXPORT=${3:-"bugfix-2.0.x"}
|
||||
IMPORT=${2:-"import-2.1.x"}
|
||||
EXPORT=${3:-"bugfix-2.1.x"}
|
||||
|
||||
echo -n "Doing grhh ... " ; grhh ; echo
|
||||
|
||||
@@ -52,7 +52,7 @@ if [[ $ACTION == "manual" ]]; then
|
||||
git checkout $IMPORT || exit
|
||||
|
||||
# Reset from the latest complete state
|
||||
#git reset --hard bugfix-2.0.x
|
||||
#git reset --hard bugfix-2.1.x
|
||||
|
||||
cp "$MARLINREPO/Marlin/"Configuration*.h "$CDEF/"
|
||||
#git add . && git commit -m "Changes from Marlin ($(date '+%Y-%m-%d %H:%M'))."
|
||||
@@ -87,7 +87,8 @@ if [[ $ACTION == "init" ]]; then
|
||||
# Strip all #error lines
|
||||
IFS=$'\n'; set -f
|
||||
for fn in $( find $TEMP/config -type f -name "Configuration.h" ); do
|
||||
$SED -i "20,30{/#error/d}" $fn
|
||||
$SED -i~ -e "20,30{/#error/d}" "$fn"
|
||||
rm "$fn~"
|
||||
done
|
||||
unset IFS; set +f
|
||||
|
||||
@@ -109,53 +110,15 @@ if [[ $ACTION == "init" ]]; then
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Commit for comparison" >/dev/null
|
||||
|
||||
# Init Cartesian/SCARA/TPARA configurations to default
|
||||
echo "- Initializing Cartesian/SCARA/TPARA configs to default state..."
|
||||
echo "- Initializing configs to default state..."
|
||||
|
||||
find "$CEXA" -name $BC ! -path */delta/* -print0 \
|
||||
find "$CEXA" -name $BC -print0 \
|
||||
| while read -d $'\0' F ; do cp "$CDEF/$BC" "$F" ; done
|
||||
find "$CEXA" -name $AC ! -path */delta/* -print0 \
|
||||
find "$CEXA" -name $AC -print0 \
|
||||
| while read -d $'\0' F ; do cp "$CDEF/$AC" "$F" ; done
|
||||
|
||||
# DEBUG: Commit the reset for review
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset Cartesian/SCARA/TPARA configs..." >/dev/null
|
||||
|
||||
# Create base Delta configurations
|
||||
cp "$CDEF"/* "$CEXA/delta/generic"
|
||||
|
||||
# DEBUG: Commit the reset for review
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset Generic Delta..." >/dev/null
|
||||
|
||||
cp -R "$TEMP/$CEXA/delta/generic"/Conf* "$CEXA/delta/generic"
|
||||
|
||||
# DEBUG: Commit Generic Delta changes for review
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Apply Generic Delta..." >/dev/null
|
||||
|
||||
# Reset all Delta configs to the generic version
|
||||
find "$CEXA/delta" -name $BC ! -path */generic/* -print0 \
|
||||
| while read -d $'\0' F ; do cp "$CEXA/delta/generic/$BC" "$F" ; done
|
||||
find "$CEXA/delta" -name $AC ! -path */generic/* -print0 \
|
||||
| while read -d $'\0' F ; do cp "$CEXA/delta/generic/$AC" "$F" ; done
|
||||
|
||||
# DEBUG: Commit the Delta reset for review
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset Delta configs..." >/dev/null
|
||||
|
||||
# Reset all SCARA configs to the default cartesian
|
||||
find "$CEXA/SCARA" -name $BC \
|
||||
| while read -d $'\0' F ; do cp "$CDEF/$BC" "$F" ; done
|
||||
find "$CEXA/SCARA" -name $AC \
|
||||
| while read -d $'\0' F ; do cp "$CDEF/$AC" "$F" ; done
|
||||
|
||||
# DEBUG: Commit the SCARA reset for review
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset SCARA..." >/dev/null
|
||||
|
||||
# Reset all TPARA configs to the default cartesian
|
||||
find "$CEXA/TPARA" -name $BC \
|
||||
| while read -d $'\0' F ; do cp "$CDEF/$BC" "$F" ; done
|
||||
find "$CEXA/TPARA" -name $AC \
|
||||
| while read -d $'\0' F ; do cp "$CDEF/$AC" "$F" ; done
|
||||
|
||||
# DEBUG: Commit the TPARA reset for review
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset TPARA..." >/dev/null
|
||||
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset configs..." >/dev/null
|
||||
|
||||
# Update the %VERSION% in the README.md file
|
||||
VERS=$( echo $EXPORT | $SED 's/release-//' )
|
||||
@@ -177,8 +140,17 @@ if [[ $ACTION == "init" ]]; then
|
||||
cp -R "$TEMP/config" .
|
||||
find config -type f \! -name "Configuration*" -exec rm "{}" \;
|
||||
|
||||
addpathlabels() {
|
||||
find config -name "Conf*.h" -print0 | while read -d $'\0' fn ; do
|
||||
fldr=$(dirname "$fn")
|
||||
blank_line=$(awk '/^\s*$/ {print NR; exit}' "$fn")
|
||||
$SED -i~ "${blank_line}i\\\n#define CONFIG_EXAMPLES_DIR \"$fldr\"\\ " "$fn"
|
||||
rm -f "$fn~"
|
||||
done
|
||||
}
|
||||
|
||||
echo "- Adding path labels to all configs..."
|
||||
config-labels.py >/dev/null 2>&1
|
||||
addpathlabels
|
||||
|
||||
git add . >/dev/null && git commit -m "Examples Customizations" >/dev/null
|
||||
|
||||
@@ -186,7 +158,7 @@ if [[ $ACTION == "init" ]]; then
|
||||
cp -R "$TEMP/config" .
|
||||
|
||||
# Apply labels again!
|
||||
config-labels.py >/dev/null 2>&1
|
||||
addpathlabels
|
||||
|
||||
git add . >/dev/null && git commit -m "Examples Extras" >/dev/null
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ BRANCH=${INFO[5]}
|
||||
|
||||
opensite() {
|
||||
URL="http://127.0.0.1:4000/"
|
||||
OPEN=$(echo $(which gnome-open xdg-open open) | awk '{ print $1 }')
|
||||
OPEN=$( which gnome-open xdg-open open | head -n1 )
|
||||
if [ -z "$OPEN" ]; then
|
||||
echo "Can't find a tool to open the URL:"
|
||||
echo $URL
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# mffp [1|2] [ref]
|
||||
#
|
||||
# Push the given commit (or HEAD) upstream immediately.
|
||||
# By default: `git push upstream HEAD:bugfix-2.0.x`
|
||||
# By default: `git push upstream HEAD:bugfix-2.1.x`
|
||||
#
|
||||
|
||||
usage() { echo "usage: `basename $0` [1|2] [ref]" 1>&2 ; }
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
# - Remote (upstream) Org name (MarlinFirmware)
|
||||
# - Remote (origin) Org name (your Github username)
|
||||
# - Repo Name (Marlin, MarlinDocumentation)
|
||||
# - PR Target branch (e.g., bugfix-2.0.x)
|
||||
# - PR Target branch (e.g., bugfix-2.1.x)
|
||||
# - Branch Arg (the branch argument or current branch)
|
||||
# - Current Branch
|
||||
#
|
||||
# Example output
|
||||
# > mfinfo -q ongoing
|
||||
# MarlinFirmware john.doe Marlin bugfix-2.0.x ongoing bugfix-2.0.x -q
|
||||
# MarlinFirmware john.doe Marlin bugfix-2.1.x ongoing bugfix-2.1.x -q
|
||||
#
|
||||
|
||||
CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g')
|
||||
@@ -55,8 +55,8 @@ while [[ $# -gt 0 ]]; do
|
||||
done
|
||||
|
||||
case "$REPO" in
|
||||
Marlin ) TARG=bugfix-2.0.x ; ((INDEX == 1)) && TARG=bugfix-1.1.x ; [[ $BRANCH =~ ^[12]$ ]] && USAGE=1 ;;
|
||||
Configurations ) TARG=import-2.0.x ;;
|
||||
Marlin ) TARG=bugfix-2.1.x ; ((INDEX == 1)) && TARG=bugfix-1.1.x ; [[ $BRANCH =~ ^[12]$ ]] && USAGE=1 ;;
|
||||
Configurations ) TARG=import-2.1.x ;;
|
||||
MarlinDocumentation ) TARG=master ;;
|
||||
AutoBuildMarlin ) TARG=master ;;
|
||||
esac
|
||||
|
||||
@@ -23,7 +23,7 @@ OLDBRANCH=${INFO[5]}
|
||||
# See if it's been pushed yet
|
||||
if [ -z "$(git branch -vv | grep ^\* | grep \\[origin)" ]; then firstpush; fi
|
||||
|
||||
OPEN=$(echo $(which gnome-open xdg-open open) | awk '{ print $1 }')
|
||||
OPEN=$( which gnome-open xdg-open open | head -n1 )
|
||||
URL="https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1"
|
||||
|
||||
if [ -z "$OPEN" ]; then
|
||||
|
||||
+34
-19
@@ -2,54 +2,69 @@
|
||||
#
|
||||
# mfprep tag1 [tag2]
|
||||
#
|
||||
# Find commits in bugfix-2.0.x not yet in 2.0.x
|
||||
# Find commits in bugfix-2.1.x that are not yet in 2.1.x.
|
||||
#
|
||||
# Specify a version tag to start from, and optional version tag to end at.
|
||||
# For bugfix-2.1.x the tag will be prefixed by dev- to distinguish it from the version tag,
|
||||
# so at every release be sure to create a dev- tag and publish it to origin.
|
||||
#
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
SELF=`basename "$0"`
|
||||
DRYRUN=0
|
||||
|
||||
[[ $# < 1 || $# > 2 ]] && { echo "Usage $SELF tag1 [tag2]" ; exit 1 ; }
|
||||
|
||||
TAG1=$1
|
||||
TAG2=${2:-"HEAD"}
|
||||
|
||||
DEST=2.1.x
|
||||
|
||||
# Validate that the required tags exist
|
||||
|
||||
MTAG=`git tag | grep -e "^bf-$TAG1\$"`
|
||||
[[ -n $MTAG ]] || { echo "Can't find tag bf-$TAG1" ; exit 1 ; }
|
||||
MTAG=`git tag | grep -e "^dev-$TAG1\$"`
|
||||
[[ -n "$MTAG" ]] || { echo "Can't find tag dev-$TAG1" ; exit 1 ; }
|
||||
MTAG=`git tag | grep -e "^$TAG1\$"`
|
||||
[[ -n $MTAG ]] || { echo "Can't find tag $TAG1" ; exit 1 ; }
|
||||
[[ -n "$MTAG" ]] || { echo "Can't find tag $TAG1" ; exit 1 ; }
|
||||
|
||||
# Generate log of recent commits for bugfix-2.0.x and 2.0.x
|
||||
# Generate log of recent commits for bugfix-2.1.x and DEST
|
||||
|
||||
TMPDIR=`mktemp -d`
|
||||
LOGB="$TMPDIR/log-bf.txt"
|
||||
LOG2="$TMPDIR/log-20x.txt"
|
||||
LOG2="$TMPDIR/log-2x.txt"
|
||||
TMPF="$TMPDIR/tmp.txt"
|
||||
SCRF="$TMPDIR/update-20x.sh"
|
||||
SCRF="$TMPDIR/update-$DEST.sh"
|
||||
|
||||
git checkout bugfix-2.0.x
|
||||
git log --pretty="[%h] %s" bf-$TAG1..$TAG2 | grep -v '\[cron\]' | $SED '1!G;h;$!d' >"$LOGB"
|
||||
git checkout bugfix-2.1.x
|
||||
git log --pretty="[%h] %s" dev-$TAG1..$TAG2 | grep -v '\[cron\]' | $SED '1!G;h;$!d' >"$LOGB"
|
||||
|
||||
git checkout 2.0.x
|
||||
git log --pretty="[%h] %s" $TAG1..$TAG2 | $SED '1!G;h;$!d' >"$LOG2" || { echo "Can't find tag bf-$TAG1" ; exit 1 ; }
|
||||
git checkout $DEST
|
||||
git log --pretty="[%h] %s" $TAG1..$TAG2 | $SED '1!G;h;$!d' >"$LOG2" || { echo "Can't find tag dev-$TAG1" ; exit 1 ; }
|
||||
|
||||
# Go through commit text from 2.0.x removing all matches from the bugfix log
|
||||
# Go through commit text from DEST removing all matches from the bugfix log
|
||||
|
||||
cat "$LOG2" | while read line; do
|
||||
#echo "... $line"
|
||||
if [[ $line =~ (\(#[0-9]{5}\))$ ]]; then
|
||||
PATT=${BASH_REMATCH[1]}
|
||||
if [[ $line =~ \(((#[0-9]{5}),* *)((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?\)$ ]]; then
|
||||
PATT=""
|
||||
for i in ${!BASH_REMATCH[@]}; do
|
||||
if ((i > 0 && (i % 2 == 0))); then
|
||||
if [[ -n "${BASH_REMATCH[i]}" ]]; then
|
||||
[[ -n "$PATT" ]] && PATT="$PATT|"
|
||||
PATT="$PATT${BASH_REMATCH[i]}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
#echo "... $PATT"
|
||||
[[ -n "$PATT" ]] && { grep -vE "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; }
|
||||
else
|
||||
PATT=$( $SED -E 's/^\[[0-9a-f]{10}\]( . )?(.+)$/\2/' <<<"$line" )
|
||||
[[ -n "$PATT" ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; }
|
||||
fi
|
||||
[[ -n $PATT ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; }
|
||||
done
|
||||
|
||||
# Convert remaining commits into git commands
|
||||
|
||||
echo -e "#!/usr/bin/env bash\nset -e\ngit checkout 2.0.x\n" >"$TMPF"
|
||||
echo -e "#!/usr/bin/env bash\nset -e\ngit checkout ${DEST}\n" >"$TMPF"
|
||||
cat "$LOGB" | while read line; do
|
||||
if [[ $line =~ ^\[([0-9a-f]{10})\]\ *(.*)$ ]]; then
|
||||
CID=${BASH_REMATCH[1]}
|
||||
@@ -60,6 +75,6 @@ cat "$LOGB" | while read line; do
|
||||
fi
|
||||
done
|
||||
mv "$TMPF" "$SCRF"
|
||||
chmod ug+x "$SCRF"
|
||||
chmod +x "$SCRF"
|
||||
|
||||
open "$TMPDIR"
|
||||
((DRYRUN)) && rm -r "$TMPDIR" || open "$TMPDIR"
|
||||
|
||||
@@ -45,7 +45,7 @@ git clean -d -f
|
||||
|
||||
opensite() {
|
||||
URL="$1"
|
||||
OPEN=$(echo $(which gnome-open xdg-open open) | awk '{ print $1 }')
|
||||
OPEN=$( which gnome-open xdg-open open | head -n1 )
|
||||
if [ -z "$OPEN" ]; then
|
||||
echo "Can't find a tool to open the URL:"
|
||||
echo $URL
|
||||
|
||||
Reference in New Issue
Block a user