-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script to prepare first upstreaming PR
Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
TARGETBRANCH="$1" | ||
|
||
CRATES=" | ||
plugins/xcp-metrics-plugin-squeezed | ||
plugins/xcp-metrics-plugin-common | ||
xcp-metrics-common | ||
" | ||
|
||
CRATES_RE=$(echo $CRATES | tr ' ' '|') | ||
|
||
CONTENTS=" | ||
$CRATES | ||
Cargo.toml | ||
.gitignore | ||
.github | ||
LICENSE | ||
" | ||
|
||
# new branch for initial commit | ||
git switch --orphan "$TARGETBRANCH" | ||
# with specified contents | ||
git restore -WS --source="main" $CONTENTS | ||
|
||
# and only specified crates in workspace | ||
sed -E -i Cargo.toml -e '/^[^ ]/ p | ||
\,"('$CRATES_RE')", p | ||
d' | ||
git add Cargo.toml | ||
|
||
# commit | ||
<<EOF cat | | ||
WIP Introduce xcp-metrics-plugin-squeezed plugin for xcp-rrdd | ||
xcp-metrics-plugin-squeezed is meant as a drop-in replacecement for | ||
rrdp-squeezed, as a first Rust-written brick for XAPI. | ||
EOF | ||
git commit -F - --author=Teddy |