[llvm] r371290 - [git-llvm] Do not reinvent `@{upstream}`
David Zarzycki via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 6 23:44:52 PDT 2019
Author: davezarzycki
Date: Fri Sep 6 23:44:52 2019
New Revision: 371290
URL: http://llvm.org/viewvc/llvm-project?rev=371290&view=rev
Log:
[git-llvm] Do not reinvent `@{upstream}`
Make `git-llvm` more robust when used with a nontrivial repository.
https://reviews.llvm.org/D67262
Modified:
llvm/trunk/utils/git-svn/git-llvm
Modified: llvm/trunk/utils/git-svn/git-llvm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/git-svn/git-llvm?rev=371290&r1=371289&r2=371290&view=diff
==============================================================================
--- llvm/trunk/utils/git-svn/git-llvm (original)
+++ llvm/trunk/utils/git-svn/git-llvm Fri Sep 6 23:44:52 2019
@@ -190,16 +190,8 @@ def program_exists(cmd):
def get_default_rev_range():
- # Get the branch tracked by the current branch, as set by
- # git branch --set-upstream-to See http://serverfault.com/a/352236/38694.
- cur_branch = git('rev-parse', '--symbolic-full-name', 'HEAD')
- upstream_branch = git('for-each-ref', '--format=%(upstream:short)',
- cur_branch)
- if not upstream_branch:
- upstream_branch = 'origin/master'
-
# Get the newest common ancestor between HEAD and our upstream branch.
- upstream_rev = git('merge-base', 'HEAD', upstream_branch)
+ upstream_rev = git('merge-base', 'HEAD', '@{upstream}')
return '%s..' % upstream_rev
@@ -637,9 +629,7 @@ if __name__ == '__main__':
metavar='GIT_REVS',
type=str,
nargs='?',
- help="revs to push (default: everything not in the branch's "
- 'upstream, or not in origin/master if the branch lacks '
- 'an explicit upstream)')
+ help="revs to push (default: everything not in the upstream branch).")
parser_push.set_defaults(func=cmd_push)
parser_revert = subcommands.add_parser(
More information about the llvm-commits
mailing list