grv icon indicating copy to clipboard operation
grv copied to clipboard

grv seems to ignore entries with wildcards in .gitignore

Open marcelpaulo opened this issue 6 years ago • 2 comments

I've got this .gitignore:

# files directly below bk.d are output by the backup scriplets, so they don't
# need to be tracked
bk.d/*
!bk.d/*/

which is applied to this repo tree:

+paulo@monk:~/prj/s/bk$ tree
.
├── bin
│   └── bk
├── bk.d
│   ├── foto
│   │   ├── 80backup-file
│   │   └── 90check-partition
│   ├── installed_packages
│   ├── musica
│   │   ├── 10stop-quodlibet
│   │   ├── 80backup-file
│   │   └── 90check-partition
│   ├── online
│   │   ├── 10get-contacts
│   │   └── 10get-trakt-episodes
│   ├── ppas
│   ├── software_from_source
│   ├── sys
│   │   ├── 10get-installed-package
│   │   ├── 10get-ppa
│   │   ├── 10get-source-software
│   │   ├── 80backup-file
│   │   ├── 90check-partition
│   │   └── backup_rules
│   ├── video
│   │   ├── 80backup-file
│   │   └── 90check-partition
│   └── watch
│       ├── 80backup-file
│       └── 90check-partition
└── default
    └── bk

so that the directories below bk.d are tracked, but the files directly below it are not. git is parsing .gitignore correctly:

+paulo@monk:~/prj/s/bk$ git status
On branch master
nothing to commit, working tree clean

But grv doesn't seem to:

image

I'm running grv master (783dad167212e4e48724b0743496e63355ab814d) on Xubuntu 17.10 with go 1.10.

I ran grv with -logLevel DEBUG and here's the log file in case it helps. I didn't see any mention of .gitignore.

marcelpaulo avatar Apr 12 '18 00:04 marcelpaulo

Thanks for reporting this issue. GRV uses the libgit2 library to interface with a git repository. libgit2 performs all logic related to the repository including reading the .gitignore file and generating status output.

This appears to be a bug with libgit2 and I have raised libgit2/libgit2#4624 against libgit2 using the example you've provided.

rgburke avatar Apr 12 '18 22:04 rgburke

You nailed it ! Yes, of course, I could have thought that libgit2 handled all the interaction with the repository, but ... I didn't. Apologies !

marcelpaulo avatar Apr 12 '18 22:04 marcelpaulo