{"thread":{"id":"8555","subject":"[PATCH] Avoid double-slash in path names that depend on $(sharedir).","startedAt":"2007-06-11T08:02:17Z","lastAt":"2007-06-11T09:10:47Z","messageCount":3,"participants":["Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"44702","messageId":"11815489372169-git-send-email-johannes.sixt@telecom.at","threadId":"8555","inReplyTo":null,"subject":"[PATCH] Avoid double-slash in path names that depend on $(sharedir).","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2007-06-11T08:02:17Z","receivedAt":"2007-06-11T08:02:17Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Recent git-gui has the ability to determine the location of its library\nfiles relative to the --exec-dir. Its Makefile enables this capability\ndepending on the install paths that are specified. However, without this\nfix there is an extra slash in a path specification, so that the Makefile\ndoes not recognize the equivalence of two paths that it compares.\n\nA side-effect is that all \"standard\" builds (which do not set $(sharedir)\nexplicitly) now exploit above mentioned gut-gui feature.\n\nAnother side-effect is that an ugly compiled-in double-slash in\n$(template_dir) is avoided.\n\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex af84af9..c23031c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -144,7 +144,7 @@ STRIP ?= strip\n prefix = $(HOME)\n bindir = $(prefix)/bin\n gitexecdir = $(bindir)\n-sharedir = $(prefix)/share/\n+sharedir = $(prefix)/share\n template_dir = $(sharedir)/git-core/templates/\n ifeq ($(prefix),/usr)\n sysconfdir = /etc\n-- \n1.5.2.1.120.gd732\n"},{"id":"44704","messageId":"7v645usy4c.fsf@assigned-by-dhcp.pobox.com","threadId":"8555","inReplyTo":"11815489372169-git-send-email-johannes.sixt@telecom.at","subject":"Re: [PATCH] Avoid double-slash in path names that depend on $(sharedir).","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-11T08:18:11Z","receivedAt":"2007-06-11T08:18:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <johannes.sixt@telecom.at> writes:\n\n> diff --git a/Makefile b/Makefile\n> index af84af9..c23031c 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -144,7 +144,7 @@ STRIP ?= strip\n>  prefix = $(HOME)\n>  bindir = $(prefix)/bin\n>  gitexecdir = $(bindir)\n> -sharedir = $(prefix)/share/\n> +sharedir = $(prefix)/share\n>  template_dir = $(sharedir)/git-core/templates/\n>  ifeq ($(prefix),/usr)\n>  sysconfdir = /etc\n\nThis suggests that we would also want to drop the trailing slash\nfrom template_dir, doesn't it?\n\nI took a brief look at builtin-init-db.c but it seems that the\ncode is safe with or without the trailing slash there.\n"},{"id":"44710","messageId":"466D1197.FAA7B7EE@eudaptics.com","threadId":"8555","inReplyTo":"7v645usy4c.fsf@assigned-by-dhcp.pobox.com","subject":"Re: [PATCH] Avoid double-slash in path names that depend on $(sharedir).","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-06-11T09:10:47Z","receivedAt":"2007-06-11T09:10:47Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano wrote:\n> \n> Johannes Sixt <johannes.sixt@telecom.at> writes:\n> \n> > diff --git a/Makefile b/Makefile\n> > index af84af9..c23031c 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -144,7 +144,7 @@ STRIP ?= strip\n> >  prefix = $(HOME)\n> >  bindir = $(prefix)/bin\n> >  gitexecdir = $(bindir)\n> > -sharedir = $(prefix)/share/\n> > +sharedir = $(prefix)/share\n> >  template_dir = $(sharedir)/git-core/templates/\n> >  ifeq ($(prefix),/usr)\n> >  sysconfdir = /etc\n> \n> This suggests that we would also want to drop the trailing slash\n> from template_dir, doesn't it?\n> \n> I took a brief look at builtin-init-db.c but it seems that the\n> code is safe with or without the trailing slash there.\n\nIt amounts to this on top of my other patch. It's not worth it,\nif you ask me.\n\n--- 8< ---\nFrom: Johannes Sixt <johannes.sixt@telecom.at>\nSubject: [PATCH] Remove trailing slash from $(template_dir).\n\nThis is just a consistency cleanup. sharedir is defined a line above\ntemplate_dir and doesn't have the trailing slash, either.\n\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n Makefile           |    2 +-\n builtin-init-db.c  |    2 +-\n templates/Makefile |    2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c23031c..7091a4b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -145,7 +145,7 @@ prefix = $(HOME)\n bindir = $(prefix)/bin\n gitexecdir = $(bindir)\n sharedir = $(prefix)/share\n-template_dir = $(sharedir)/git-core/templates/\n+template_dir = $(sharedir)/git-core/templates\n ifeq ($(prefix),/usr)\n sysconfdir = /etc\n else\ndiff --git a/builtin-init-db.c b/builtin-init-db.c\nindex 4df9fd0..0be2d2e 100644\n--- a/builtin-init-db.c\n+++ b/builtin-init-db.c\n@@ -7,7 +7,7 @@\n #include \"builtin.h\"\n \n #ifndef DEFAULT_GIT_TEMPLATE_DIR\n-#define DEFAULT_GIT_TEMPLATE_DIR \"/usr/share/git-core/templates/\"\n+#define DEFAULT_GIT_TEMPLATE_DIR \"/usr/share/git-core/templates\"\n #endif\n \n #ifdef NO_TRUSTABLE_FILEMODE\ndiff --git a/templates/Makefile b/templates/Makefile\nindex b8352e7..aaa39d3 100644\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -7,7 +7,7 @@ endif\n INSTALL ?= install\n TAR ?= tar\n prefix ?= $(HOME)\n-template_dir ?= $(prefix)/share/git-core/templates/\n+template_dir ?= $(prefix)/share/git-core/templates\n # DESTDIR=\n \n # Shell quote (do not use $(call) to accommodate ancient setups);\n-- \n1.5.2.1.176.g7084-dirty\n"}]}