diff options
Diffstat (limited to 'git')
-rw-r--r-- | git/Makefile | 2 | ||||
-rwxr-xr-x | git/bin/git-checkout-branches | 2 | ||||
-rwxr-xr-x | git/bin/git-hook | 2 | ||||
-rwxr-xr-x | git/bin/git-pull-branches | 54 | ||||
-rwxr-xr-x | git/bin/git-remove-origin-branches | 2 | ||||
-rwxr-xr-x | git/bin/git-remove-origin-tags | 2 | ||||
-rwxr-xr-x | git/bin/git-repo-repack | 2 | ||||
-rwxr-xr-x | git/share/hooks/post-update.d/cgit-agefile | 2 | ||||
-rwxr-xr-x | git/share/hooks/post-update.d/git-update-server-info | 2 | ||||
-rwxr-xr-x | git/share/hooks/post-update.d/irker-notification | 2 |
10 files changed, 63 insertions, 9 deletions
diff --git a/git/Makefile b/git/Makefile index d3c7921..14db1ef 100644 --- a/git/Makefile +++ b/git/Makefile @@ -1,6 +1,6 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/git/bin/git-checkout-branches b/git/bin/git-checkout-branches index 220386f..dd04bb6 100755 --- a/git/bin/git-checkout-branches +++ b/git/bin/git-checkout-branches @@ -2,7 +2,7 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/git/bin/git-hook b/git/bin/git-hook index 218ef00..81776ea 100755 --- a/git/bin/git-hook +++ b/git/bin/git-hook @@ -2,7 +2,7 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/git/bin/git-pull-branches b/git/bin/git-pull-branches new file mode 100755 index 0000000..aca1ea3 --- /dev/null +++ b/git/bin/git-pull-branches @@ -0,0 +1,54 @@ +#!/bin/sh + +# Open Infrastructure: service-tools + +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +set -e + +CURRENT_BRANCH="$(git branch --show-current)" +REMOTE_BRANCHES="$(git branch -r | awk '{ print $1 }')" + +# pull current branch +git pull + +# pull remote branches +for REMOTE_BRANCH in ${REMOTE_BRANCHES} +do + BRANCH="$(echo "${REMOTE_BRANCH}" | cut -d/ -f 2-)" + + case "${BRANCH}" in + HEAD|"${CURRENT_BRANCH}") + continue + ;; + esac + + if git branch | sed -e 's|\*||' | grep -qs " ${BRANCH}$" + then + git checkout "${BRANCH}" + git pull + else + git checkout -b "${BRANCH}" "${REMOTE_BRANCH}" + fi +done + +# checkout current branch +if [ "$(git branch --show-current)" != "${CURRENT_BRANCH}" ] +then + git checkout "${CURRENT_BRANCH}" +fi diff --git a/git/bin/git-remove-origin-branches b/git/bin/git-remove-origin-branches index be65a1f..de403ca 100755 --- a/git/bin/git-remove-origin-branches +++ b/git/bin/git-remove-origin-branches @@ -2,7 +2,7 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/git/bin/git-remove-origin-tags b/git/bin/git-remove-origin-tags index 8246ec2..1de452f 100755 --- a/git/bin/git-remove-origin-tags +++ b/git/bin/git-remove-origin-tags @@ -2,7 +2,7 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/git/bin/git-repo-repack b/git/bin/git-repo-repack index cf5a30c..035d55a 100755 --- a/git/bin/git-repo-repack +++ b/git/bin/git-repo-repack @@ -2,7 +2,7 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/git/share/hooks/post-update.d/cgit-agefile b/git/share/hooks/post-update.d/cgit-agefile index a00b038..4faafd6 100755 --- a/git/share/hooks/post-update.d/cgit-agefile +++ b/git/share/hooks/post-update.d/cgit-agefile @@ -2,7 +2,7 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/git/share/hooks/post-update.d/git-update-server-info b/git/share/hooks/post-update.d/git-update-server-info index 1b21b51..c90015a 100755 --- a/git/share/hooks/post-update.d/git-update-server-info +++ b/git/share/hooks/post-update.d/git-update-server-info @@ -2,7 +2,7 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/git/share/hooks/post-update.d/irker-notification b/git/share/hooks/post-update.d/irker-notification index 7c712db..8ef52ce 100755 --- a/git/share/hooks/post-update.d/irker-notification +++ b/git/share/hooks/post-update.d/irker-notification @@ -2,7 +2,7 @@ # Open Infrastructure: service-tools -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # |