From 4e466af8d8b06d0c0cf6d1c28397dcd022850ffe Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 19 Oct 2018 14:09:29 +0200 Subject: gpush: add support for omitting HEAD from rev-specs typing the ALL-UPPERCASE HEAD is a nuisance, so have shortened specs like '~3' imply HEAD. Change-Id: Ia4867e6ed1127c9379b96bbae4fed055fd98c60c Reviewed-by: Oswald Buddenhagen --- bin/git-gpush | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/git-gpush') diff --git a/bin/git-gpush b/bin/git-gpush index c8c60bb..bf1ca81 100755 --- a/bin/git-gpush +++ b/bin/git-gpush @@ -48,7 +48,8 @@ Description: branch's upstream remote. 'From' may be specified as either a ref, a SHA1, or a Gerrit Change-Id, - possibly abbreviated. Git rev-spec suffixes like '~2' are allowed. + possibly abbreviated. Git rev-spec suffixes like '~2' are allowed; if + only a suffix is specified, it is understood to be relative to 'HEAD'. If 'from' is not specified, 'HEAD' is used. Note that this program can be used in the middle of an interactive @@ -452,6 +453,7 @@ sub initialize_get_changes() } else { # We did not need to visit the current branch to find the tip, # so determine the branch from the tip now. + $from = "HEAD".$from if ($from =~ /^[~^]/); determine_local_branch($from); # Get the pool of Changes to push from. analyze_local_branch($from) or -- cgit v1.2.3