git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Makefile: track TCLTK_PATH as it used to be tracked
@ 2012-12-18 14:57 Christian Couder
  2012-12-18 17:07 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Couder @ 2012-12-18 14:57 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git, Junio C Hamano

A long time ago, gitk used to live at the root of the git.git
repository. In 62ba514 (Move gitk to its own subdirectory,
2007-11-17) it was moved to a subdirectory, but some code used
to track TCLTK_PATH was left in the main Makefile instead
of being moved to the new Makefile that was created in gitk-git/.

The code left in the main Makefile in git.git should now have
been removed because it was found useless.

And this patch puts some code back to track TCLTK_PATH properly
where it should be.

Note that there is already some code to do that in git-gui.

At the same time this patch creates a .gitignore and also marks
some targets in the Makefile as PHONY.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
Hi Paul,

In this thread:

http://thread.gmane.org/gmane.comp.version-control.git/211641

Junio asked me to send you this patch.
So here it is, for you to apply to your tree.

Thanks,
Christian.

 .gitignore |  2 ++
 Makefile   | 16 ++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d7ebcaf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/GIT-TCLTK-VARS
+/gitk-wish
diff --git a/Makefile b/Makefile
index e1b6045..5acdc90 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,16 @@ DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 bindir_SQ = $(subst ','\'',$(bindir))
 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
 
+### Detect Tck/Tk interpreter path changes
+TRACK_TCLTK = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')
+
+GIT-TCLTK-VARS: FORCE
+	@VARS='$(TRACK_TCLTK)'; \
+		if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
+			echo 1>&2 "    * new Tcl/Tk interpreter location"; \
+			echo "$$VARS" >$@; \
+		fi
+
 ## po-file creation rules
 XGETTEXT   ?= xgettext
 ifdef NO_MSGFMT
