{"thread":{"id":"43943","subject":"[PATCH] make dist: allow using an installed version of git","startedAt":"2016-08-27T10:29:43Z","lastAt":"2016-09-01T21:28:38Z","messageCount":3,"participants":["Dennis Kaarsemaker","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"300331","messageId":"20160827102929.GA11769@hurricane","threadId":"43943","inReplyTo":null,"subject":"[PATCH] make dist: allow using an installed version of git","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2016-08-27T10:29:33Z","receivedAt":"2016-08-27T10:29:43Z","isPatch":true,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"b1de9de2 back in 2005 ensured that we could create a tarball with 'make\ndist' even if git wasn't installed yet. These days however, chances are\nhigher that a git version is available. Add a config.mak knob to allow\npeople to choose to use the installed version of git to create the\ntarball and avoid the overhead of building git-archive.\n\nSigned-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>\n---\n Makefile | 14 ++++++++++++--\n 1 file changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d96ecb7..3dabb75 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -378,6 +378,9 @@ all::\n #\n # to say \"export LESS=FRX (and LV=-c) if the environment variable\n # LESS (and LV) is not set, respectively\".\n+#\n+# Define USE_INSTALLED_GIT_ARCHIVE if you don't want to build git-archive as\n+# part of 'make dist', but are happy to rely on a git version on you $PATH\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n@@ -2423,8 +2426,15 @@ quick-install-html:\n ### Maintainer's dist rules\n \n GIT_TARNAME = git-$(GIT_VERSION)\n-dist: git-archive$(X) configure\n-\t./git-archive --format=tar \\\n+ifndef USE_INSTALLED_GIT_ARCHIVE\n+\tGIT_ARCHIVE = ./git-archive$(X)\n+\tGIT_ARCHIVE_DEP = git-archive$(X)\n+else\n+\tGIT_ARCHIVE = git archive\n+\tGIT_ARCHIVE_DEP =\n+endif\n+dist: $(GIT_ARCHIVE_DEP) configure\n+\t$(GIT_ARCHIVE) --format=tar \\\n \t\t--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar\n \t@mkdir -p $(GIT_TARNAME)\n \t@cp configure $(GIT_TARNAME)\n-- \n2.10.0-rc1-230-g8efea0f\n"},{"id":"300826","messageId":"xmqq4m5zy0qd.fsf@gitster.mtv.corp.google.com","threadId":"43943","inReplyTo":"20160827102929.GA11769@hurricane","subject":"Re: [PATCH] make dist: allow using an installed version of git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-01T17:43:38Z","receivedAt":"2016-09-01T21:00:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:\n\n> b1de9de2 back in 2005 ensured that we could create a tarball with 'make\n> dist' even if git wasn't installed yet. These days however, chances are\n> higher that a git version is available. Add a config.mak knob to allow\n> people to choose to use the installed version of git to create the\n> tarball and avoid the overhead of building git-archive.\n\nThanks, but not interested.\n\nWe do not know what vintage of \"git\" happens to be installed on the\nplatform, but we know how \"git archive\" we ship with the source\nought to behave.\n\n>\n> Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>\n> ---\n>  Makefile | 14 ++++++++++++--\n>  1 file changed, 12 insertions(+), 2 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index d96ecb7..3dabb75 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -378,6 +378,9 @@ all::\n>  #\n>  # to say \"export LESS=FRX (and LV=-c) if the environment variable\n>  # LESS (and LV) is not set, respectively\".\n> +#\n> +# Define USE_INSTALLED_GIT_ARCHIVE if you don't want to build git-archive as\n> +# part of 'make dist', but are happy to rely on a git version on you $PATH\n>  \n>  GIT-VERSION-FILE: FORCE\n>  \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n> @@ -2423,8 +2426,15 @@ quick-install-html:\n>  ### Maintainer's dist rules\n>  \n>  GIT_TARNAME = git-$(GIT_VERSION)\n> -dist: git-archive$(X) configure\n> -\t./git-archive --format=tar \\\n> +ifndef USE_INSTALLED_GIT_ARCHIVE\n> +\tGIT_ARCHIVE = ./git-archive$(X)\n> +\tGIT_ARCHIVE_DEP = git-archive$(X)\n> +else\n> +\tGIT_ARCHIVE = git archive\n> +\tGIT_ARCHIVE_DEP =\n> +endif\n> +dist: $(GIT_ARCHIVE_DEP) configure\n> +\t$(GIT_ARCHIVE) --format=tar \\\n>  \t\t--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar\n>  \t@mkdir -p $(GIT_TARNAME)\n>  \t@cp configure $(GIT_TARNAME)\n"},{"id":"300840","messageId":"1472762079.4680.44.camel@kaarsemaker.net","threadId":"43943","inReplyTo":"xmqq4m5zy0qd.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] make dist: allow using an installed version of git","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2016-09-01T20:34:39Z","receivedAt":"2016-09-01T21:28:38Z","isPatch":true,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"On do, 2016-09-01 at 10:43 -0700, Junio C Hamano wrote:\n> Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:\n> \n> > b1de9de2 back in 2005 ensured that we could create a tarball with 'make\n> > dist' even if git wasn't installed yet. These days however, chances are\n> > higher that a git version is available. Add a config.mak knob to allow\n> > people to choose to use the installed version of git to create the\n> > tarball and avoid the overhead of building git-archive.\n> \n> Thanks, but not interested.\n\nPity. Would save me quite a bit of tarball build time.\n\n> We do not know what vintage of \"git\" happens to be installed on the\n> platform, but we know how \"git archive\" we ship with the source\n> ought to behave.\n\nThat's why I didn't want to make it the default, but merely make it an\navailable option for saving some build time for people who know their\ngit is up-to-date enough.\n\nD.\n"}]}