Add a --dry-run option to git-push.
The default behaviour of git-push is potentially confusing for new users, since it will push changes that are not on the current branch. Publishing patches that were still cooking on a development branch is hard to undo. It would also be nice to be able to verify the expansion of refspecs if you've edited them, so that you know what branches matched on the server. Adding a --dry-run flag allows the user to experiment safely and learn how to use git-push properly. Originally suggested by Steffen Prohaska. Signed-off-by: Brian Ewins <brian.ewins@gmail.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:

committed by
Shawn O. Pearce

parent
a63103ae4f
commit
11f2441f05
@ -244,4 +244,14 @@ test_expect_success 'push with colon-less refspec (4)' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'push with dry-run' '
|
||||
|
||||
mk_test heads/master &&
|
||||
cd testrepo &&
|
||||
old_commit=$(git show-ref -s --verify refs/heads/master) &&
|
||||
cd .. &&
|
||||
git push --dry-run testrepo &&
|
||||
check_push_result $old_commit heads/master
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user