@@ -49,9 +59,9 @@ uninstall::
 	$(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
 
 clean::
-	$(RM) gitk-wish po/*.msg
+	$(RM) gitk-wish po/*.msg GIT-TCLTK-VARS
 
-gitk-wish: gitk
+gitk-wish: gitk GIT-TCLTK-VARS
 	$(QUIET_GEN)$(RM) $@ $@+ && \
 	sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
 	chmod +x $@+ && \
@@ -65,3 +75,5 @@ $(ALL_MSGFILES): %.msg : %.po
 	@echo Generating catalog $@
 	$(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
 
+.PHONY: all install uninstall clean update-po
+.PHONY: FORCE
-- 
1.8.1.rc1.2.g8740035

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

* Re: [PATCH] Makefile: track TCLTK_PATH as it used to be tracked
  2012-12-18 14:57 Christian Couder
@ 2012-12-18 17:07 ` Junio C Hamano
  2012-12-18 18:23   ` Christian Couder
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-12-18 17:07 UTC (permalink / raw)
  To: Christian Couder; +Cc: Paul Mackerras, git

Christian Couder <chriscool@tuxfamily.org> writes:

> A long time ago, gitk used to live at the root of the git.git
> repository. In 62ba514 (Move gitk to its own subdirectory,
> 2007-11-17) it was moved to a subdirectory, but some code used
> to track TCLTK_PATH was left in the main Makefile instead
> of being moved to the new Makefile that was created in gitk-git/.
>
> The code left in the main Makefile in git.git should now have
> been removed because it was found useless.
>
> And this patch puts some code back to track TCLTK_PATH properly
> where it should be.

It is more like "should have been moved to gitk's Makefile back
then, but didn't.  Make it so.".

>
> Note that there is already some code to do that in git-gui.
>
> At the same time this patch creates a .gitignore and also marks
> some targets in the Makefile as PHONY.
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
> Hi Paul,
>
> In this thread:
>
> http://thread.gmane.org/gmane.comp.version-control.git/211641
>
> Junio asked me to send you this patch.
> So here it is, for you to apply to your tree.

Paul, just to clarify, I didn't review the contents of the patch; I
merely redirected the patch in the right direction, so this still
needs to be vetted by you ;-)

> ...
> +GIT-TCLTK-VARS: FORCE
> +	@VARS='$(TRACK_TCLTK)'; \
> +		if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
> +			echo 1>&2 "    * new Tcl/Tk interpreter location"; \

I think in a related patch to the top-level Makefile changes it to
lose "1" to read it as "echo >&2" here.

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

* Re: [PATCH] Makefile: track TCLTK_PATH as it used to be tracked
  2012-12-18 17:07 ` Junio C Hamano
@ 2012-12-18 18:23   ` Christian Couder
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Couder @ 2012-12-18 18:23 UTC (permalink / raw)
  To: gitster; +Cc: paulus, git

From: Junio C Hamano <gitster@pobox.com>

> Christian Couder <chriscool@tuxfamily.org> writes:
> 
>> ...
>> +GIT-TCLTK-VARS: FORCE
>> +	@VARS='$(TRACK_TCLTK)'; \
>> +		if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
>> +			echo 1>&2 "    * new Tcl/Tk interpreter location"; \
> 
> I think in a related patch to the top-level Makefile changes it to
> lose "1" to read it as "echo >&2" here.

Yeah, I forgot to remove the 1 here.

Thanks,
Christian.

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

* [PATCH] Makefile: track TCLTK_PATH as it used to be tracked
@ 2013-01-09 16:55 Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2013-01-09 16:55 UTC (permalink / raw)
  To: paulus; +Cc: git, Christian Couder

From: Christian Couder <chriscool@tuxfamily.org>

gitk, when bound into the git.git project tree, used to live at the
root level, but in 62ba514 (Move gitk to its own subdirectory,
2007-11-17) it was moved to a subdirectory.  The code used to track
changes to TCLTK_PATH (which should cause gitk to be rebuilt to
point at the new interpreter) was left in the main Makefile instead
of being moved to the new Makefile that was created for the gitk
project.

Also add .gitignore file to list build artifacts for the gitk
project.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 Paul, this is relative to the tip of your tree, 386befb (gitk:
 Display important heads even when there are many, 2013-01-02).
 Could you consider applying it?

 Also I notice that you have many patches I still do not have
 there, and I'd appreciate a "Go ahead and pull from me!".

 Thanks.

 .gitignore |  2 ++
 Makefile   | 16 ++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d7ebcaf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/GIT-TCLTK-VARS
+/gitk-wish
diff --git a/Makefile b/Makefile
index e1b6045..5acdc90 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,16 @@ DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 bindir_SQ = $(subst ','\'',$(bindir))
 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
 
+### Detect Tck/Tk interpreter path changes
+TRACK_TCLTK = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')
+
+GIT-TCLTK-VARS: FORCE
+	@VARS='$(TRACK_TCLTK)'; \
+		if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
+			echo 1>&2 "    * new Tcl/Tk interpreter location"; \
+			echo "$$VARS" >$@; \
+		fi
+
 ## po-file creation rules
 XGETTEXT   ?= xgettext
 ifdef NO_MSGFMT
@@ -49,9 +59,9 @@ uninstall::
 	$(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
 
 clean::
-	$(RM) gitk-wish po/*.msg
+	$(RM) gitk-wish po/*.msg GIT-TCLTK-VARS
 
-gitk-wish: gitk
+gitk-wish: gitk GIT-TCLTK-VARS
 	$(QUIET_GEN)$(RM) $@ $@+ && \
 	sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
 	chmod +x $@+ && \
@@ -65,3 +75,5 @@ $(ALL_MSGFILES): %.msg : %.po
 	@echo Generating catalog $@
 	$(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
 
+.PHONY: all install uninstall clean update-po
+.PHONY: FORCE
-- 
1.8.1.336.g866ceff

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

end of thread, other threads:[~2013-01-09 16:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-09 16:55 [PATCH] Makefile: track TCLTK_PATH as it used to be tracked Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2012-12-18 14:57 Christian Couder
2012-12-18 17:07 ` Junio C Hamano
2012-12-18 18:23   ` Christian Couder

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).