{"thread":{"id":"27208","subject":"[PATCH] Respect definition of prefix from autotools in ETC_GITCONFIG and ETC_GITATTRIBUTES","startedAt":"2011-04-28T02:29:23Z","lastAt":"2011-05-27T08:17:48Z","messageCount":26,"participants":["Kacper Kornet","Junio C Hamano","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"166593","messageId":"20110428022922.GC4833@camk.edu.pl","threadId":"27208","inReplyTo":null,"subject":"[PATCH] Respect definition of prefix from autotools in ETC_GITCONFIG and ETC_GITATTRIBUTES","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-04-28T02:29:23Z","receivedAt":"2011-04-28T02:29:23Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"Definitions of ETC_GITCONFIG and ETC_GITATTRIBUTES depend on value of\nprefix. As prefix can be changed in config.mak.autogen, all if blocks\nwith conditions based on prefix should be placed after the file is\nincluded in Makefile.\n\nSigned-off-by: Kacper Kornet <draenog@pld-linux.org>\n---\n Makefile |   13 ++++++-------\n 1 files changed, 6 insertions(+), 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex cbc3fce..5b4ae40 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -291,15 +291,8 @@ sharedir = $(prefix)/share\n gitwebdir = $(sharedir)/gitweb\n template_dir = share/git-core/templates\n htmldir = share/doc/git-doc\n-ifeq ($(prefix),/usr)\n-sysconfdir = /etc\n ETC_GITCONFIG = $(sysconfdir)/gitconfig\n ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes\n-else\n-sysconfdir = $(prefix)/etc\n-ETC_GITCONFIG = etc/gitconfig\n-ETC_GITATTRIBUTES = etc/gitattributes\n-endif\n lib = lib\n # DESTDIR=\n pathsep = :\n@@ -1192,6 +1185,12 @@ endif\n -include config.mak.autogen\n -include config.mak\n \n+ifeq ($(prefix),/usr)\n+sysconfdir = /etc\n+else\n+sysconfdir = etc\n+endif\n+\n ifdef CHECK_HEADER_DEPENDENCIES\n COMPUTE_HEADER_DEPENDENCIES =\n USE_COMPUTED_HEADER_DEPENDENCIES =\n-- \n1.7.5\n\n-- \n  Kacper Kornet\n"},{"id":"166658","messageId":"7v62py5nbp.fsf@alter.siamese.dyndns.org","threadId":"27208","inReplyTo":"20110428022922.GC4833@camk.edu.pl","subject":"Re: [PATCH] Respect definition of prefix from autotools in ETC_GITCONFIG and ETC_GITATTRIBUTES","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-28T16:54:02Z","receivedAt":"2011-04-28T16:54:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kacper Kornet <kornet@camk.edu.pl> writes:\n\n> Definitions of ETC_GITCONFIG and ETC_GITATTRIBUTES depend on value of\n> prefix. As prefix can be changed in config.mak.autogen, all if blocks\n> with conditions based on prefix should be placed after the file is\n> included in Makefile.\n\nThis is _not_ just about autogen, is it?  The same issue exists if the\nuser wants to manually tweak prefix in config.mak, no?\n\nIf so, perhaps the patch needs to be retitled to avoid confusion,\nsomething like:\n\n    Subject: Honor $(prefix) set in config.mak* when defining ETC_GIT* variables\n\n> diff --git a/Makefile b/Makefile\n> index cbc3fce..5b4ae40 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -291,15 +291,8 @@ sharedir = $(prefix)/share\n>  gitwebdir = $(sharedir)/gitweb\n>  template_dir = share/git-core/templates\n>  htmldir = share/doc/git-doc\n> -ifeq ($(prefix),/usr)\n> -sysconfdir = /etc\n>  ETC_GITCONFIG = $(sysconfdir)/gitconfig\n>  ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes\n> -else\n> -sysconfdir = $(prefix)/etc\n> -ETC_GITCONFIG = etc/gitconfig\n> -ETC_GITATTRIBUTES = etc/gitattributes\n> -endif\n>  lib = lib\n>  # DESTDIR=\n>  pathsep = :\n> @@ -1192,6 +1185,12 @@ endif\n>  -include config.mak.autogen\n>  -include config.mak\n>  \n> +ifeq ($(prefix),/usr)\n> +sysconfdir = /etc\n> +else\n> +sysconfdir = etc\n> +endif\n\nIt makes sense to change the definition of ETC_GIT* variables to a form\nthat depends on a variable like your patch did, i.e.\n\n    ETC_GITCONFIG = $(some_etc_prefix)/gitconfig\n    ETC_GITATTRIBUTES = $(some_etc_prefix)/gitattributes\n\nand define that variable, whose definition depends on $(prefix), after we\nhave read config.mak* files.  So I like the general direction of this\npatch.\n\nBut this part in the Makefile outside the context of the patch bothers\nme.  It seems to imply that sysconfdir is _not_ that variable you want to\ndefine later.\n\n   # Among the variables below, these:\n   #   gitexecdir\n   #   template_dir\n   #   mandir\n   #   infodir\n   #   htmldir\n   #   ETC_GITCONFIG (but not sysconfdir)\n   #   ETC_GITATTRIBUTES\n   # can be specified as a relative path some/where/else;\n\nSo I have a suspicion that your patch as is will break when prefix is set\nto something other than /usr directory.  I don't think anybody in-tree\ncurrently uses sysconfdir, but that does not mean nobody will ever do.\n"},{"id":"166661","messageId":"20110428174935.GD4833@camk.edu.pl","threadId":"27208","inReplyTo":"7v62py5nbp.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Respect definition of prefix from autotools in ETC_GITCONFIG and ETC_GITATTRIBUTES","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-04-28T17:49:36Z","receivedAt":"2011-04-28T17:49:36Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On Thu, Apr 28, 2011 at 09:54:02AM -0700, Junio C Hamano wrote:\n> Kacper Kornet <kornet@camk.edu.pl> writes:\n\n> > Definitions of ETC_GITCONFIG and ETC_GITATTRIBUTES depend on value of\n> > prefix. As prefix can be changed in config.mak.autogen, all if blocks\n> > with conditions based on prefix should be placed after the file is\n> > included in Makefile.\n\n> This is _not_ just about autogen, is it?  The same issue exists if the\n> user wants to manually tweak prefix in config.mak, no?\n\n> If so, perhaps the patch needs to be retitled to avoid confusion,\n> something like:\n\n>     Subject: Honor $(prefix) set in config.mak* when defining ETC_GIT* variables\n\nYou are right.\n\n> > diff --git a/Makefile b/Makefile\n> > index cbc3fce..5b4ae40 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -291,15 +291,8 @@ sharedir = $(prefix)/share\n> >  gitwebdir = $(sharedir)/gitweb\n> >  template_dir = share/git-core/templates\n> >  htmldir = share/doc/git-doc\n> > -ifeq ($(prefix),/usr)\n> > -sysconfdir = /etc\n> >  ETC_GITCONFIG = $(sysconfdir)/gitconfig\n> >  ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes\n> > -else\n> > -sysconfdir = $(prefix)/etc\n> > -ETC_GITCONFIG = etc/gitconfig\n> > -ETC_GITATTRIBUTES = etc/gitattributes\n> > -endif\n> >  lib = lib\n> >  # DESTDIR=\n> >  pathsep = :\n> > @@ -1192,6 +1185,12 @@ endif\n> >  -include config.mak.autogen\n> >  -include config.mak\n\n> > +ifeq ($(prefix),/usr)\n> > +sysconfdir = /etc\n> > +else\n> > +sysconfdir = etc\n> > +endif\n\nActually I have made a mistake here. I meant the last hunk to be:\n\n@@ -1192,6 +1185,12 @@ endif\n -include config.mak.autogen\n -include config.mak\n\n+ifeq ($(prefix),/usr)\n+sysconfdir = /etc\n+else\n+sysconfdir = $(prefix)/etc\n+endif\n\n> But this part in the Makefile outside the context of the patch bothers\n> me.  It seems to imply that sysconfdir is _not_ that variable you want to\n> define later.\n\n>    # Among the variables below, these:\n>    #   gitexecdir\n>    #   template_dir\n>    #   mandir\n>    #   infodir\n>    #   htmldir\n>    #   ETC_GITCONFIG (but not sysconfdir)\n>    #   ETC_GITATTRIBUTES\n>    # can be specified as a relative path some/where/else;\n\n> So I have a suspicion that your patch as is will break when prefix is set\n> to something other than /usr directory.  I don't think anybody in-tree\n> currently uses sysconfdir, but that does not mean nobody will ever do.\n\nSee the corrected hunk above. I will be prepare the corrected patch.\n\n-- \n  Kacper Kornet\n"},{"id":"166679","messageId":"20110428192751.GE4833@camk.edu.pl","threadId":"27208","inReplyTo":"7v62py5nbp.fsf@alter.siamese.dyndns.org","subject":"[PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-04-28T19:27:51Z","receivedAt":"2011-04-28T19:27:51Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"Definitions of ETC_GITCONFIG, ETC_GITATTRIBUTES and sysconfdir depend on\nvalue of prefix. As prefix can be changed in config.mak.autogen, all if\nblocks with conditions based on prefix should be placed after the file\nis included in Makefile.\n\nSigned-off-by: Kacper Kornet <draenog@pld-linux.org>\n---\n Makefile |   19 ++++++++++---------\n 1 files changed, 10 insertions(+), 9 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex cbc3fce..bf912b9 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -291,15 +291,8 @@ sharedir = $(prefix)/share\n gitwebdir = $(sharedir)/gitweb\n template_dir = share/git-core/templates\n htmldir = share/doc/git-doc\n-ifeq ($(prefix),/usr)\n-sysconfdir = /etc\n-ETC_GITCONFIG = $(sysconfdir)/gitconfig\n-ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes\n-else\n-sysconfdir = $(prefix)/etc\n-ETC_GITCONFIG = etc/gitconfig\n-ETC_GITATTRIBUTES = etc/gitattributes\n-endif\n+ETC_GITCONFIG = $(git_etcdir)/gitconfig\n+ETC_GITATTRIBUTES = $(git_etcdir)/gitattributes\n lib = lib\n # DESTDIR=\n pathsep = :\n@@ -1192,6 +1185,14 @@ endif\n -include config.mak.autogen\n -include config.mak\n \n+ifeq ($(prefix),/usr)\n+sysconfdir = /etc\n+git_etcdir = /etc\n+else\n+sysconfdir = $(prefix)/etc\n+git_etcdir = etc\n+endif\n+\n ifdef CHECK_HEADER_DEPENDENCIES\n COMPUTE_HEADER_DEPENDENCIES =\n USE_COMPUTED_HEADER_DEPENDENCIES =\n-- \n1.7.5\n\n\n-- \n  Kacper Kornet\n"},{"id":"166681","messageId":"20110428200113.GF4833@camk.edu.pl","threadId":"27208","inReplyTo":"20110428192751.GE4833@camk.edu.pl","subject":"[PATCH] Honor sysconfdir when set as an configure option","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-04-28T20:01:13Z","receivedAt":"2011-04-28T20:01:13Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"./configure can be run with option --sysconfdir=...\nand Makefile should respect that choice.\n\nSigned-off-by: Kacper Kornet <draenog@pld-linux.org>\n---\n Makefile      |    8 ++++----\n config.mak.in |    2 ++\n 2 files changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex bf912b9..9d6cffa 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1186,11 +1186,11 @@ endif\n -include config.mak\n \n ifeq ($(prefix),/usr)\n-sysconfdir = /etc\n-git_etcdir = /etc\n+sysconfdir ?= /etc\n+git_etcdir ?= /etc\n else\n-sysconfdir = $(prefix)/etc\n-git_etcdir = etc\n+sysconfdir ?= $(prefix)/etc\n+git_etcdir ?= etc\n endif\n \n ifdef CHECK_HEADER_DEPENDENCIES\ndiff --git a/config.mak.in b/config.mak.in\nindex e378534..ac5912d 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -15,6 +15,8 @@ TCLTK_PATH = @TCLTK_PATH@\n prefix = @prefix@\n exec_prefix = @exec_prefix@\n bindir = @bindir@\n+sysconfdir = @sysconfdir@\n+git_etcdir = @sysconfdir@\n gitexecdir = @libexecdir@/git-core\n datarootdir = @datarootdir@\n template_dir = @datadir@/git-core/templates\n-- \n1.7.5\n\n-- \n  Kacper Kornet\n"},{"id":"166690","messageId":"7vzkna2ika.fsf@alter.siamese.dyndns.org","threadId":"27208","inReplyTo":"20110428200113.GF4833@camk.edu.pl","subject":"Re: [PATCH] Honor sysconfdir when set as an configure option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-28T21:05:09Z","receivedAt":"2011-04-28T21:05:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kacper Kornet <kornet@camk.edu.pl> writes:\n\n> ./configure can be run with option --sysconfdir=...\n> and Makefile should respect that choice.\n\nThanks.  That statement is not wrong per-se, but your patch will result in\ngit_etcdir always set to the same as $(sysconfdir) that is an absolute\npath, which in turn would mean that the build product with prefix set to\nsomething other than /usr won't relocate well, no?\n\nNot that I personally deeply care about it, but I understand msysgit folks\nspent considerable amount of brainpower to come up with the arrangement,\nso they may want to have a say on this patch.\n\n\"git shortlog -n --no-merges --grep=msys --grep=Win -- Makefile\" tells\nme that Steffen Prohaska and J6t are the people to whom I need to Cc:\nthis.\n\n>  ifeq ($(prefix),/usr)\n> -sysconfdir = /etc\n> -git_etcdir = /etc\n> +sysconfdir ?= /etc\n> +git_etcdir ?= /etc\n>  else\n> -sysconfdir = $(prefix)/etc\n> -git_etcdir = etc\n> +sysconfdir ?= $(prefix)/etc\n> +git_etcdir ?= etc\n>  endif\n>  \n>  ifdef CHECK_HEADER_DEPENDENCIES\n> diff --git a/config.mak.in b/config.mak.in\n> index e378534..ac5912d 100644\n> --- a/config.mak.in\n> +++ b/config.mak.in\n> @@ -15,6 +15,8 @@ TCLTK_PATH = @TCLTK_PATH@\n>  prefix = @prefix@\n>  exec_prefix = @exec_prefix@\n>  bindir = @bindir@\n> +sysconfdir = @sysconfdir@\n> +git_etcdir = @sysconfdir@\n>  gitexecdir = @libexecdir@/git-core\n>  datarootdir = @datarootdir@\n>  template_dir = @datadir@/git-core/templates\n> -- \n> 1.7.5\n"},{"id":"166691","messageId":"20110428212218.GG4833@camk.edu.pl","threadId":"27208","inReplyTo":"7vzkna2ika.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Honor sysconfdir when set as an configure option","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-04-28T21:22:18Z","receivedAt":"2011-04-28T21:22:18Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On Thu, Apr 28, 2011 at 02:05:09PM -0700, Junio C Hamano wrote:\n> Kacper Kornet <kornet@camk.edu.pl> writes:\n\n> > ./configure can be run with option --sysconfdir=...\n> > and Makefile should respect that choice.\n\n> Thanks.  That statement is not wrong per-se, but your patch will result in\n> git_etcdir always set to the same as $(sysconfdir) that is an absolute\n> path, which in turn would mean that the build product with prefix set to\n> something other than /usr won't relocate well, no?\n\nOnly when ./configure is used. But autotools do not support relative\npaths, as far as I know. When autotools are not used, it is still\npossible to have relative path in git_etcdir.\n\n-- \n  Kacper Kornet\n"},{"id":"166923","messageId":"4DBFA3C6.8060209@viscovery.net","threadId":"27208","inReplyTo":"20110428192751.GE4833@camk.edu.pl","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-03T06:42:14Z","receivedAt":"2011-05-03T06:42:14Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Please do not set Mail-Followup-To!! It makes communication on this list\nextremely inconvenient.\n\nAm 4/28/2011 21:27, schrieb Kacper Kornet:\n> Definitions of ETC_GITCONFIG, ETC_GITATTRIBUTES and sysconfdir depend on\n> value of prefix. As prefix can be changed in config.mak.autogen, all if\n> blocks with conditions based on prefix should be placed after the file\n> is included in Makefile.\n> \n> Signed-off-by: Kacper Kornet <draenog@pld-linux.org>\n> ---\n>  Makefile |   19 ++++++++++---------\n>  1 files changed, 10 insertions(+), 9 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index cbc3fce..bf912b9 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -291,15 +291,8 @@ sharedir = $(prefix)/share\n>  gitwebdir = $(sharedir)/gitweb\n>  template_dir = share/git-core/templates\n>  htmldir = share/doc/git-doc\n> -ifeq ($(prefix),/usr)\n> -sysconfdir = /etc\n> -ETC_GITCONFIG = $(sysconfdir)/gitconfig\n> -ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes\n> -else\n> -sysconfdir = $(prefix)/etc\n> -ETC_GITCONFIG = etc/gitconfig\n> -ETC_GITATTRIBUTES = etc/gitattributes\n> -endif\n> +ETC_GITCONFIG = $(git_etcdir)/gitconfig\n> +ETC_GITATTRIBUTES = $(git_etcdir)/gitattributes\n>  lib = lib\n>  # DESTDIR=\n>  pathsep = :\n> @@ -1192,6 +1185,14 @@ endif\n>  -include config.mak.autogen\n>  -include config.mak\n>  \n> +ifeq ($(prefix),/usr)\n> +sysconfdir = /etc\n> +git_etcdir = /etc\n> +else\n> +sysconfdir = $(prefix)/etc\n> +git_etcdir = etc\n> +endif\n> +\n>  ifdef CHECK_HEADER_DEPENDENCIES\n>  COMPUTE_HEADER_DEPENDENCIES =\n>  USE_COMPUTED_HEADER_DEPENDENCIES =\n\nDoes this patch do anything useful? After the patch is applied, sysconfdir\nis set-but-not-used. Therefore, you can remove the assignments. But then\nyou lose the reference to $(prefix) that the commit message claims is so\nimportant. Puzzled...\n\n-- Hannes\n"},{"id":"166949","messageId":"7vzkn3itb5.fsf@alter.siamese.dyndns.org","threadId":"27208","inReplyTo":"4DBFA3C6.8060209@viscovery.net","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-03T17:32:14Z","receivedAt":"2011-05-03T17:32:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Please do not set Mail-Followup-To!! It makes communication on this list\n> extremely inconvenient.\n>\n> Am 4/28/2011 21:27, schrieb Kacper Kornet:\n>> Definitions of ETC_GITCONFIG, ETC_GITATTRIBUTES and sysconfdir depend on\n>> value of prefix. As prefix can be changed in config.mak.autogen, all if\n>> blocks with conditions based on prefix should be placed after the file\n>> is included in Makefile.\n> ...\n> Does this patch do anything useful? After the patch is applied, sysconfdir\n> is set-but-not-used. Therefore, you can remove the assignments. But then\n> you lose the reference to $(prefix) that the commit message claims is so\n> important. Puzzled...\n\nThe only thing it does is to to allow you to set prefix in config.mak and\nthen have it propaget to the selection of ETC_GITCONFIG (if prefix is /usr,\nthen it is always /etc/gitconfig, otherwise it is always etc/gitconfig).\nThe importance of prefix is not that the value is prefixed to ETC_GIT*,\nbut it is used in the conditional to choose between the two.\n\nWe can get rid of assignments to sysconfdir in that sense. But you spotted\na regression. If sysconfdir is set to somewhere else, even if you set prefix\nto /usr, we should set ETC_GIT* using the value given to sysconfdir.  The\noriginal code did so, but the patch lost it.\n"},{"id":"166992","messageId":"4DC0E99E.6090402@viscovery.net","threadId":"27208","inReplyTo":"7vzkn3itb5.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-04T05:52:30Z","receivedAt":"2011-05-04T05:52:30Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/3/2011 19:32, schrieb Junio C Hamano:\n> Johannes Sixt <j.sixt@viscovery.net> writes:\n> \n>> Please do not set Mail-Followup-To!! It makes communication on this list\n>> extremely inconvenient.\n>>\n>> Am 4/28/2011 21:27, schrieb Kacper Kornet:\n>>> Definitions of ETC_GITCONFIG, ETC_GITATTRIBUTES and sysconfdir depend on\n>>> value of prefix. As prefix can be changed in config.mak.autogen, all if\n>>> blocks with conditions based on prefix should be placed after the file\n>>> is included in Makefile.\n>> ...\n>> Does this patch do anything useful? After the patch is applied, sysconfdir\n>> is set-but-not-used. Therefore, you can remove the assignments. But then\n>> you lose the reference to $(prefix) that the commit message claims is so\n>> important. Puzzled...\n> \n> The only thing it does is to to allow you to set prefix in config.mak and\n> then have it propaget to the selection of ETC_GITCONFIG (if prefix is /usr,\n> then it is always /etc/gitconfig, otherwise it is always etc/gitconfig).\n> The importance of prefix is not that the value is prefixed to ETC_GIT*,\n> but it is used in the conditional to choose between the two.\n\nFair enough.\n\n> We can get rid of assignments to sysconfdir in that sense. But you spotted\n> a regression. If sysconfdir is set to somewhere else, even if you set prefix\n> to /usr, we should set ETC_GIT* using the value given to sysconfdir.  The\n> original code did so, but the patch lost it.\n\nLooking closer, the patch introduces git_etcdir for no good reason, IIUC.\nIt should just re-use sysconfdir (the meaning of this variable is to point\nto the etc directory).\n\n-- Hannes\n"},{"id":"167020","messageId":"20110504135827.GC18585@camk.edu.pl","threadId":"27208","inReplyTo":"4DC0E99E.6090402@viscovery.net","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-05-04T13:58:27Z","receivedAt":"2011-05-04T13:58:27Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On Wed, May 04, 2011 at 07:52:30AM +0200, Johannes Sixt wrote:\n> Looking closer, the patch introduces git_etcdir for no good reason,\n> IIUC.\n> It should just re-use sysconfdir (the meaning of this variable is to\n> point\n> to the etc directory).\n\nAnd the first version of my patch did it. However Junio has written:\n\n> But this part in the Makefile outside the context of the patch bothers\n> me.  It seems to imply that sysconfdir is _not_ that variable you want\n> to\n> define later.\n>\n>    # Among the variables below, these:\n>    #   gitexecdir\n>    #   template_dir\n>    #   mandir\n>    #   infodir\n>    #   htmldir\n>    #   ETC_GITCONFIG (but not sysconfdir)\n>    #   ETC_GITATTRIBUTES\n>    # can be specified as a relative path some/where/else;\n>\n> So I have a suspicion that your patch as is will break when prefix is\n> set\n> to something other than /usr directory.  I don't think anybody in-tree\n> currently uses sysconfdir, but that does not mean nobody will ever do.\n\n>From that I understood that he prefers sysconfdir to be always an\nabsolute path.\n-- \n  Kacper Kornet\n"},{"id":"167021","messageId":"20110504142921.GE18585@camk.edu.pl","threadId":"27208","inReplyTo":"7vzkn3itb5.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-05-04T14:29:21Z","receivedAt":"2011-05-04T14:29:21Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On Tue, May 03, 2011 at 10:32:14AM -0700, Junio C Hamano wrote:\n> We can get rid of assignments to sysconfdir in that sense. But you spotted\n> a regression. If sysconfdir is set to somewhere else, even if you set prefix\n> to /usr, we should set ETC_GIT* using the value given to sysconfdir.  The\n> original code did so, but the patch lost it.\n\nActually syconfdir was respected only when prefix was /usr. When it was\nnot /usr, ETC_GIT* were always set to etc/... The following version of\npatch reproduces that behaviour:\n\n>From 1a438bc0ac71a96398260b73b3c24c5e752a02f5 Mon Sep 17 00:00:00 2001\nFrom: Kacper Kornet <draenog@pld-linux.org>\nDate: Thu, 28 Apr 2011 02:42:48 +0100\nSubject: [PATCH] Honor $(prefix) set in config.mak* when defining ETC_GIT*\n and sysconfdir\n\nDefinitions of ETC_GITCONFIG, ETC_GITATTRIBUTES and sysconfdir depend on\nvalue of prefix. As prefix can be changed in config.mak.autogen, all if\nblocks with conditions based on prefix should be placed after the file\nis included in Makefile.\n\nSigned-off-by: Kacper Kornet <draenog@pld-linux.org>\n---\n Makefile |   19 ++++++++++---------\n 1 files changed, 10 insertions(+), 9 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex cbc3fce..31b558e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -291,15 +291,8 @@ sharedir = $(prefix)/share\n gitwebdir = $(sharedir)/gitweb\n template_dir = share/git-core/templates\n htmldir = share/doc/git-doc\n-ifeq ($(prefix),/usr)\n-sysconfdir = /etc\n-ETC_GITCONFIG = $(sysconfdir)/gitconfig\n-ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes\n-else\n-sysconfdir = $(prefix)/etc\n-ETC_GITCONFIG = etc/gitconfig\n-ETC_GITATTRIBUTES = etc/gitattributes\n-endif\n+ETC_GITCONFIG = $(git_etcdir)/gitconfig\n+ETC_GITATTRIBUTES = $(git_etcdir)/gitattributes\n lib = lib\n # DESTDIR=\n pathsep = :\n@@ -1192,6 +1185,14 @@ endif\n -include config.mak.autogen\n -include config.mak\n \n+ifeq ($(prefix),/usr)\n+sysconfdir = /etc\n+git_etcdir = $(sysconfdir)\n+else\n+sysconfdir = $(prefix)/etc\n+git_etcdir = etc\n+endif\n+\n ifdef CHECK_HEADER_DEPENDENCIES\n COMPUTE_HEADER_DEPENDENCIES =\n USE_COMPUTED_HEADER_DEPENDENCIES =\n-- \n1.7.5\n\n-- \n  Kacper Kornet\n"},{"id":"167022","messageId":"4DC1653A.7000000@viscovery.net","threadId":"27208","inReplyTo":"20110504135827.GC18585@camk.edu.pl","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-04T14:39:54Z","receivedAt":"2011-05-04T14:39:54Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/4/2011 15:58, schrieb Kacper Kornet:\n> On Wed, May 04, 2011 at 07:52:30AM +0200, Johannes Sixt wrote:\n>> Looking closer, the patch introduces git_etcdir for no good reason,\n>> IIUC.\n>> It should just re-use sysconfdir (the meaning of this variable is to\n>> point\n>> to the etc directory).\n> \n> And the first version of my patch did it. However Junio has written:\n> \n>> But this part in the Makefile outside the context of the patch bothers\n>> me.  It seems to imply that sysconfdir is _not_ that variable you want\n>> to\n>> define later.\n>>\n>>    # Among the variables below, these:\n>>    #   gitexecdir\n>>    #   template_dir\n>>    #   mandir\n>>    #   infodir\n>>    #   htmldir\n>>    #   ETC_GITCONFIG (but not sysconfdir)\n>>    #   ETC_GITATTRIBUTES\n>>    # can be specified as a relative path some/where/else;\n>>\n>> So I have a suspicion that your patch as is will break when prefix is\n>> set\n>> to something other than /usr directory.  I don't think anybody in-tree\n>> currently uses sysconfdir, but that does not mean nobody will ever do.\n> \n>>From that I understood that he prefers sysconfdir to be always an\n> absolute path.\n\nJunio's worries should not be discarded lightly. But in this case they are\nunfounded. Digging the history shows:\n\nb51b8bbf (Create a sysconfdir variable, and use it for ETC_GITCONFIG,\n2007-04-24) introduced the variable to be able to treat the special case\nwhere prefix == /usr. It was never intended as a user-settable value.\n\nIn 49fa65a7 (Allow the built-in exec path to be relative to the command\ninvocation path, 2008-07-23), I added the comment above because at that\ntime, a relocatable build should be requested by setting ETC_GITCONFIG to\na relative path, but not by changing sysconfdir. (The comment sounds as if\nthe user can set sysconfdir, but I did not intend to say that.)\n\n026fa0d5 (Move computation of absolute paths from Makefile to runtime (in\npreparation for RUNTIME_PREFIX), 2009-01-18) practically obsoleted\nsysconfdir. In particular, it removed one of the cases where the value of\nsysconfdir mattered, leaving only the reference where it is guaranteed to\nbe set to /etc. This commit could have removed sysconfdir entirely.\n\n6df42ab9 (Add global and system-wide gitattributes, 2010-09-01) added\nanother consumer of sysconfdir, but in the same spirit as ETC_GITCONFIG.\n\nSo, I don't think that sysconfdir must survive. It was always only a\nhelper variable to shorten the code.\n\n-- Hannes\n"},{"id":"167031","messageId":"7v4o5afht7.fsf@alter.siamese.dyndns.org","threadId":"27208","inReplyTo":"4DC1653A.7000000@viscovery.net","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-04T18:21:08Z","receivedAt":"2011-05-04T18:21:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Junio's worries should not be discarded lightly. But in this case they are\n> unfounded.\n\nI appreciate the analysis and explanation.  As you can see from the\nexchange, I was only basing my suggestion on the comments left in the\nMakefile by you when you did the \"relocatable installation\" topic.\n\n> So, I don't think that sysconfdir must survive. It was always only a\n> helper variable to shorten the code.\n\nMy remaining worry was if ./configure users accidentally relied on this\ninternal use of a variable whose name happens to be sysconfdir.  If so,\n\n    $ ./configure --sysconfdir=/some/where\n\nmay give them a different result once we get rid of sysconfdir from our\nMakefile.\n\nBut I notice that we do not say that sysconfdir is to be replaced in\nconfig.mak.in we ship, so such a command line option would have been\nsilently discarded anyway.  IOW, no ./configure user would have relied on\nwhat our build procedure does.\n\nBUT.\n\nThe vanilla Makefile users might have.  Among those who install with\nprefix=$HOME/git, there may be people who do not want to use $HOME/git/etc\nand an obvious way to do so is by setting sysconfdir to $HOME/etc (an\nalternative would be to set both ETC_GITCONFIG and ETC_GITATTRIBUTES).\n\nSo I think it would probably be a less-impact and useful solution to keep\nsysconfdir and add \"sysconfdir = @sysconfdir@\" to config.mak.in as well.\n\nIs Kacper's latest patch with an obvious one-liner to config.mak.in\nsufficient to achieve that?\n\n  From: Kacper Kornet <kornet@camk.edu.pl>\n  Subject: Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defin...\n  Date: Wed, 4 May 2011 16:29:21 +0200\n  Message-ID: <20110504142921.GE18585@camk.edu.pl>\n"},{"id":"167064","messageId":"7vwri5c27e.fsf@alter.siamese.dyndns.org","threadId":"27208","inReplyTo":"7v4o5afht7.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-05T02:26:29Z","receivedAt":"2011-05-05T02:26:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> So I think it would probably be a less-impact and useful solution to keep\n> sysconfdir and add \"sysconfdir = @sysconfdir@\" to config.mak.in as well.\n>\n> Is Kacper's latest patch with an obvious one-liner to config.mak.in\n> sufficient to achieve that?\n>\n>   From: Kacper Kornet <kornet@camk.edu.pl>\n>   Subject: Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defin...\n>   Date: Wed, 4 May 2011 16:29:21 +0200\n>   Message-ID: <20110504142921.GE18585@camk.edu.pl>\n\nIn other words, this one on top of the above (which defaults sysconfdir\nto /etc when $(prefix) is /usr and then sets git_etcdir to $(sysconfdir)).\n\n-- >8 --\nSubject: [PATCH] config.mak.in: allow \"configure --sysconfdir=/else/where\"\n\nWe do allow vanilla Makefile users to say make sysconfdir=/else/where\nand config.mak can also be tweaked manually for the same effect. Give\nthe same configurablity to ./configure users as well.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n config.mak.in |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/config.mak.in b/config.mak.in\nindex 9614973..dd8f274 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -18,6 +18,7 @@ bindir = @bindir@\n gitexecdir = @libexecdir@/git-core\n datarootdir = @datarootdir@\n template_dir = @datadir@/git-core/templates\n+sysconfdir = @sysconfdir@\n \n mandir=@mandir@\n \n-- \n1.7.5.1.242.g2ec223\n"},{"id":"167076","messageId":"4DC23C80.6020401@viscovery.net","threadId":"27208","inReplyTo":"7vwri5c27e.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-05T05:58:24Z","receivedAt":"2011-05-05T05:58:24Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/5/2011 4:26, schrieb Junio C Hamano:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> So I think it would probably be a less-impact and useful solution to keep\n>> sysconfdir and add \"sysconfdir = @sysconfdir@\" to config.mak.in as well.\n>>\n>> Is Kacper's latest patch with an obvious one-liner to config.mak.in\n>> sufficient to achieve that?\n>>\n>>   From: Kacper Kornet <kornet@camk.edu.pl>\n>>   Subject: Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defin...\n>>   Date: Wed, 4 May 2011 16:29:21 +0200\n>>   Message-ID: <20110504142921.GE18585@camk.edu.pl>\n> \n> In other words, this one on top of the above (which defaults sysconfdir\n> to /etc when $(prefix) is /usr and then sets git_etcdir to $(sysconfdir)).\n> \n> -- >8 --\n> Subject: [PATCH] config.mak.in: allow \"configure --sysconfdir=/else/where\"\n> \n> We do allow vanilla Makefile users to say make sysconfdir=/else/where\n> and config.mak can also be tweaked manually for the same effect. Give\n> the same configurablity to ./configure users as well.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  config.mak.in |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> \n> diff --git a/config.mak.in b/config.mak.in\n> index 9614973..dd8f274 100644\n> --- a/config.mak.in\n> +++ b/config.mak.in\n> @@ -18,6 +18,7 @@ bindir = @bindir@\n>  gitexecdir = @libexecdir@/git-core\n>  datarootdir = @datarootdir@\n>  template_dir = @datadir@/git-core/templates\n> +sysconfdir = @sysconfdir@\n>  \n>  mandir=@mandir@\n>  \n\nNo, that's not sufficient. Notice that $(sysconfdir) is used for ETC_GIT*\nvariables *only* if $(prefix) == /usr (both before and after Kacper's\npatch). Therefore, you won't gain a lot of configurability via sysconfdir;\nyou have to change ETC_GIT* variables directly.\n\nI'm not opposed to keep sysconfdir at all if it gains a useful purpose\nlike with the oneliner above. But extra work is needed in Makefile; if\nthis doesn't materialize, I suggest you back out Kacper's patch from 'next'.\n\n-- Hannes\n"},{"id":"167110","messageId":"20110505142910.GA31229@camk.edu.pl","threadId":"27208","inReplyTo":"7vwri5c27e.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-05-05T14:29:10Z","receivedAt":"2011-05-05T14:29:10Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On Wed, May 04, 2011 at 07:26:29PM -0700, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n\n> > So I think it would probably be a less-impact and useful solution to keep\n> > sysconfdir and add \"sysconfdir = @sysconfdir@\" to config.mak.in as well.\n\n> > Is Kacper's latest patch with an obvious one-liner to config.mak.in\n> > sufficient to achieve that?\n\n> >   From: Kacper Kornet <kornet@camk.edu.pl>\n> >   Subject: Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defin...\n> >   Date: Wed, 4 May 2011 16:29:21 +0200\n> >   Message-ID: <20110504142921.GE18585@camk.edu.pl>\n\n> In other words, this one on top of the above (which defaults sysconfdir\n> to /etc when $(prefix) is /usr and then sets git_etcdir to $(sysconfdir)).\n\nThere is one more problem with this. If you call:\n\n ./configure --prefix=/usr --sysconfdir=/<dir>\n\nsysconfdir and git_etcdir are set to /etc not /<dir>. I admit that it is\na rather unusual set of options ./configure, but maybe it should be\nsupported. So maybe I will first describe how it should all work in my\nopinion and I will wait for comments before I will try to implement it.\n\n1. ./configure --prefix=dir1  and dir1 != /usr\n\n    git_etcdir = etc\n\n2. ./configure --prefix=/usr\n\n    git_etcdir = /etc\n\n3. ./configure --prefix=dir1 --syscondir=dir2 (here dir2 has to be an\nabsolute path)\n\n    git_etcdir =  dir2\n\n4. make prefix=dir1 and dir1 != /usr\n\n    git_etcdir = etc\n\n5. make prefix=/usr\n\n    git_etcdir = /etc\n\n6. make prefix=dir1 sysconfdir=dir2 (here dir2 can be an absolute or\na relative path)\n\n    git_etcdir = dir2\n\n\n-- \n  Kacper Kornet\n"},{"id":"167111","messageId":"4DC2B814.5070507@viscovery.net","threadId":"27208","inReplyTo":"20110505142910.GA31229@camk.edu.pl","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-05T14:45:40Z","receivedAt":"2011-05-05T14:45:40Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"A:\n\n> 1. ./configure --prefix=dir1  and dir1 != /usr\n> \n>     git_etcdir = etc\n> \n> 2. ./configure --prefix=/usr\n> \n>     git_etcdir = /etc\n> \n> 3. ./configure --prefix=dir1 --syscondir=dir2 (here dir2 has to be an\n> absolute path)\n> \n>     git_etcdir =  dir2\n\nWhy do you have the restriction that --sysconfdir must be absolute? Is it\nimposed by autotools?\n\n  4. ./configure --sysconfdir=dir2\n\n     git_etcdir =  dir2\n\nB:\n\n> 1. make prefix=dir1 and dir1 != /usr\n> \n>     git_etcdir = etc\n> \n> 2. make prefix=/usr\n> \n>     git_etcdir = /etc\n> \n> 3. make prefix=dir1 sysconfdir=dir2 (here dir2 can be an absolute or\n> a relative path)\n> \n>     git_etcdir = dir2\n\n  4. make sysconfdir=dir2\n\n      git_etcdir = dir2\n\nC:\nin config.mak write none, one, or both of\n\n  prefix=dir1\n  sysconfdir=dir2\n\nwith the same 4 case distinctions and corresponding desired results as in B.\n\nLooks fine and simple to implement, except that I don't see that you have\nto introduce git_etcdir; can't you just stick with the name \"sysconfdir\"?\n\n-- Hannes\n"},{"id":"167112","messageId":"20110505150036.GB31229@camk.edu.pl","threadId":"27208","inReplyTo":"4DC2B814.5070507@viscovery.net","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-05-05T15:00:36Z","receivedAt":"2011-05-05T15:00:36Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On Thu, May 05, 2011 at 04:45:40PM +0200, Johannes Sixt wrote:\n> A:\n\n> > 1. ./configure --prefix=dir1  and dir1 != /usr\n\n> >     git_etcdir = etc\n\n> > 2. ./configure --prefix=/usr\n\n> >     git_etcdir = /etc\n\n> > 3. ./configure --prefix=dir1 --syscondir=dir2 (here dir2 has to be\n> > an\n> > absolute path)\n\n> >     git_etcdir =  dir2\n\n> Why do you have the restriction that --sysconfdir must be absolute? Is\n> it\n> imposed by autotools?\n\nYes, configure does not accept relative pathnames.\n\n>   4. ./configure --sysconfdir=dir2\n\n>      git_etcdir =  dir2\n\n> B:\n\n> > 1. make prefix=dir1 and dir1 != /usr\n\n> >     git_etcdir = etc\n\n> > 2. make prefix=/usr\n\n> >     git_etcdir = /etc\n\n> > 3. make prefix=dir1 sysconfdir=dir2 (here dir2 can be an absolute or\n> > a relative path)\n\n> >     git_etcdir = dir2\n\n>   4. make sysconfdir=dir2\n\n>       git_etcdir = dir2\n\n> C:\n> in config.mak write none, one, or both of\n\n>   prefix=dir1\n>   sysconfdir=dir2\n\n> with the same 4 case distinctions and corresponding desired results as\n> in B.\n\n> Looks fine and simple to implement, except that I don't see that you\n> have\n> to introduce git_etcdir; can't you just stick with the name\n> \"sysconfdir\"?\n\nI can do it, if Junio is ok with it.\n\nShould the patch be based on main or on the previous patch that was\nmerged to next?\n\n-- \n  Kacper Kornet\n"},{"id":"167114","messageId":"20110505152530.GC31229@camk.edu.pl","threadId":"27208","inReplyTo":"4DC2B814.5070507@viscovery.net","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-05-05T15:25:30Z","receivedAt":"2011-05-05T15:25:30Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On second thought, I think the point A.1 and A.2 has to be changed and\nmerged to one:\n\nOn Thu, May 05, 2011 at 04:45:40PM +0200, Johannes Sixt wrote:\n> A:\n\n> > 1. ./configure --prefix=dir1  and dir1 != /usr\n\n> >     git_etcdir = etc\n\n> > 2. ./configure --prefix=/usr\n\n> >     git_etcdir = /etc\n\n1. ./configure --prefix=dir1\n\n      git_etcdir = /dir1/etc\n\nOtherwise there would be a conflict with:\n\n./configure --help\n    --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]\n\n-- \n  Kacper Kornet\n"},{"id":"167116","messageId":"7vd3jxb16s.fsf@alter.siamese.dyndns.org","threadId":"27208","inReplyTo":"20110505150036.GB31229@camk.edu.pl","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-05T15:46:03Z","receivedAt":"2011-05-05T15:46:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kacper Kornet <kornet@camk.edu.pl> writes:\n\n> Should the patch be based on main or on the previous patch that was\n> merged to next?\n\nAfter having this much discussion, it is preferrable to have a patch\nrelative to what you have in 'next' (2910bf5) as a fix-up, explaining \"The\ninitial version does not cover these cases / has these problems\" to\nsummarize the discussion so far, followed by explanation of the\nincremental change \"Fix this and that by doing ...\".\n\nWe could revert what is in 'next' and start from scratch, but then it is\nlikely that the thought process will be lost when you write the log\nmessage.\n"},{"id":"167120","messageId":"7vy62l9l5l.fsf@alter.siamese.dyndns.org","threadId":"27208","inReplyTo":"4DC23C80.6020401@viscovery.net","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-05T16:17:42Z","receivedAt":"2011-05-05T16:17:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> No, that's not sufficient. Notice that $(sysconfdir) is used for ETC_GIT*\n> variables *only* if $(prefix) == /usr (both before and after Kacper's\n> patch). Therefore, you won't gain a lot of configurability via sysconfdir;\n> you have to change ETC_GIT* variables directly.\n\nHuh?  You lost me.\n\nThe point of this approach is to make a progress without regressing, and\nthe (minimum) progress needed to be made that comes from the beginning of\nthis discussion is that setting $(prefix) from the command line of make\nworks but it does not when it is set in config.mak (or config.mak.autogen\nwhich in turn is added by running \"./configure --prefix=...\").\n\nAs the \"relocatable installation\" topic wants to make everything relative\nto prefix, I do not know if it is even worth trying to support a build\nthat has prefix set to anything other than /usr to set ETC_GIT* variables\nto an arbitrary absolute path via --sysconfdir. I suspect that would\ndefeat the whole \"relocatable\" concept. More importantly, since I do not\ncare too much about \"relocatable\", I do not want to even have to worry\nabout it.\n\nSo the only thing my suggested approach tries to fix on top of Kacper's\npatch is not to regress use of \"sysconfdir = /some/where\" when prefix is\nset to /usr.\n\nIf you really care about being able to use sysconfdir together with the\nrelocate logic, I think you first have to rethink \"if $(prefix) == /usr\"\nand change it into a new \"RELOCATABLE_GIT = YesPlease/NoThanks\".  After\nall, even when you set prefix to /usr/local, you may want the installed\nbinaries know where to look without the \"let's find everything relative\nto /usr/local/bin/git\" logic.\n"},{"id":"167225","messageId":"4DC39D4D.1000709@viscovery.net","threadId":"27208","inReplyTo":"7vy62l9l5l.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-06T07:03:41Z","receivedAt":"2011-05-06T07:03:41Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/5/2011 18:17, schrieb Junio C Hamano:\n> The point of this approach is to make a progress without regressing, and\n> the (minimum) progress needed to be made that comes from the beginning of\n> this discussion is that setting $(prefix) from the command line of make\n> works but it does not when it is set in config.mak (or config.mak.autogen\n> which in turn is added by running \"./configure --prefix=...\").\n\nAh! That's a piece of informatin that I was missing.\n\nTo fix that, wouldn't it have been sufficient to just move the\nifeq($(prefix),/usr) conditional past -include config.mak, without any\nother changes?\n\n(But I'm mostly clueless about when which make variables from what source\noverride what.)\n\n-- Hannes\n"},{"id":"167474","messageId":"4DC7A4D7.2050401@viscovery.net","threadId":"27208","inReplyTo":"7vd3jxb16s.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-09T08:24:55Z","receivedAt":"2011-05-09T08:24:55Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/5/2011 17:46, schrieb Junio C Hamano:\n> Kacper Kornet <kornet@camk.edu.pl> writes:\n> \n>> Should the patch be based on main or on the previous patch that was\n>> merged to next?\n> \n> After having this much discussion, it is preferrable to have a patch\n> relative to what you have in 'next' (2910bf5) as a fix-up, explaining \"The\n> initial version does not cover these cases / has these problems\" to\n> summarize the discussion so far, followed by explanation of the\n> incremental change \"Fix this and that by doing ...\".\n> \n> We could revert what is in 'next' and start from scratch, but then it is\n> likely that the thought process will be lost when you write the log\n> message.\n\nI'd implement it like this, discarding Kacper's patch, but I'm not sure\nwhether the commit message summarizes the discussion sufficiently. Let me\nknow whether you want a version based on top of Kacper's patch, or how\nelse to proceed.\n\nOf your two patches regarding configure --sysconfdir, only the second\n(e8de44bc05) is needed on top of this patch.\n\n--- 8< ---\nFrom: Johannes Sixt <j6t@kdbg.org>\nSubject: [PATCH] Honor $(prefix) set in config.mak* when defining ETC_GIT*\n\nNotice that the prefix specified for the build influenced the definitions\nof ETC_GITCONFIG and ETC_GITATTRIBUTES only when it was exactly '/usr'.\nKacper Kornet noticed that this was furthermore only the case when the\nbuild was triggered using 'make prefix=/usr', i.e., the prefix was given\non the command line; it did not work when the prefix was specified in\nconfig.mak because this file is included much later in the Makefile.\n\nTo fix this, move the conditional after the inclusion of config.mak.\n\nAdditionally, it is desirable to specify the etc directory for a build\n(for example, a build with prefix /usr/local may still want to have the\nsystem configuration in /etc/gitconfig). For this purpose, promote the\nvariable 'sysconfdir' from a helper variable to a configuration\nvariable. The prefix check that was moved must now be wrapped so that it\ndoes not override sysconfdir setting given in config.mak.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n Makefile |   18 +++++++++---------\n 1 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ca4b38e..10d6bd5 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -274,8 +274,7 @@ STRIP ?= strip\n #   mandir\n #   infodir\n #   htmldir\n-#   ETC_GITCONFIG (but not sysconfdir)\n-#   ETC_GITATTRIBUTES\n+#   sysconfdir\n # can be specified as a relative path some/where/else;\n # this is interpreted as relative to $(prefix) and \"git\" at\n # runtime figures out where they are based on the path to the executable.\n@@ -291,15 +290,8 @@ sharedir = $(prefix)/share\n gitwebdir = $(sharedir)/gitweb\n template_dir = share/git-core/templates\n htmldir = share/doc/git-doc\n-ifeq ($(prefix),/usr)\n-sysconfdir = /etc\n ETC_GITCONFIG = $(sysconfdir)/gitconfig\n ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes\n-else\n-sysconfdir = $(prefix)/etc\n-ETC_GITCONFIG = etc/gitconfig\n-ETC_GITATTRIBUTES = etc/gitattributes\n-endif\n lib = lib\n # DESTDIR=\n pathsep = :\n@@ -1192,6 +1184,14 @@ endif\n -include config.mak.autogen\n -include config.mak\n \n+ifndef sysconfdir\n+ifeq ($(prefix),/usr)\n+sysconfdir = /etc\n+else\n+sysconfdir = etc\n+endif\n+endif\n+\n ifdef CHECK_HEADER_DEPENDENCIES\n COMPUTE_HEADER_DEPENDENCIES =\n USE_COMPUTED_HEADER_DEPENDENCIES =\n-- \n1.7.4.1.317.g0b25\n"},{"id":"167490","messageId":"20110509115655.GA18423@camk.edu.pl","threadId":"27208","inReplyTo":"4DC7A4D7.2050401@viscovery.net","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Kacper Kornet","fromEmail":"draenog@pld-linux.org","sentAt":"2011-05-09T11:56:55Z","receivedAt":"2011-05-09T11:56:55Z","isPatch":true,"sender":{"key":"draenog@pld-linux.org","avatar":"https://avatars.githubusercontent.com/u/608762?v=4"},"body":"On Mon, May 09, 2011 at 10:24:55AM +0200, Johannes Sixt wrote:\n> --- 8< ---\n> From: Johannes Sixt <j6t@kdbg.org>\n> Subject: [PATCH] Honor $(prefix) set in config.mak* when defining ETC_GIT*\n\n> Notice that the prefix specified for the build influenced the definitions\n> of ETC_GITCONFIG and ETC_GITATTRIBUTES only when it was exactly '/usr'.\n> Kacper Kornet noticed that this was furthermore only the case when the\n> build was triggered using 'make prefix=/usr', i.e., the prefix was given\n> on the command line; it did not work when the prefix was specified in\n> config.mak because this file is included much later in the Makefile.\n\n> To fix this, move the conditional after the inclusion of config.mak.\n\n> Additionally, it is desirable to specify the etc directory for a build\n> (for example, a build with prefix /usr/local may still want to have the\n> system configuration in /etc/gitconfig). For this purpose, promote the\n> variable 'sysconfdir' from a helper variable to a configuration\n> variable. The prefix check that was moved must now be wrapped so that it\n> does not override sysconfdir setting given in config.mak.\n\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  Makefile |   18 +++++++++---------\n>  1 files changed, 9 insertions(+), 9 deletions(-)\n\n> diff --git a/Makefile b/Makefile\n> index ca4b38e..10d6bd5 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -274,8 +274,7 @@ STRIP ?= strip\n>  #   mandir\n>  #   infodir\n>  #   htmldir\n> -#   ETC_GITCONFIG (but not sysconfdir)\n> -#   ETC_GITATTRIBUTES\n> +#   sysconfdir\n>  # can be specified as a relative path some/where/else;\n>  # this is interpreted as relative to $(prefix) and \"git\" at\n>  # runtime figures out where they are based on the path to the executable.\n> @@ -291,15 +290,8 @@ sharedir = $(prefix)/share\n>  gitwebdir = $(sharedir)/gitweb\n>  template_dir = share/git-core/templates\n>  htmldir = share/doc/git-doc\n> -ifeq ($(prefix),/usr)\n> -sysconfdir = /etc\n>  ETC_GITCONFIG = $(sysconfdir)/gitconfig\n>  ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes\n> -else\n> -sysconfdir = $(prefix)/etc\n> -ETC_GITCONFIG = etc/gitconfig\n> -ETC_GITATTRIBUTES = etc/gitattributes\n> -endif\n>  lib = lib\n>  # DESTDIR=\n>  pathsep = :\n> @@ -1192,6 +1184,14 @@ endif\n>  -include config.mak.autogen\n>  -include config.mak\n\n> +ifndef sysconfdir\n> +ifeq ($(prefix),/usr)\n> +sysconfdir = /etc\n> +else\n> +sysconfdir = etc\n> +endif\n> +endif\n> +\n>  ifdef CHECK_HEADER_DEPENDENCIES\n>  COMPUTE_HEADER_DEPENDENCIES =\n>  USE_COMPUTED_HEADER_DEPENDENCIES =\n\nFor me it looks all right. Thanks for writing the patch instead of me. \n-- \n  Kacper Kornet\n"},{"id":"168856","messageId":"20110527081747.GA7049@camk.edu.pl","threadId":"27208","inReplyTo":"4DC7A4D7.2050401@viscovery.net","subject":"Re: [PATCH 1/1] Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-05-27T08:17:48Z","receivedAt":"2011-05-27T08:17:48Z","isPatch":true,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On Mon, May 09, 2011 at 10:24:55AM +0200, Johannes Sixt wrote:\n> Am 5/5/2011 17:46, schrieb Junio C Hamano:\n> > Kacper Kornet <kornet@camk.edu.pl> writes:\n\n> >> Should the patch be based on main or on the previous patch that was\n> >> merged to next?\n\n> > After having this much discussion, it is preferrable to have a patch\n> > relative to what you have in 'next' (2910bf5) as a fix-up, explaining \"The\n> > initial version does not cover these cases / has these problems\" to\n> > summarize the discussion so far, followed by explanation of the\n> > incremental change \"Fix this and that by doing ...\".\n\n> > We could revert what is in 'next' and start from scratch, but then it is\n> > likely that the thought process will be lost when you write the log\n> > message.\n\n> I'd implement it like this, discarding Kacper's patch, but I'm not sure\n> whether the commit message summarizes the discussion sufficiently. Let me\n> know whether you want a version based on top of Kacper's patch, or how\n> else to proceed.\n\n> Of your two patches regarding configure --sysconfdir, only the second\n> (e8de44bc05) is needed on top of this patch.\n\nI'm afraid e8de44bc05 was lost somewhere, as 1.7.5.3 does not contain\nit. \n\n-- \n  Kacper Kornet\n"}]}