All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] create-pull-request: handle empty ODIR
@ 2015-11-24 12:45 Petter Mabäcker
  2015-11-24 12:45 ` [PATCH 1/1] " Petter Mabäcker
  0 siblings, 1 reply; 2+ messages in thread
From: Petter Mabäcker @ 2015-11-24 12:45 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 1b25a70991589ed1f123015c16ee4806c46e3199:

  yocto-project-qs, ref-manual, poky.ent: CentOS Package updates (2015-11-18 16:42:22 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib petmab/fix_empty_odir
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=petmab/fix_empty_odir

Petter Mabäcker (1):
  create-pull-request: handle empty ODIR

 scripts/create-pull-request | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
1.9.1



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

* [PATCH 1/1] create-pull-request: handle empty ODIR
  2015-11-24 12:45 [PATCH 0/1] create-pull-request: handle empty ODIR Petter Mabäcker
@ 2015-11-24 12:45 ` Petter Mabäcker
  0 siblings, 0 replies; 2+ messages in thread
From: Petter Mabäcker @ 2015-11-24 12:45 UTC (permalink / raw)
  To: openembedded-core

In some situations you might end-up with an empty ODIR (pull-xx/). The
most common reason is that you have applied your patches on 'master'
branch (or you are by mistake standing on the 'master' branch),
this will result in the default behavior that 'git format-patch'
will try to diff master..master.

Solve this by aborting the script with a proper error code and message
if ODIR is empty after the 'git format-patch' call (that is expected
to generate the cover-letter and patches).

Signed-off-by: Petter Mabäcker <petter@technux.se>
---
 scripts/create-pull-request | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 19ba588..a3744cc 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -185,6 +185,14 @@ fi
 # Generate the patches and cover letter
 git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null
 
+if [ -z "$(ls -A $ODIR 2> /dev/null)" ]; then
+    echo "ERROR: $ODIR is empty, no cover letter and patches was generated!"
+    echo "       This is most likely due to that \$RRELATIVE_TO..\$COMMIT_ID"
+    echo "       ($RELATIVE_TO..$COMMIT_ID) don't contain any differences."
+    rmdir $ODIR
+    exit 1
+fi
+
 [ -n "$RELDIR" ] && cd $pdir
 
 # Customize the cover letter
-- 
1.9.1



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

end of thread, other threads:[~2015-11-24 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24 12:45 [PATCH 0/1] create-pull-request: handle empty ODIR Petter Mabäcker
2015-11-24 12:45 ` [PATCH 1/1] " Petter Mabäcker

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.