All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] create-pull-request: Fix error on 2.0 versions of git
@ 2014-08-04 18:55 Ben Shelton
  2015-07-13 18:43 ` Richard Tollerton
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Shelton @ 2014-08-04 18:55 UTC (permalink / raw)
  To: openembedded-core

On 2.0 versions of git, the create-pull-request script exits with the
warning "No match for commit... Are you sure you pushed 'HEAD' there?".

This is due to a change in behavior where git used to guess the branch
you meant, but no longer does.  See the thread at
http://www.spinics.net/lists/git/msg233050.html for more information.

To accommodate the new behavior, if the COMMIT_ID is set to the default
of "HEAD", make it point explicitly to $BRANCH instead.

Signed-off-by: Ben Shelton <ben.shelton@ni.com>
---
 scripts/create-pull-request | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 503248b..2bf5eb5 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -125,6 +125,10 @@ if [ -z "$BRANCH" ]; then
 	echo "NOTE: Assuming remote branch '$BRANCH', use -b to override."
 fi
 
+if [ "$COMMIT_ID" == "HEAD" ]; then
+	COMMIT_ID="$BRANCH"
+fi
+
 if [ -z "$REMOTE_URL" ]; then
 	echo "ERROR: Missing parameter -u, no git remote!"
 	usage
-- 
2.0.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-17 16:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-04 18:55 [PATCH] create-pull-request: Fix error on 2.0 versions of git Ben Shelton
2015-07-13 18:43 ` Richard Tollerton
2015-07-14  9:49   ` Burton, Ross
2015-07-17  2:35     ` Robert Yang
2015-07-17 16:39       ` Richard Tollerton
2015-07-17 16:50         ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.