{"thread":{"id":"37365","subject":"Running make in contrib/subtree does not create executable","startedAt":"2014-08-17T06:49:49Z","lastAt":"2014-08-17T07:07:32Z","messageCount":2,"participants":["Jack Nagel","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"247798","messageId":"CAMYxyaVrknapiF6L3Lnf5U59h7RCUY8qhYtipZp5P0k3Y1tCxg@mail.gmail.com","threadId":"37365","inReplyTo":null,"subject":"Running make in contrib/subtree does not create executable","fromName":"Jack Nagel","fromEmail":"jacknagel@gmail.com","sentAt":"2014-08-17T06:49:49Z","receivedAt":"2014-08-17T06:49:49Z","isPatch":false,"sender":{"key":"jacknagel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/568243?v=4"},"body":"Running \"make\" in contrib/subtree no longer creates the git-subtree executable:\n\n$ git describe\nv2.1.0\n$ make -C contrib/subtree\n/Library/Developer/CommandLineTools/usr/bin/make -C ../../ GIT-VERSION-FILE\nGIT_VERSION = 2.1.0\nmake[1]: `GIT-VERSION-FILE' is up to date.\n/Library/Developer/CommandLineTools/usr/bin/make -C ../../ GIT-VERSION-FILE\nmake[1]: `GIT-VERSION-FILE' is up to date.\nmake: `../../GIT-VERSION-FILE' is up to date.\n$ ls contrib/subtree/git-subtree\nls: contrib/subtree/git-subtree: No such file or directory\n\nThe change appears to be inadvertent. I bisected it to\n8e2a5ccad11bc21eb72499133bc884024e299983 (\"contrib/subtree/Makefile:\nuse GIT-VERSION-FILE\").\n\nThis was reproduced on OS X 10.9 with GNU make 3.81.\n\n-Jack\n"},{"id":"247799","messageId":"20140817070732.GA23808@peff.net","threadId":"37365","inReplyTo":"CAMYxyaVrknapiF6L3Lnf5U59h7RCUY8qhYtipZp5P0k3Y1tCxg@mail.gmail.com","subject":"[PATCH] subtree: make \"all\" default target of Makefile","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-08-17T07:07:32Z","receivedAt":"2014-08-17T07:07:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"You should be able to run \"make\" in contrib/subtree with no\narguments and get the \"all\" target. This was broken by\n8e2a5cc (contrib/subtree/Makefile: use GIT-VERSION-FILE,\n2014-05-06), which put the rule for GIT-VERSION-FILE higher\nin the file.\n\nWe can fix this by putting an empty \"all::\" target at the\ntop of the file. That fixes this instance and future-proofs\nagainst it happening again.\n\nReported-by: Jack Nagel <jacknagel@gmail.com>\nSigned-off-by: Jeff King <peff@peff.net>\n---\nOn Sun, Aug 17, 2014 at 01:49:49AM -0500, Jack Nagel wrote:\n\n> $ make -C contrib/subtree\n> /Library/Developer/CommandLineTools/usr/bin/make -C ../../ GIT-VERSION-FILE\n> GIT_VERSION = 2.1.0\n> make[1]: `GIT-VERSION-FILE' is up to date.\n> /Library/Developer/CommandLineTools/usr/bin/make -C ../../ GIT-VERSION-FILE\n> make[1]: `GIT-VERSION-FILE' is up to date.\n> make: `../../GIT-VERSION-FILE' is up to date.\n> $ ls contrib/subtree/git-subtree\n> ls: contrib/subtree/git-subtree: No such file or directory\n\nThanks for a clear report. The patch below should fix it. This is the\nsame trick we use in the top-level Makefile. I notice we don't use it in\nt/Makefile or Documentation/Makefile, though. Maybe we should.\n\nI also notice that GIT-VERSION-FILE is included first in the top-level\nMakefile, but in contrib/subtree/Makefile it comes after we include\nconfig.mak and friends. I wonder if that would ever matter. I can see\nsomebody adjusting their config.mak based on the git version, but it's\nprobably not likely. It would only be used by somebody who compiles\nhistorical git versions a lot (i.e., git devs). And it would require\nusing make's \"simply expanded variables\", since regular variables aren't\nexpanded until point of use. So it seems unlikely that anybody cares.\n\n contrib/subtree/Makefile | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile\nindex d9a0ce2..8deffad 100644\n--- a/contrib/subtree/Makefile\n+++ b/contrib/subtree/Makefile\n@@ -1,3 +1,5 @@\n+all::\n+\n -include ../../config.mak.autogen\n -include ../../config.mak\n \n@@ -34,7 +36,7 @@ GIT_SUBTREE_XML := git-subtree.xml\n GIT_SUBTREE_TXT := git-subtree.txt\n GIT_SUBTREE_HTML := git-subtree.html\n \n-all: $(GIT_SUBTREE)\n+all:: $(GIT_SUBTREE)\n \n $(GIT_SUBTREE): $(GIT_SUBTREE_SH)\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' $< >$@\n-- \n2.1.0.344.gf63f03f\n"}]}