Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VTK
VTK
Commits
b629b129
Commit
b629b129
authored
Feb 01, 2012
by
Brad King
Committed by
Code Review
Feb 01, 2012
Browse files
Options
Browse Files
Download
Plain Diff
Merge topic 'update-development-aliases' into master
9c85bf77
ENH: Deprecate the git stage aliases.
parents
b74425b7
9c85bf77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
48 deletions
+5
-48
Utilities/Scripts/SetupGitAliases.sh
Utilities/Scripts/SetupGitAliases.sh
+5
-8
Utilities/Scripts/git-gerrit-merge
Utilities/Scripts/git-gerrit-merge
+0
-40
No files found.
Utilities/Scripts/SetupGitAliases.sh
View file @
b629b129
...
...
@@ -12,13 +12,10 @@ ${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
}
\"
"
stage_deprecated
=
"The stage aliases have been deprecated. Please use Gerrit."
${
GITCONFIG
}
alias.stage-cmd
"!sh -c
\"
echo
${
stage_deprecated
}
\"
"
${
GITCONFIG
}
alias.stage-push
"!sh -c
\"
echo
${
stage_deprecated
}
\"
"
${
GITCONFIG
}
alias.stage-branch
"!sh -c
\"
echo
${
stage_deprecated
}
\"
"
${
GITCONFIG
}
alias.stage-merge
"!sh -c
\"
echo
${
stage_deprecated
}
\"
"
# Alias to push the current topic branch to Gerrit
${
GITCONFIG
}
alias.gerrit-push
"!bash Utilities/Scripts/git-gerrit-push"
${
GITCONFIG
}
alias.gerrit-merge
"!bash Utilities/Scripts/git-gerrit-merge"
Utilities/Scripts/git-gerrit-merge
deleted
100755 → 0
View file @
b74425b7
#!/usr/bin/env bash
die
()
{
echo
'gerrit-merge failure'
1>&2
echo
'--------------------'
1>&2
echo
''
1>&2
echo
"
$@
"
1>&2
exit
1
}
remote
=
gerrit
SUBDIRECTORY_OK
=
Yes
.
"
$(
git
--exec-path
)
/git-sh-setup"
topic
=
"
$(
git symbolic-ref HEAD |
sed
-e
's|^refs/heads/||'
)
"
# Provide a method to check if a patch is present in Gerrit, show its status
gerrit_remote
=
$(
git config remote.gerrit.url
)
if
test
-n
"
$gerrit_remote
"
;
then
gerrit_url
=
$(
echo
$gerrit_remote
|
cut
-d
':'
-f
1
)
gerrit_project
=
$(
echo
$gerrit_remote
|
cut
-d
':'
-f
2
)
else
die
"Gerrit remote not set."
fi
ssh
$gerrit_url
gerrit ls-projects
>
/dev/null
||
die
"Could not connect to Gerrit."
head_sha
=
$(
git rev-parse HEAD
)
commit_count
=
$(
ssh
$gerrit_url
gerrit query
--
commit:
$head_sha
|
\
awk
'/rowCount/ { print $2 }'
)
if
test
"
$commit_count
"
-lt
1
;
then
read
-ep
"Are you sure you want to merge '
$topic
' to VTK master? [N/y]: "
merge_it
if
test
"
$merge_it
"
!=
"y"
-a
"
$merge_it
"
!=
"Y"
;
then
die
"Merge cancelled."
fi
fi
echo
"Merging topic '
$topic
' into VTK master."
git stage-push
&&
git stage-merge
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment