diff --git a/Taskfile.dist.yml b/Taskfile.dist.yml index 4f1910fd6..090913b3e 100644 --- a/Taskfile.dist.yml +++ b/Taskfile.dist.yml @@ -42,6 +42,7 @@ includes: {{.ROOT_DIR}}/metapkg {{.ROOT_DIR}}/terrarium/dl_repmanager/dl_repmanager_tests/testrepo/lib/testing_pkg_boilerplate {{.ROOT_DIR}}/terrarium/bi_ci/bi_ci_tests/unit/resources + PARENT_BRANCH: '{{.PARENT_BRANCH | default "main"}}' ops: taskfile: tools/taskfiles/taskfile_ops.yml diff --git a/tools/taskfiles/taskfile_dev.yml b/tools/taskfiles/taskfile_dev.yml index b7c63c18c..99d609d2e 100644 --- a/tools/taskfiles/taskfile_dev.yml +++ b/tools/taskfiles/taskfile_dev.yml @@ -403,3 +403,18 @@ tasks: - echo "Next processes will be killed:" - ps -ef | grep "ssh -f -N -L" | grep --invert-match "grep" - pkill -f "ssh -f -N -L" + + squash: + desc: Squash all commits made on CHILD_BRANCH relative to PARENT_BRANCH into single one (using git reset --soft) + vars: + REMOTE: '{{.REMOTE | default "origin"}}' + requires: + vars: + - PARENT_BRANCH + - CHILD_BRANCH + cmds: + - git fetch {{.REMOTE}} -f {{.PARENT_BRANCH}}:{{.PARENT_BRANCH}} + - git switch {{.CHILD_BRANCH}} + - git fetch {{.REMOTE}} {{.CHILD_BRANCH}} + - git reset --soft $(git merge-base {{.PARENT_BRANCH}} HEAD) + - echo 'Now you can commit merged changes with "git commit -m "commit message"'