File: SetupGitAliases.sh

package info (click to toggle)
vtk 5.8.0-13
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 130,524 kB
  • sloc: cpp: 1,129,256; ansic: 708,203; tcl: 48,526; python: 20,875; xml: 6,779; yacc: 4,208; perl: 3,121; java: 2,788; lex: 931; sh: 660; asm: 471; makefile: 299
file content (23 lines) | stat: -rwxr-xr-x 971 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

# Centralize project variables for each script
project="VTK"
projectUrl="vtk.org"

GIT=git
GITCONFIG="${GIT} config"

# General aliases that could be global
${GITCONFIG} alias.pullall "!sh -c \"git pull && git submodule update --init\""
${GITCONFIG} alias.prepush 'log --graph --stat origin/master..'

# Staging aliases
stage_cmd="ssh git@${projectUrl} stage ${project}"
git_branch="\$(git symbolic-ref HEAD | sed -e 's|^refs/heads/||')"
${GITCONFIG} alias.stage-cmd "!${stage_cmd}"
${GITCONFIG} alias.stage-push "!sh -c \"git fetch stage --prune && git push stage HEAD\""
${GITCONFIG} alias.stage-branch "!sh -c \"${stage_cmd} print\""
${GITCONFIG} alias.stage-merge-next "!sh -c \"${stage_cmd} merge -b next ${git_branch}\""
${GITCONFIG} alias.stage-merge "!sh -c \"${stage_cmd} merge ${git_branch}\""
# Alias to push the current topic branch to Gerrit
${GITCONFIG} alias.gerrit-push "!sh -c \"git push gerrit HEAD:refs/for/master/${git_branch}\""