After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774977 - Don't show TODO items from files outside version control
Don't show TODO items from files outside version control
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-24 02:45 UTC by Michael Catanzaro
Modified: 2017-10-13 23:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of unhelpful TODOs (75.96 KB, image/png)
2016-11-24 02:45 UTC, Michael Catanzaro
  Details
screenshot of builder 3.26 with unhelpful TODO items (57.33 KB, image/png)
2017-10-12 14:31 UTC, Germán Poo-Caamaño
  Details
vcs: add ide_vcs_path_is_ignored() (4.20 KB, patch)
2017-10-13 23:09 UTC, Christian Hergert
committed Details | Review
todo: check VCS if file is ignored (5.67 KB, patch)
2017-10-13 23:09 UTC, Christian Hergert
committed Details | Review

Description Michael Catanzaro 2016-11-24 02:45:09 UTC
Created attachment 340658 [details]
screenshot of unhelpful TODOs

Builder shows a bunch of TODO items from my configure script, written by the autoconf developers for future autoconf developers. That's not very useful! Screenshot attached.

Since Builder knows which files are under version control and which aren't, it should probably ignore unversioned files. Or check .gitignore or something (I wonder if having .gitignore generated by git.mk is tripping up Builder here?)
Comment 1 Michael Catanzaro 2016-11-24 03:05:20 UTC
I've finally noticed that the header bar says "unversioned." Why is that... it doesn't notice the .git directory...?
Comment 2 Christian Hergert 2016-11-24 03:25:53 UTC
We try to discover the .git repository based on the project file that was opened. (configure.ac for example). We walk up the file-system tree looking for .git directories.

Are you sure the git plugin was compiled? Are you running from git or Fedora packages or Flatpak?
Comment 3 Michael Catanzaro 2016-11-24 15:15:05 UTC
I'm using the Fedora package gnome-builder-3.22.1-1.fc25.

I'm not sure if I opened configure.ac as my project file. I probably didn't think to do that, I probably just selected the toplevel epiphany folder.
Comment 4 Christian Hergert 2016-11-26 01:01:10 UTC
We also look for "configure.ac" as the highest priority I believe if you provide a directory. So we *should* have opened it as an autotools project. (If not, that too is a bug).
Comment 5 Michael Catanzaro 2016-11-26 02:29:06 UTC
No, it's not being detected as an Autotools project for some reason. I deleted the project and tried to recreate it again, twice. The first time, I left the default build system "directory" selected in the bottom-right corner of the file chooser; the second time, I decided to be smarter, changed the combo to Autotools, and explicitly selected configure.ac. Even having clicked on configure.ac to create the project, the header bar still says "Epiphany / unversioned".
Comment 6 Christian Hergert 2016-11-26 04:21:31 UTC
If you run gnome-builder -vvvv do you see any warnings?

