git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/1 v2] add PAGER_ENV to build

From
EWEric Wong <e@80x24.org>
Date
Aug 1, 2016, 21:49 UTC
Message-ID
<20160801214937.4752-1-e@80x24.org>
In-Reply-To
<20160801010557.22191-1-e@80x24.org>
Changes from v1:
* dropped stringify macro in favor for quoting in Makefile
  (diff below)
  I'm not sure I like this change, and might be inclined to
  go in the opposite direction of using the stringify macro
  more widely to simplify the Makefile; but that is a separate
  topic.
* dropped 2/2, I don't have a good rationale for it, either,
  other than "it seemed easy" after 1/2 :>
The following changes since commit f8f7adce9fc50a11a764d57815602dcb818d1816:
  Sync with maint (2016-07-28 14:21:18 -0700)
are available in the git repository at:
  git://bogomips.org/git-svn.git pager-env-v2
for you to fetch changes up to d3aed319c9abac006060bc81e865c93ff8363066:
  pager: move pager-specific setup into the build (2016-08-01 21:46:25 +0000)
----------------------------------------------------------------
Junio C Hamano (1):
      pager: move pager-specific setup into the build
 Makefile         | 20 +++++++++++++++++++-
 config.mak.uname |  1 +
 git-sh-setup.sh  |  8 +++++---
 pager.c          | 29 +++++++++++++++++++++++++----
 4 files changed, 50 insertions(+), 8 deletions(-)
interdiff from 1/1 v1:
diff --git a/Makefile b/Makefile
index fe469a6..0b36b5e 100644
--- a/Makefile
+++ b/Makefile
@@ -1591,7 +1591,6 @@ PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
 DIFF_SQ = $(subst ','\'',$(DIFF))
 PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA))
-PAGER_ENV_SQ = $(subst ','\'',$(PAGER_ENV))
 
 # We must filter out any object files from $(GITLIBS),
 # as it is typically used like:
@@ -1604,7 +1603,7 @@ PAGER_ENV_SQ = $(subst ','\'',$(PAGER_ENV))
 LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS)
 
 BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
-	$(COMPAT_CFLAGS) -DPAGER_ENV='$(PAGER_ENV_SQ)'
+	$(COMPAT_CFLAGS)
 LIB_OBJS += $(COMPAT_OBJS)
 
 # Quote for C
@@ -1642,6 +1641,10 @@ ifdef DEFAULT_HELP_FORMAT
 BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"'
 endif
 
+PAGER_ENV_CQ = "$(subst ",\",$(subst \,\\,$(PAGER_ENV)))"
+PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ))
+BASIC_CFLAGS += -DPAGER_ENV='$(PAGER_ENV_CQ_SQ)'
+
 ALL_CFLAGS += $(BASIC_CFLAGS)
 ALL_LDFLAGS += $(BASIC_LDFLAGS)
 
diff --git a/pager.c b/pager.c
index 2f2cadc..cd1ac54 100644
--- a/pager.c
+++ b/pager.c
@@ -63,12 +63,9 @@ const char *git_pager(int stdout_is_tty)
 	return pager;
 }
 
-#define stringify_(x) #x
-#define stringify(x) stringify_(x)
-
 static void setup_pager_env(struct argv_array *env)
 {
-	const char *pager_env = stringify(PAGER_ENV);
+	const char *pager_env = PAGER_ENV;
 
 	while (*pager_env) {
 		struct strbuf buf = STRBUF_INIT;
-- 
EW
Previous: Jeff KingNext: Eric Wong
Message 15 of 32 in “add PAGER_ENV to build and core.pagerEnv to config”
  1. 0/2 add PAGER_ENV to build and core.pagerEnv to configEric Wong, Aug 1, 2016
  2. 1/2 pager: move pager-specific setup into the buildEric Wong, Aug 1, 2016
  3. brian m. carlsonAug 1, 2016
  4. Eric WongAug 1, 2016
  5. Jakub NarębskiAug 1, 2016
  6. brian m. carlsonAug 1, 2016
  7. Jeff KingAug 1, 2016
  8. Junio C HamanoAug 1, 2016
  9. Duy NguyenAug 1, 2016
  10. Jeff KingAug 1, 2016
  11. Duy NguyenAug 1, 2016
  12. Jeff KingAug 1, 2016
  13. 2/2 pager: implement core.pagerEnv in configEric Wong, Aug 1, 2016
  14. Jeff KingAug 1, 2016
  15. 0/1 add PAGER_ENV to buildEric Wong, Aug 1, 2016
  16. 1/1 pager: move pager-specific setup into the buildEric Wong, Aug 1, 2016
  17. Junio C HamanoAug 1, 2016
  18. Jeff KingAug 1, 2016
  19. Junio C HamanoAug 2, 2016
  20. Eric WongAug 1, 2016
  21. Junio C HamanoAug 2, 2016
  22. Jeff KingAug 3, 2016
  23. Junio C HamanoAug 3, 2016
  24. Eric WongAug 3, 2016
  25. Junio C HamanoAug 3, 2016
  26. pager: move pager-specific setup into the buildEric Wong, Aug 4, 2016
  27. Jeff KingAug 4, 2016
  28. Eric WongAug 4, 2016
  29. Jeff KingAug 4, 2016
  30. pager: move pager-specific setup into the buildEric Wong, Aug 4, 2016
  31. Jeff KingAug 3, 2016
  32. Jeff KingAug 1, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.