Skip to contentSkip to conversation

kbuild: incremental tags updating with GNU GLOBAL

PATCH In review Víctor Manuel Jáquez Leal 2 participants 5 messages Jul 11, 2011 – Jul 25, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: incremental tags updating with GNU GLOBAL

Instead of generating the tag database each time the target is ran, is better just update incrementally the database. It will expend less time.

---
 scripts/tags.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
scripts/tags.sh +5 -1
index 75c5d24..6a2fedc 100755
@@ -116,7 +116,11 @@ docscope()
 
 dogtags()
 {
-	all_sources | gtags -f -
+	if global -p; then
+		global -u
+	else
+		all_sources | gtags -f -
+	fi
 }
 
 exuberant()
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 13 lines · Víctor Manuel Jáquez Leal

Instead of generating the tag database each time the target is ran, is better just update incrementally the database. It will expend less time.

---
  scripts/tags.sh |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)
scripts/tags.sh +0 -0
index 75c5d24..6a2fedc 100755

scripts/tags.sh docscope() · line 123

Quoted 9 lines
scripts/tags.sh +5 -1
@@ -116,7 +116,11 @@ docscope()
 
  dogtags()
  {
-	all_sources | gtags -f -
+	if global -p; then
+		global -u
+	else
+		all_sources | gtags -f -
+	fi

Will this handle new source files properly?

Michal

#2 lore raw
Quoted 15 lines · Michal Marek
Quoted 14 lines · Víctor Manuel Jáquez Leal

Instead of generating the tag database each time the target is ran, is better just update incrementally the database. It will expend less time.

---
 scripts/tags.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
scripts/tags.sh +0 -0
index 75c5d24..6a2fedc 100755
@@ -116,7 +116,11 @@ docscope()
 
Quoted 10 lines

scripts/tags.sh docscope() · line 123

Quoted 8 lines
scripts/tags.sh +5 -1
 dogtags()
 {
-	all_sources | gtags -f -
+	if global -p; then
+		global -u
+	else
+		all_sources | gtags -f -
+	fi

Will this handle new source files properly?

I ran a quick test and yes, it does.

vmjl

#3 lore raw
Quoted 27 lines · Víctor M. Jáquez L.
Quoted 15 lines · Michal Marek
Quoted 14 lines · Víctor Manuel Jáquez Leal

Instead of generating the tag database each time the target is ran, is better just update incrementally the database. It will expend less time.

---
 scripts/tags.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
scripts/tags.sh +0 -0
index 75c5d24..6a2fedc 100755
@@ -116,7 +116,11 @@ docscope()
 
Quoted 10 lines

scripts/tags.sh docscope() · line 123

Quoted 8 lines
scripts/tags.sh +5 -1
 dogtags()
 {
-	all_sources | gtags -f -
+	if global -p; then
+		global -u
+	else
+		all_sources | gtags -f -
+	fi

Will this handle new source files properly?

Quoted 1 line

I ran a quick test and yes, it does.

I installed global and tried it myself:
1) The first 'make gtags' run prints a rather confusing message (fixable)

 $ make gtags
   GEN     gtags
   global: GTAGS not found.
 $
2) A second run indexes the _whole_ tree, including everything under
arch/. The point of the tags.sh script is that it indexes only files
relevant to the current architecture. If someone wants to index the
whole tree, they can run global directly.

Michal

#4 lore raw
Quoted 28 lines · Michal Marek
Quoted 27 lines · Víctor M. Jáquez L.
Quoted 25 lines · Michal Marek
Quoted 13 lines · Víctor Manuel Jáquez Leal

Instead of generating the tag database each time the target is ran, is better just update incrementally the database. It will expend less time.

---
 scripts/tags.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
scripts/tags.sh +0 -0
index 75c5d24..6a2fedc 100755

scripts/tags.sh docscope() · line 123

Quoted 9 lines
scripts/tags.sh +5 -1
@@ -116,7 +116,11 @@ docscope()
 
 dogtags()
 {
-	all_sources | gtags -f -
+	if global -p; then
+		global -u
+	else
+		all_sources | gtags -f -
+	fi

Will this handle new source files properly?

Quoted 3 lines
Quoted 1 line

I ran a quick test and yes, it does.

I installed global and tried it myself:

Thanks a lot for the review and the testing!

Quoted 5 lines

1) The first 'make gtags' run prints a rather confusing message (fixable)

 $ make gtags
   GEN     gtags
   global: GTAGS not found.
 $

yep, I guess a 2>&1 > /dev/null could do it

Quoted 4 lines

2) A second run indexes the _whole_ tree, including everything under arch/. The point of the tags.sh script is that it indexes only files relevant to the current architecture. If someone wants to index the whole tree, they can run global directly.

nice catch!

Well, that makes this patch a bit pointless :(

Thanks again for the review and sorry for noise.

vmjl