Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: revset language or similar for other config values #4606

Open
stacyharper opened this issue Oct 8, 2024 · 4 comments
Open

FR: revset language or similar for other config values #4606

stacyharper opened this issue Oct 8, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@stacyharper
Copy link

Is your feature request related to a problem? Please describe.

I'd like to be able to configure some git config values with more flexibility, or fallbacks. Ex:

[git]
push = 'perso | origin | upstream'
fetch = 'all:matching(perso, origin, upstream)'

And I'd need for this to works even if some of the remote does not exists.

It looks like most of the revset possibilities are restricted to specific config keys. It is possible to expand this to other configs?

Describe the solution you'd like

Being able to write most config values with a gramar similar to the revset one.

Describe alternatives you've considered

Additional context

@yuja
Copy link
Collaborator

yuja commented Oct 8, 2024

Just to be sure, git.push/fetch don't specify revisions but remote names, so they can't be revsets.

Perhaps, git.fetch can be extended to string patterns. Currently it only supports string or a list of strings. git.push could be the same, but we'll need to add support for multiple remotes first.
https://martinvonz.github.io/jj/latest/revsets/#string-patterns

@stacyharper
Copy link
Author

stacyharper commented Oct 8, 2024

Just to be sure, git.push/fetch don't specify revisions but remote names, so they can't be revsets.

Yes, I meant something similar to the grammar language we can use for revsets arguments.

Perhaps, git.fetch can be extended to string patterns. Currently it only supports string or a list of strings. git.push could be the same, but we'll need to add support for multiple remotes first.
https://martinvonz.github.io/jj/latest/revsets/#string-patterns

You means regex:"perso|origin|upstream" could do what I need?

edit: It's okay if git.push still need to resolve to one unique remote for now to me.

@yuja
Copy link
Collaborator

yuja commented Oct 8, 2024

You means regex:"perso|origin|upstream" could do what I need?

Yes. There's an idea to add logical operators to string patterns, but that will be a bigger change.

@PhilipMetzger PhilipMetzger added the enhancement New feature or request label Oct 8, 2024
@PhilipMetzger
Copy link
Collaborator

Only semi-related but I think #3262 also needs a mention here, since some parts of the conversation there could also belong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants