git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add option USE_INPLACE to Makefile
@ 2005-11-16  2:35 Johannes Schindelin
  2005-11-16  3:11 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2005-11-16  2:35 UTC (permalink / raw)
  To: git, junkio


If you plan on adding your current working directory to your PATH, you
can do

	USE_INPLACE=1 make

and you no longer need to worry about setting variables like
GIT_EXEC_PATH and GIT_PYTHON_PATH.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

 Makefile |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

applies-to: 66be81f4755380a7c9da56aa5fbc600565ff78a8
07f60591a5e881b2a46885ac9b6ba61a4931ac86
diff --git a/Makefile b/Makefile
index 55f4c6b..63c524d 100644
--- a/Makefile
+++ b/Makefile
@@ -50,6 +50,9 @@
 # Define USE_STDEV below if you want git to care about the underlying device
 # change being considered an inode change from the update-cache perspective.
 
+# Define USE_INPLACE if you do not plan to install git anywhere, but rather
+# want to add the working directory to your PATH.
+
 GIT_VERSION = 0.99.9.GIT
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
@@ -60,10 +63,16 @@ ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
 
 prefix = $(HOME)
+ifdef USE_INPLACE
+bindir = `pwd`
+template_dir = `pwd`/templates
+GIT_PYTHON_DIR = `pwd`/compat
+else
 bindir = $(prefix)/bin
 template_dir = $(prefix)/share/git-core/templates/
 GIT_PYTHON_DIR = $(prefix)/share/git-core/python
 # DESTDIR=
+endif
 
 CC = gcc
 AR = ar
@@ -432,6 +441,8 @@ check:
 
 ### Installation rules
 
+ifndef USE_INPLACE
+
 install: $(PROGRAMS) $(SCRIPTS) git
 	$(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(bindir))
 	$(INSTALL) git $(PROGRAMS) $(SCRIPTS) $(call shellquote,$(DESTDIR)$(bindir))
@@ -468,6 +479,8 @@ deb: dist
 	dpkg-source -b $(GIT_TARNAME)
 	cd $(GIT_TARNAME) && fakeroot debian/rules binary
 
+endif
+
 ### Cleaning rules
 
 clean:
---
0.99.9.GIT

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add option USE_INPLACE to Makefile
  2005-11-16  2:35 [PATCH] Add option USE_INPLACE to Makefile Johannes Schindelin
@ 2005-11-16  3:11 ` Junio C Hamano
  2005-11-16  8:10   ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2005-11-16  3:11 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> and you no longer need to worry about setting variables like
> GIT_EXEC_PATH and GIT_PYTHON_PATH.

I think you can already do this in the config.mak mechanism
added by, ... (goes and asks git-whatchanged about it),...
*you*, no?

You know you are not installing things anyway if you do that, so
I do not see much point hiding the install target and friends
either.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add option USE_INPLACE to Makefile
  2005-11-16  3:11 ` Junio C Hamano
@ 2005-11-16  8:10   ` Johannes Schindelin
  2005-11-16  8:36     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2005-11-16  8:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

On Tue, 15 Nov 2005, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > and you no longer need to worry about setting variables like
> > GIT_EXEC_PATH and GIT_PYTHON_PATH.
> 
> I think you can already do this in the config.mak mechanism
> added by, ... (goes and asks git-whatchanged about it),...
> *you*, no?

Yes.

But I imagined a programmer new to git. And then I looked at the situation 
I had yesterday after pulling to 97fc6c5f.. in which I was able to build 
just fine, but calls like "git diff" no longer worked.

Now, *I* know what I have to put into config.mak, but I would hate the 
project if I was new to it, tried to play around with it, and nothing 
would work in spite of being compiled with just one warning, thank you.

> You know you are not installing things anyway if you do that, so
> I do not see much point hiding the install target and friends
> either.

Just a safety measure for the price of two lines. When I check out a new 
project, I do "make", play around with it, and then do "make install". If 
I had to set "export USE_INPLACE=1", "make install" should barf, because 
the compiled programs are not meant to be used anywhere else.

Having said that, I probably should have called it an RFC, not a PATCH. 
Sorry.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add option USE_INPLACE to Makefile
  2005-11-16  8:10   ` Johannes Schindelin
@ 2005-11-16  8:36     ` Junio C Hamano
  2005-11-16 11:04       ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2005-11-16  8:36 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Now, *I* know what I have to put into config.mak, but I would hate the 
> project if I was new to it, tried to play around with it, and nothing 
> would work in spite of being compiled with just one warning, thank you.

Hmph.  That certainly sounds like what I might do.  Especially
the part "play around before installing", so I am *very*
sympathetic.

OTOH, I do not particularly want to advertise/encourage in-place
use.  Once you built today's git ;-), wouldn't you cd somewhere
else and use it for your real work?  That would mean you have
one location on your PATH that you keep the latest git build
and I am not sure why being able to run in-place is such a big
deal.  Is it because $HOME is under a tight quota?

> Just a safety measure for the price of two lines. When I check out a new 
> project, I do "make", play around with it, and then do "make install". If 
> I had to set "export USE_INPLACE=1", "make install" should barf, because 
> the compiled programs are not meant to be used anywhere else.

OK.  That's sensible.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add option USE_INPLACE to Makefile
  2005-11-16  8:36     ` Junio C Hamano
@ 2005-11-16 11:04       ` Johannes Schindelin
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2005-11-16 11:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

On Wed, 16 Nov 2005, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Now, *I* know what I have to put into config.mak, but I would hate the 
> > project if I was new to it, tried to play around with it, and nothing 
> > would work in spite of being compiled with just one warning, thank you.
> 
> Hmph.  That certainly sounds like what I might do.  Especially
> the part "play around before installing", so I am *very*
> sympathetic.
> 
> OTOH, I do not particularly want to advertise/encourage in-place
> use.  Once you built today's git ;-), wouldn't you cd somewhere
> else and use it for your real work?  That would mean you have
> one location on your PATH that you keep the latest git build
> and I am not sure why being able to run in-place is such a big
> deal.  Is it because $HOME is under a tight quota?

Okay. So it would be better to provide a short snippet in INSTALL which 
can be copied into config.mak?

> > Just a safety measure for the price of two lines. When I check out a new 
> > project, I do "make", play around with it, and then do "make install". If 
> > I had to set "export USE_INPLACE=1", "make install" should barf, because 
> > the compiled programs are not meant to be used anywhere else.
> 
> OK.  That's sensible.

Well, the patch was untested, and wrong (template_dir was bogus). But I 
agree that it might be a better idea to deprecate that behaviour.

I *will* learn to "make install" after "make", and not spend hours just to 
find that ./git called the old installed binaries.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-11-16 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-16  2:35 [PATCH] Add option USE_INPLACE to Makefile Johannes Schindelin
2005-11-16  3:11 ` Junio C Hamano
2005-11-16  8:10   ` Johannes Schindelin
2005-11-16  8:36     ` Junio C Hamano
2005-11-16 11:04       ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).