Skip to content

Commit

Permalink
Use git worktrees for foreman-packaging
Browse files Browse the repository at this point in the history
Previously it was assumed to have something like ~/dev/foreman-packaging
but with git worktrees you can create multiple working directories. I
have switched over to:

    $ tree -L 1 ~/dev/foreman-packaging
    /home/ekohl/dev/foreman-packaging
    ├── deb-3.1
    ├── deb-3.2
    ├── deb-3.3
    ├── deb-3.4
    ├── deb-3.5
    ├── deb-3.6
    ├── deb-develop
    ├── master
    ├── rpm-3.1
    ├── rpm-3.2
    ├── rpm-3.3
    ├── rpm-3.5
    ├── rpm-3.6
    └── rpm-develop

This is all backed by a single .git directory, which makes it much
cheaper.
  • Loading branch information
ekohl committed Aug 23, 2023
1 parent cae4861 commit 0205aaa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bump_packaging
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ fi
REMOTE_BRANCH="${FLAVOR}/${FOREMAN_VERSION}"
FULL_REMOTE_BRANCH="$PACKAGING_GIT_REMOTE/$REMOTE_BRANCH"

PACKAGING_DIR="${PACKAGING_DIR}/${FLAVOR}-$VERSION"

if [[ ! -d "$PACKAGING_DEB_DIR" ]] ; then
(
cd "${PACKAGING_DIR}/master"
git worktree add "$PACKAGING_DEB_DIR" "$PACKAGING_GIT_REMOTE/$REMOTE_BRANCH"
)
fi

cd "$PACKAGING_DIR"

git fetch $PACKAGING_GIT_REMOTE
Expand Down

0 comments on commit 0205aaa

Please sign in to comment.