Any chance your source tree is on a non-ext4/xfs/etc file-system?
Comment 7 Michael Catanzaro 2016-11-26 13:22:27 UTC
(In reply to Christian Hergert from comment #6)
> If you run gnome-builder -vvvv do you see any warnings?

Unbelievably, it's working fine today, using the same project I created yesterday that did not work yesterday. Deleting the project and recreating it from scratch following the same steps as yesterday, even when not bothering to select configure.ac or change the dropdown to Autotools, works just fine: it filters out all the unversioned files. Perhaps it only works correctly on weekends. ;)

> Any chance your source tree is on a non-ext4/xfs/etc file-system?

No.
Comment 8 Michael Catanzaro 2016-11-26 13:26:17 UTC
(In reply to Michael Catanzaro from comment #7)
> Unbelievably, it's working fine today, using the same project I created
> yesterday that did not work yesterday.

Ah, I got a Builder 3.22.1 -> 3.22.2 update. Surely that is what fixed it.
Comment 9 Germán Poo-Caamaño 2017-10-12 14:31:58 UTC
Created attachment 361425 [details]
screenshot of builder 3.26 with unhelpful TODO items

I have been bitten by this issue using Gnome Builder 3.26 (flatpak stable).

It is a Python project using autotools (configure.ac) and git.

I ran builder as follows:

$ screenshot of unhelpful TODOs

$ flatpak run org.gnome.Builder -vvvv
11:19:57.0561                                   builder[    2]:  MESSAGE: Initializing with Gtk+ version 3.22.20.
[a bunch of messages about discovering/loading plugins, CSS]

Once I open the project, the output is as follows:

11:20:07.0501                               ide-git-vcs[   12]:    DEBUG: Discovered .git location at “file:///home/gpoo/code/prospects/2017/pybliographer/.git”
11:20:07.0501                               ide-git-vcs[   12]:    DEBUG: Discovered .git location at “file:///home/gpoo/code/prospects/2017/pybliographer/.git”
11:20:07.0503                         ide-unsaved-files[   12]:    DEBUG: Loading drafts manifest /home/gpoo/.var/app/org.gnome.Builder/data/gnome-builder/drafts/Pybliographer/manifest
11:20:07.0535                      gb-file-search-index[   12]:  MESSAGE: File index built in 0.025020 seconds.
11:20:07.0542                gbp-flatpak-pipeline-addin[    2]:  MESSAGE: Configuration is not using flatpak, ignoring pipeline
11:20:07.0621                         beautifier-config[    2]:    DEBUG: /home/gpoo/.var/app/org.gnome.Builder/config/gnome-builder/beautifier_plugin/global.ini doesn't exist
11:20:07.0622                         beautifier-config[    2]:    DEBUG: "Error opening directory '/home/gpoo/.var/app/org.gnome.Builder/config/gnome-builder/beautifier_plugin': No such file or directory"
11:20:07.0622                         beautifier-config[    2]:    DEBUG: /home/gpoo/code/prospects/2017/pybliographer/.beautifier/global.ini doesn't exist
11:20:07.0622                         beautifier-config[    2]:    DEBUG: "Error opening directory '/home/gpoo/code/prospects/2017/pybliographer/.beautifier': No such file or directory"
11:20:07.0686                   ide-subprocess-launcher[   15]:    DEBUG: Launching 'grep -A 5 -I -H -n -r -E --exclude=*.m4 --exclude=*.po --exclude-dir=.bzr --exclude-dir=.flatpak-builder --exclude-dir=.git --exclude-dir=.svn -e FIXME(:| ) -e XXX(:| ) -e TODO(:| ) -e HACK(:| ) /home/gpoo/code/prospects/2017/pybliographer' from directory '.' with environment PATH=/bin:/usr/bin HOME=/home/gpoo USER=gpoo LANG=en_CA.UTF-8 clearing parent environment
11:20:07.0727                            gbp-todo-model[   17]:    DEBUG: Located 38 TODO items in 0.0408 seconds
Comment 10 Germán Poo-Caamaño 2017-10-12 14:50:33 UTC
FWIW, the first time I opened the project, I opened the directory. In the list of projects it appears as Python and Make.

I tried opening the same project, but this time opening the configure.ac file. In the list of projects it appears as Python and Autotools.

However, the ToDo list is the same either way.
Comment 11 Christian Hergert 2017-10-13 23:09:00 UTC
Created attachment 361562 [details] [review]
vcs: add ide_vcs_path_is_ignored()

This function allows for checking if a file should be ignored
similar to ide_vcs_is_ignored(). It's purpose is to save the
caller from dealing with the burden of checking if a GFile
creation needs to be relative to the project or absolute.

It also is slightly faster in checking against known regexes
for ignored globs.
Comment 12 Christian Hergert 2017-10-13 23:09:04 UTC
Created attachment 361563 [details] [review]
todo: check VCS if file is ignored

Before adding the TODO item to the list, we want to check if it
is ignored so the user doesn't get spammed with TODO items that
are not related to their core project.

One such example would be libtool and m4 macros in autotools-
based projects.
Comment 13 Christian Hergert 2017-10-13 23:10:30 UTC
Looks like we weren't checking with the VCS when building our model of
TODO items. This adds some helper code to the VCS and checks to see if
the file is ignored when building the model.

Thanks for reporting!

Attachment 361562 [details] pushed as 257db6a - vcs: add ide_vcs_path_is_ignored()
Attachment 361563 [details] pushed as 678e315 - todo: check VCS if file is ignored