2024-10-25 23:05:45 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -eu -o pipefail
|
|
|
|
CLI=${1:?The first argument is the GitButler CLI}
|
|
|
|
|
2024-11-09 13:54:53 +03:00
|
|
|
function tick () {
|
|
|
|
if test -z "${tick+set}"; then
|
|
|
|
tick=1675176957
|
|
|
|
else
|
|
|
|
tick=$(($tick + 60))
|
|
|
|
fi
|
|
|
|
GIT_COMMITTER_DATE="$tick +0100"
|
|
|
|
GIT_AUTHOR_DATE="$tick +0100"
|
|
|
|
export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
|
|
|
|
}
|
2024-10-25 23:05:45 +03:00
|
|
|
|
|
|
|
git init remote
|
|
|
|
(cd remote
|
2024-11-08 23:23:27 +03:00
|
|
|
echo a > file
|
2024-10-25 23:05:45 +03:00
|
|
|
git add . && git commit -m "init"
|
|
|
|
)
|
|
|
|
|
|
|
|
export GITBUTLER_CLI_DATA_DIR=../user/gitbutler/app-data
|
|
|
|
git clone remote multiple-commits
|
|
|
|
(cd multiple-commits
|
2024-10-26 16:11:35 +03:00
|
|
|
git config user.name "Author"
|
|
|
|
git config user.email "author@example.com"
|
|
|
|
|
2024-10-25 23:05:45 +03:00
|
|
|
git branch existing-branch
|
|
|
|
$CLI project add --switch-to-workspace "$(git rev-parse --symbolic-full-name @{u})"
|
2024-10-26 16:11:35 +03:00
|
|
|
|
2024-10-25 23:05:45 +03:00
|
|
|
$CLI branch create --set-default other_stack
|
|
|
|
echo change0 >> other_file
|
|
|
|
$CLI branch commit other_stack -m "commit 0"
|
|
|
|
|
|
|
|
$CLI branch create --set-default my_stack
|
|
|
|
echo change1 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 1"
|
|
|
|
echo change2 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 2"
|
|
|
|
echo change3 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 3"
|
|
|
|
|
|
|
|
$CLI branch series my_stack -s "top-series"
|
|
|
|
echo change4 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 4"
|
|
|
|
echo change5 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 5"
|
|
|
|
echo change6 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 6"
|
|
|
|
)
|
2024-10-28 00:50:35 +03:00
|
|
|
|
|
|
|
git clone remote multiple-commits-small
|
|
|
|
(cd multiple-commits-small
|
|
|
|
git config user.name "Author"
|
|
|
|
git config user.email "author@example.com"
|
|
|
|
|
|
|
|
git branch existing-branch
|
|
|
|
$CLI project add --switch-to-workspace "$(git rev-parse --symbolic-full-name @{u})"
|
|
|
|
|
|
|
|
$CLI branch create --set-default other_stack
|
|
|
|
echo change0 >> other_file
|
|
|
|
$CLI branch commit other_stack -m "commit 0"
|
|
|
|
|
|
|
|
$CLI branch create --set-default my_stack
|
|
|
|
echo change1 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 1"
|
|
|
|
|
|
|
|
$CLI branch series my_stack -s "top-series"
|
|
|
|
echo change4 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 2"
|
|
|
|
)
|
|
|
|
|
|
|
|
git clone remote multiple-commits-empty-top
|
|
|
|
(cd multiple-commits-empty-top
|
|
|
|
git config user.name "Author"
|
|
|
|
git config user.email "author@example.com"
|
|
|
|
|
|
|
|
git branch existing-branch
|
|
|
|
$CLI project add --switch-to-workspace "$(git rev-parse --symbolic-full-name @{u})"
|
|
|
|
|
|
|
|
$CLI branch create --set-default other_stack
|
|
|
|
echo change0 >> other_file
|
|
|
|
$CLI branch commit other_stack -m "commit 0"
|
|
|
|
|
|
|
|
$CLI branch create --set-default my_stack
|
|
|
|
echo change1 >> file
|
|
|
|
$CLI branch commit my_stack -m "commit 1"
|
|
|
|
|
|
|
|
$CLI branch series my_stack -s "top-series"
|
|
|
|
)
|
2024-11-08 23:23:27 +03:00
|
|
|
|
|
|
|
git clone remote overlapping-commits
|
2024-11-09 13:54:53 +03:00
|
|
|
tick
|
2024-11-08 23:23:27 +03:00
|
|
|
(cd overlapping-commits
|
|
|
|
git config user.name "Author"
|
|
|
|
git config user.email "author@example.com"
|
|
|
|
|
|
|
|
git branch existing-branch
|
|
|
|
$CLI project add --switch-to-workspace "$(git rev-parse --symbolic-full-name @{u})"
|
|
|
|
|
|
|
|
$CLI branch create --set-default other_stack
|
|
|
|
echo change0 >> other_file
|
|
|
|
$CLI branch commit other_stack -m "commit 0"
|
|
|
|
|
|
|
|
$CLI branch create --set-default my_stack
|
|
|
|
echo x > file
|
|
|
|
$CLI branch commit my_stack -m "commit 1"
|
2024-11-09 13:54:53 +03:00
|
|
|
tick
|
2024-11-08 23:23:27 +03:00
|
|
|
echo y > file
|
|
|
|
$CLI branch commit my_stack -m "commit 2"
|
|
|
|
|
|
|
|
$CLI branch series my_stack -s "top-series"
|
|
|
|
)
|