Skip to content

feat(add): add glob expansion to filepath#1717

Open
PouyaEsmaili wants to merge 2 commits into
isomorphic-git:mainfrom
web-programming-fall-2022:git-add-with-pattern
Open

feat(add): add glob expansion to filepath#1717
PouyaEsmaili wants to merge 2 commits into
isomorphic-git:mainfrom
web-programming-fall-2022:git-add-with-pattern

Conversation

@PouyaEsmaili

Copy link
Copy Markdown

resoloves #763

@jcubic

jcubic commented Jan 15, 2023

Copy link
Copy Markdown
Member

I don't think that using filepath for a pattern is a good idea. Also, the tests are failing.

I would use the pattern option and when used the filepath should be ignored. @mojavelinux
What do you think?

@mojavelinux

Copy link
Copy Markdown
Contributor

In canonical git, the primary argument to git add (and similar commands) is called a pathspec. And a pathspec does accept wildcard characters.

If we are concerned about a breaking change, we could consider introducing pathspec as an alternative to filepath. That would a) align with canonical git and b) not impact any existing users.

I think if we are going to support wildcards, we should consider using a pattern matching library rather than trying to implement the logic within isomorphic-git. Though, there are benefits of doing it without an additional dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants