[csw-devel] SF.net SVN: gar:[10314] csw/mgar/gar/v2/gar.mk
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Fri Jun 25 01:34:47 CEST 2010
Revision: 10314
http://gar.svn.sourceforge.net/gar/?rev=10314&view=rev
Author: bdwalton
Date: 2010-06-24 23:34:47 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
gar/v2: change pre-extract-git-commit to set default values for name/email instead of griping and bailing out
Modified Paths:
--------------
csw/mgar/gar/v2/gar.mk
Modified: csw/mgar/gar/v2/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk 2010-06-24 16:11:15 UTC (rev 10313)
+++ csw/mgar/gar/v2/gar.mk 2010-06-24 23:34:47 UTC (rev 10314)
@@ -395,35 +395,24 @@
pre-extract-modulated pre-extract-$(MODULATION) $(EXTRACT_TARGETS) $(if $(filter global,$(MODULATION)),,post-extract-gitsnap) post-extract-$(MODULATION) post-extract-modulated
@$(DONADA)
+# This target ensures that the values used by git when making a commit
+# are more sane than they _could_ otherwise be by taking the hostname
+# to build the email address used. If you want to submit patches with
+# an alternate email address, use git config yourself to override the
+# values.
pre-extract-git-check:
- @( if [ ! -f $(HOME)/.gitconfig ]; then \
- name=`getent passwd $$USER | awk -F: '{print $$5}'`; \
- echo "===================================================="; \
- echo "You need to create a basic ~/.gitconfig."; \
- echo "Try: "; \
- echo " git config --global user.email $$USER at opencsw.org"; \
- echo " git config --global user.name \"$$name\""; \
- echo "===================================================="; \
- exit 1; \
- else \
- g_email=`git config --global user.email`; \
- g_name=`git config --global user.name`; \
- email=$$USER at opencsw.org; \
- name=`getent passwd $$USER | awk -F: '{print $$5}'`; \
- if [ -z "$$g_email" ]; then \
- echo "==================================================="; \
- echo "Your ~/.gitconfig doesn't define user.email. Try:"; \
- echo " git config --global user.email $$email"; \
- echo "==================================================="; \
- exit 1; \
- elif [ -z "$$g_name" ]; then \
- echo "==================================================="; \
- echo "Your ~/.gitconfig doesn't define user.name. Try:"; \
- echo " git config --global user.name '$$name'"; \
- echo "==================================================="; \
- exit 1; \
- fi; \
- fi )
+ @( g_email=`git config --global user.email`; \
+ g_name=`git config --global user.name`; \
+ email=$$USER at opencsw.org; \
+ name=`getent passwd $$USER | awk -F: '{print $$5}'`; \
+ if [ -z "$$g_email" ]; then \
+ echo "Setting User Email value to: $$email"; \
+ git config --global user.email "$$email"; \
+ fi; \
+ if [ -z "$$g_name" ]; then \
+ echo "Setting User Name value to: $$name"; \
+ git config --global user.name "$$name"; \
+ fi )
@$(MAKECOOKIE)
post-extract-gitsnap: $(EXTRACT_TARGETS)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list