Merge upstream changes from Marlin 2.1.1
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
|
||||
|
@@ -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'))."
|
||||
@@ -74,6 +74,8 @@ if [[ $ACTION == "init" ]]; then
|
||||
# a 'BASE' branch with only defaults as a starting point.
|
||||
#
|
||||
|
||||
SED=$(which gsed sed | head -n1)
|
||||
|
||||
echo "- Initializing BASE branch..."
|
||||
|
||||
# Use the import branch as the source
|
||||
@@ -82,6 +84,14 @@ if [[ $ACTION == "init" ]]; then
|
||||
# Copy to a temporary location
|
||||
TEMP=$( mktemp -d ) ; cp -R config $TEMP
|
||||
|
||||
# Strip all #error lines
|
||||
IFS=$'\n'; set -f
|
||||
for fn in $( find $TEMP/config -type f -name "Configuration.h" ); do
|
||||
$SED -i~ -e "20,30{/#error/d}" "$fn"
|
||||
rm "$fn~"
|
||||
done
|
||||
unset IFS; set +f
|
||||
|
||||
# Make sure we're not on the 'BASE' branch...
|
||||
git checkout init-repo >/dev/null 2>&1 || exit
|
||||
|
||||
@@ -100,56 +110,17 @@ 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
|
||||
SED=$(which gsed sed | head -n1)
|
||||
VERS=$( echo $EXPORT | $SED 's/release-//' )
|
||||
eval "${SED} -E -i~ -e 's/%VERSION%/$VERS/g' README.md"
|
||||
rm -f README.md~
|
||||
|
@@ -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
|
||||
|
@@ -1,19 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# mffp [1|2|3] [commit-id]
|
||||
# mffp [1|2] [ref]
|
||||
#
|
||||
# Push the given commit (or HEAD) upstream immediately.
|
||||
# By default: `git push upstream HEAD:bugfix-1.1.x`
|
||||
# By default: `git push upstream HEAD:bugfix-2.1.x`
|
||||
#
|
||||
|
||||
[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [1|2|3] [commit-id]" 1>&2 ; exit 1; }
|
||||
usage() { echo "usage: `basename $0` [1|2] [ref]" 1>&2 ; }
|
||||
|
||||
if [[ $1 == '1' || $1 == '2' || $1 == '3' ]]; then
|
||||
[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { usage ; exit 1; }
|
||||
|
||||
if [[ $1 == '1' || $1 == '2' ]]; then
|
||||
MFINFO=$(mfinfo "$1") || exit 1
|
||||
REF=${2:-HEAD}
|
||||
else
|
||||
elif [[ $# == 1 ]]; then
|
||||
MFINFO=$(mfinfo) || exit 1
|
||||
REF=${1:-HEAD}
|
||||
else
|
||||
usage ; exit 1
|
||||
fi
|
||||
|
||||
IFS=' ' read -a INFO <<< "$MFINFO"
|
||||
|
@@ -2,15 +2,19 @@
|
||||
#
|
||||
# mfinfo
|
||||
#
|
||||
# Provide the following info about the working directory:
|
||||
# Print the following info about the working copy:
|
||||
#
|
||||
# - Remote (upstream) Org name (MarlinFirmware)
|
||||
# - Remote (origin) Org name (your Github username)
|
||||
# - Repo Name (Marlin, MarlinDocumentation)
|
||||
# - PR Target branch (bugfix-1.1.x, bugfix-2.0.x, dev-2.1.x, etc.)
|
||||
# - 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.1.x ongoing bugfix-2.1.x -q
|
||||
#
|
||||
|
||||
CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g')
|
||||
[[ -z $CURR ]] && { echo "No git repository here!" 1>&2 ; exit 1; }
|
||||
@@ -26,36 +30,37 @@ FORK=$(git remote get-url origin 2>/dev/null | sed -E 's/.*[\/:](.*)\/.*$/\1/')
|
||||
|
||||
# Defaults if no arguments given
|
||||
BRANCH=$CURR
|
||||
INDEX=1
|
||||
MORE=""
|
||||
INDEX=2
|
||||
|
||||
# Loop through arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
# Get an arg and maybe a val to go with it
|
||||
opt="$1" ; shift ; val="$1"
|
||||
|
||||
# Split up an arg containing =
|
||||
IFS='=' read -a PARTS <<<"$opt"
|
||||
[[ "${PARTS[1]}" != "" ]] && { EQUALS=1 ; opt="${PARTS[0]}" ; val="${PARTS[1]}" ; }
|
||||
|
||||
GOODVAL=1
|
||||
if [[ "$val" =~ ^-{1,2}.* || ! "$opt" =~ ^-{1,2}.* ]]; then
|
||||
GOODVAL=0
|
||||
val=""
|
||||
fi
|
||||
|
||||
case "$opt" in
|
||||
-*|--*) MORE="$MORE$opt " ; [[ $EQUALS == 1 ]] && MORE="$MORE=$val" ;;
|
||||
1|2|3) INDEX=$opt ;;
|
||||
-*|--*) MORE=" $MORE$opt" ; ((EQUALS)) && MORE="$MORE=$val" ;;
|
||||
1|2) INDEX=$opt ;;
|
||||
*) BRANCH="$opt" ;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
case "$REPO" in
|
||||
Marlin ) TARG=bugfix-2.0.x ; [[ $INDEX == 1 ]] && TARG=bugfix-1.1.x ; [[ $INDEX == 3 ]] && TARG=dev-2.1.x ;;
|
||||
Marlin ) TARG=bugfix-2.1.x ; ((INDEX == 1)) && TARG=bugfix-1.1.x ; [[ $BRANCH =~ ^[12]$ ]] && USAGE=1 ;;
|
||||
Configurations ) TARG=import-2.0.x ;;
|
||||
MarlinDocumentation ) TARG=master ;;
|
||||
AutoBuildMarlin ) TARG=master ;;
|
||||
esac
|
||||
|
||||
[[ $BRANCH =~ ^[123]$ ]] && USAGE=1
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2] [branch]" 1>&2 ; exit 1 ; }
|
||||
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2|3] [branch]" 1>&2 ; exit 1 ; }
|
||||
|
||||
echo "$ORG $FORK $REPO $TARG $BRANCH $CURR $MORE"
|
||||
echo "$ORG $FORK $REPO $TARG $BRANCH $CURR$MORE"
|
||||
|
@@ -5,9 +5,7 @@
|
||||
# Create a new branch from the default target with the given name
|
||||
#
|
||||
|
||||
usage() {
|
||||
echo "usage: `basename $0` [1|2|3] [name]" 1>&2
|
||||
}
|
||||
usage() { echo "usage: `basename $0` [1|2] [name]" 1>&2 ; }
|
||||
|
||||
[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { usage; exit 1; }
|
||||
|
||||
@@ -19,12 +17,12 @@ BRANCH=pr_for_$TARG-$(date +"%G-%m-%d_%H.%M.%S")
|
||||
# BRANCH can be given as the last argument
|
||||
case "$#" in
|
||||
1 ) case "$1" in
|
||||
1|2|3) ;;
|
||||
1|2) ;;
|
||||
*) BRANCH=$1 ;;
|
||||
esac
|
||||
;;
|
||||
2 ) case "$1" in
|
||||
1|2|3) BRANCH=$2 ;;
|
||||
1|2) BRANCH=$2 ;;
|
||||
*) usage ; exit 1 ;;
|
||||
esac
|
||||
;;
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# mfpr [1|2|3]
|
||||
# mfpr [1|2]
|
||||
#
|
||||
# Make a PR against bugfix-1.1.x or bugfix-2.0.x
|
||||
# Make a PR targeted to MarlinFirmware/[repo]
|
||||
#
|
||||
|
||||
[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [1|2|3] [branch]" 1>&2 ; exit 1; }
|
||||
[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [1|2] [branch]" 1>&2 ; exit 1; }
|
||||
|
||||
MFINFO=$(mfinfo "$@") || exit 1
|
||||
IFS=' ' read -a INFO <<< "$MFINFO"
|
||||
@@ -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
|
||||
|
80
buildroot/share/git/mfprep
Executable file
80
buildroot/share/git/mfprep
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# mfprep tag1 [tag2]
|
||||
#
|
||||
# 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 "^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 ; }
|
||||
|
||||
# Generate log of recent commits for bugfix-2.1.x and DEST
|
||||
|
||||
TMPDIR=`mktemp -d`
|
||||
LOGB="$TMPDIR/log-bf.txt"
|
||||
LOG2="$TMPDIR/log-2x.txt"
|
||||
TMPF="$TMPDIR/tmp.txt"
|
||||
SCRF="$TMPDIR/update-$DEST.sh"
|
||||
|
||||
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 $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 DEST removing all matches from the bugfix log
|
||||
|
||||
cat "$LOG2" | while read line; do
|
||||
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
|
||||
done
|
||||
|
||||
# Convert remaining commits into git commands
|
||||
|
||||
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]}
|
||||
REST=${BASH_REMATCH[2]}
|
||||
echo "git cherry-pick $CID ;# $REST" >>"$TMPF"
|
||||
else
|
||||
echo ";# $line" >>"$TMPF"
|
||||
fi
|
||||
done
|
||||
mv "$TMPF" "$SCRF"
|
||||
chmod +x "$SCRF"
|
||||
|
||||
((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
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# mfqp [1|2|3]
|
||||
# mfqp [1|2]
|
||||
#
|
||||
# - git add .
|
||||
# - git commit --amend
|
||||
@@ -24,7 +24,7 @@ while [ $IND -lt ${#INFO[@]} ]; do
|
||||
let IND+=1
|
||||
done
|
||||
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2|3]" 1>&2 ; exit 1 ; }
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2]" 1>&2 ; exit 1 ; }
|
||||
|
||||
[[ $FORCE != 1 && $CURR == $TARG && $REPO != "MarlinDocumentation" ]] && { echo "Don't alter the PR Target branch."; exit 1 ; }
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# mfrb
|
||||
#
|
||||
# Do "git rebase -i" against the "target" branch (bugfix-1.1.x, bugfix-2.0.x, dev-2.1.x, or master)
|
||||
# Do "git rebase -i" against the repo's "target" branch
|
||||
#
|
||||
|
||||
MFINFO=$(mfinfo "$@") || exit 1
|
||||
@@ -21,7 +21,7 @@ while [ $IND -lt ${#INFO[@]} ]; do
|
||||
let IND+=1
|
||||
done
|
||||
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2|3]" 1>&2 ; exit 1 ; }
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2]" 1>&2 ; exit 1 ; }
|
||||
|
||||
[[ $QUICK ]] || git fetch upstream
|
||||
git rebase upstream/$TARG && git rebase -i upstream/$TARG
|
||||
|
Reference in New Issue
Block a user