{"thread":{"id":"2548","subject":"[PATCH] Add option USE_INPLACE to Makefile","startedAt":"2005-11-16T02:35:48Z","lastAt":"2005-11-16T11:04:23Z","messageCount":5,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11983","messageId":"Pine.LNX.4.63.0511160333460.15130@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2548","inReplyTo":null,"subject":"[PATCH] Add option USE_INPLACE to Makefile","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-16T02:35:48Z","receivedAt":"2005-11-16T02:35:48Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nIf you plan on adding your current working directory to your PATH, you\ncan do\n\n\tUSE_INPLACE=1 make\n\nand you no longer need to worry about setting variables like\nGIT_EXEC_PATH and GIT_PYTHON_PATH.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n Makefile |   13 +++++++++++++\n 1 files changed, 13 insertions(+), 0 deletions(-)\n\napplies-to: 66be81f4755380a7c9da56aa5fbc600565ff78a8\n07f60591a5e881b2a46885ac9b6ba61a4931ac86\ndiff --git a/Makefile b/Makefile\nindex 55f4c6b..63c524d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -50,6 +50,9 @@\n # Define USE_STDEV below if you want git to care about the underlying device\n # change being considered an inode change from the update-cache perspective.\n \n+# Define USE_INPLACE if you do not plan to install git anywhere, but rather\n+# want to add the working directory to your PATH.\n+\n GIT_VERSION = 0.99.9.GIT\n \n # CFLAGS and LDFLAGS are for the users to override from the command line.\n@@ -60,10 +63,16 @@ ALL_CFLAGS = $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n \n prefix = $(HOME)\n+ifdef USE_INPLACE\n+bindir = `pwd`\n+template_dir = `pwd`/templates\n+GIT_PYTHON_DIR = `pwd`/compat\n+else\n bindir = $(prefix)/bin\n template_dir = $(prefix)/share/git-core/templates/\n GIT_PYTHON_DIR = $(prefix)/share/git-core/python\n # DESTDIR=\n+endif\n \n CC = gcc\n AR = ar\n@@ -432,6 +441,8 @@ check:\n \n ### Installation rules\n \n+ifndef USE_INPLACE\n+\n install: $(PROGRAMS) $(SCRIPTS) git\n \t$(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(bindir))\n \t$(INSTALL) git $(PROGRAMS) $(SCRIPTS) $(call shellquote,$(DESTDIR)$(bindir))\n@@ -468,6 +479,8 @@ deb: dist\n \tdpkg-source -b $(GIT_TARNAME)\n \tcd $(GIT_TARNAME) && fakeroot debian/rules binary\n \n+endif\n+\n ### Cleaning rules\n \n clean:\n---\n0.99.9.GIT\n"},{"id":"11987","messageId":"7vmzk5cmnd.fsf@assigned-by-dhcp.cox.net","threadId":"2548","inReplyTo":"Pine.LNX.4.63.0511160333460.15130@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add option USE_INPLACE to Makefile","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-16T03:11:18Z","receivedAt":"2005-11-16T03:11:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> and you no longer need to worry about setting variables like\n> GIT_EXEC_PATH and GIT_PYTHON_PATH.\n\nI think you can already do this in the config.mak mechanism\nadded by, ... (goes and asks git-whatchanged about it),...\n*you*, no?\n\nYou know you are not installing things anyway if you do that, so\nI do not see much point hiding the install target and friends\neither.\n"},{"id":"12001","messageId":"Pine.LNX.4.63.0511160903360.16063@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2548","inReplyTo":"7vmzk5cmnd.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add option USE_INPLACE to Makefile","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-16T08:10:10Z","receivedAt":"2005-11-16T08:10:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 15 Nov 2005, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > and you no longer need to worry about setting variables like\n> > GIT_EXEC_PATH and GIT_PYTHON_PATH.\n> \n> I think you can already do this in the config.mak mechanism\n> added by, ... (goes and asks git-whatchanged about it),...\n> *you*, no?\n\nYes.\n\nBut I imagined a programmer new to git. And then I looked at the situation \nI had yesterday after pulling to 97fc6c5f.. in which I was able to build \njust fine, but calls like \"git diff\" no longer worked.\n\nNow, *I* know what I have to put into config.mak, but I would hate the \nproject if I was new to it, tried to play around with it, and nothing \nwould work in spite of being compiled with just one warning, thank you.\n\n> You know you are not installing things anyway if you do that, so\n> I do not see much point hiding the install target and friends\n> either.\n\nJust a safety measure for the price of two lines. When I check out a new \nproject, I do \"make\", play around with it, and then do \"make install\". If \nI had to set \"export USE_INPLACE=1\", \"make install\" should barf, because \nthe compiled programs are not meant to be used anywhere else.\n\nHaving said that, I probably should have called it an RFC, not a PATCH. \nSorry.\n\nCiao,\nDscho\n"},{"id":"12003","messageId":"7vpsp19eg7.fsf@assigned-by-dhcp.cox.net","threadId":"2548","inReplyTo":"Pine.LNX.4.63.0511160903360.16063@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add option USE_INPLACE to Makefile","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-16T08:36:40Z","receivedAt":"2005-11-16T08:36:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Now, *I* know what I have to put into config.mak, but I would hate the \n> project if I was new to it, tried to play around with it, and nothing \n> would work in spite of being compiled with just one warning, thank you.\n\nHmph.  That certainly sounds like what I might do.  Especially\nthe part \"play around before installing\", so I am *very*\nsympathetic.\n\nOTOH, I do not particularly want to advertise/encourage in-place\nuse.  Once you built today's git ;-), wouldn't you cd somewhere\nelse and use it for your real work?  That would mean you have\none location on your PATH that you keep the latest git build\nand I am not sure why being able to run in-place is such a big\ndeal.  Is it because $HOME is under a tight quota?\n\n> Just a safety measure for the price of two lines. When I check out a new \n> project, I do \"make\", play around with it, and then do \"make install\". If \n> I had to set \"export USE_INPLACE=1\", \"make install\" should barf, because \n> the compiled programs are not meant to be used anywhere else.\n\nOK.  That's sensible.\n"},{"id":"12009","messageId":"Pine.LNX.4.63.0511161117090.16852@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2548","inReplyTo":"7vpsp19eg7.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add option USE_INPLACE to Makefile","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-16T11:04:23Z","receivedAt":"2005-11-16T11:04:23Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 16 Nov 2005, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Now, *I* know what I have to put into config.mak, but I would hate the \n> > project if I was new to it, tried to play around with it, and nothing \n> > would work in spite of being compiled with just one warning, thank you.\n> \n> Hmph.  That certainly sounds like what I might do.  Especially\n> the part \"play around before installing\", so I am *very*\n> sympathetic.\n> \n> OTOH, I do not particularly want to advertise/encourage in-place\n> use.  Once you built today's git ;-), wouldn't you cd somewhere\n> else and use it for your real work?  That would mean you have\n> one location on your PATH that you keep the latest git build\n> and I am not sure why being able to run in-place is such a big\n> deal.  Is it because $HOME is under a tight quota?\n\nOkay. So it would be better to provide a short snippet in INSTALL which \ncan be copied into config.mak?\n\n> > Just a safety measure for the price of two lines. When I check out a new \n> > project, I do \"make\", play around with it, and then do \"make install\". If \n> > I had to set \"export USE_INPLACE=1\", \"make install\" should barf, because \n> > the compiled programs are not meant to be used anywhere else.\n> \n> OK.  That's sensible.\n\nWell, the patch was untested, and wrong (template_dir was bogus). But I \nagree that it might be a better idea to deprecate that behaviour.\n\nI *will* learn to \"make install\" after \"make\", and not spend hours just to \nfind that ./git called the old installed binaries.\n\nCiao,\nDscho\n"}]}