linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd TAGS: Fix tags to not parse .pc directory of patch
@ 2018-01-10  6:47 Steven Rostedt
  2018-01-10  8:17 ` Vladislav Valtchev
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2018-01-10  6:47 UTC (permalink / raw)
  To: linux-trace-devel, Vladislav Valtchev


[ Vlad, this patch does touch the Makefile. How will it affect you? ]

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

When working on some code, I use quilt to develop to save off patchs to push
and pop my current work. quilt will create a .pc directory to store the
original files that are being worked on. Unfortunately, the current code
that creates TAGS will decend into this directory and include it when doing
code searching via emacs or vim. If one is not careful, they can end up
editing the saved quilt original file and not the file they should be
editing.

Add a find_tag_files define that limits the scope of where TAGS will get its
code to examine.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 5871fd5..c78db04 100644
--- a/Makefile
+++ b/Makefile
@@ -537,17 +537,22 @@ show_gui_done:
 
 PHONY += show_gui_make
 
+define find_tag_files
+	find . -name '\.pc' -prune -o -name '*\.[ch]' \
+		! -name '\.#' -print
+endef
+
 tags:	force
 	$(RM) tags
-	find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px
+	$(call find_tag_files) | xargs ctags --extra=+f --c-kinds=+px
 
 TAGS:	force
 	$(RM) TAGS
-	find . -name '*.[ch]' | xargs etags
+	$(call find_tag_files) | xargs etags
 
 cscope: force
 	$(RM) cscope*
-	find . -name '*.[ch]' | cscope -b -q
+	$(call find_tag_files) | cscope -b -q
 
 PLUGINS_INSTALL = $(subst .so,.install,$(PLUGINS)) $(subst .so,.install,$(PYTHON_PLUGINS))
 
-- 
2.15.1

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

* Re: [PATCH] trace-cmd TAGS: Fix tags to not parse .pc directory of patch
  2018-01-10  6:47 [PATCH] trace-cmd TAGS: Fix tags to not parse .pc directory of patch Steven Rostedt
@ 2018-01-10  8:17 ` Vladislav Valtchev
  0 siblings, 0 replies; 2+ messages in thread
From: Vladislav Valtchev @ 2018-01-10  8:17 UTC (permalink / raw)
  To: Steven Rostedt, linux-trace-devel

On Wed, 2018-01-10 at 01:47 -0500, Steven Rostedt wrote:
> [ Vlad, this patch does touch the Makefile. How will it affect you? ]
> 

Thanks for asking, Steven.

I've applied this patch on a temp_master branch and I've tried to rebase
all of my makefile-related changes on the top of it. Fortunately we're lucky
and git's 3-way merge was able to correctly rebase everything. I've quickly
tested that the build (both in-tree and out-of-tree) continue to work.

In conclusion, no problem with this patch at all :-)

-- 
Vladislav Valtchev
VMware Open Source Technology Center

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

end of thread, other threads:[~2018-01-10  8:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10  6:47 [PATCH] trace-cmd TAGS: Fix tags to not parse .pc directory of patch Steven Rostedt
2018-01-10  8:17 ` Vladislav Valtchev

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).