pygit2 icon indicating copy to clipboard operation
pygit2 copied to clipboard

Please add flags argument to `Index.add_all` function.

Open sergey-komissarov opened this issue 2 years ago • 1 comments

Hello,

Sometimes I have to add directories matched with .gitignore to repository. libgit2 function git_index_add_all have force flag for this. But pygit2 does not have argument for flags. Is it possible to add such argument in future releases?

sergey-komissarov avatar Mar 31 '23 11:03 sergey-komissarov

Seconding this, as the design decision to exclude flags feels like it must have been intentional, and I'd love to understand the rationale at the very least.

@sergey-komissarov as a workaround, it appears that index.add(explicit_file_path) ignores .gitignore-matches, so you can always manually iterate through all the files in those directories.

That would work for me as well except I potentially want to force-add patterns, and I'm still suffering from the trauma of figuring out the OS-specific nuances of fnmatch to want to reverse-engineer a glob-based solution of my own.

OpenBagTwo avatar Jun 26 '23 21:06 OpenBagTwo