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

run: Teach run to resolve revsets and about jobs. #2486

Merged
merged 1 commit into from
Nov 4, 2023

Conversation

PhilipMetzger
Copy link
Contributor

@PhilipMetzger PhilipMetzger commented Oct 31, 2023

This also adds jobs, the argument reading the thread count to use and shell_command.
While we're at it, make execute a no-op and teach run to resolve the passed revsets.
I also fixed my misunderstanding of Clap which makes
jj run 'echo hello world' -r 'mine() & ~origin@remote' --jobs 4 parse correctly.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

@PhilipMetzger PhilipMetzger force-pushed the push-mrzzusvxlqlt branch 2 times, most recently from 6e1977e to e7425b1 Compare October 31, 2023 21:57
Copy link
Member

@martinvonz martinvonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have the move separated from the other changes, so I didn't have to scroll back and forth to visually compared the old and new version. This is fine for this time, however.

cli/src/commands/mod.rs Outdated Show resolved Hide resolved
@arxanas
Copy link
Contributor

arxanas commented Oct 31, 2023

It's best to separate code moves from code changes where possible, because then source control (and the human readers) can track the code moves better.

@PhilipMetzger PhilipMetzger force-pushed the push-mrzzusvxlqlt branch 2 times, most recently from 8e0a4a0 to cf16ca9 Compare November 1, 2023 21:36
@PhilipMetzger PhilipMetzger changed the title commands: move cmd_run into run.rs. commands: move run into run.rs. Nov 1, 2023
cli/src/commands/run.rs Outdated Show resolved Hide resolved
cli/src/commands/run.rs Outdated Show resolved Hide resolved
@PhilipMetzger PhilipMetzger force-pushed the push-mrzzusvxlqlt branch 2 times, most recently from a50df7b to faabaee Compare November 2, 2023 19:15
@PhilipMetzger
Copy link
Contributor Author

Sorry for the many pushes on this branch, it seems that I couldn't write good commit messages yesterday.

@ilyagr ilyagr mentioned this pull request Nov 3, 2023
4 tasks
@ilyagr
Copy link
Contributor

ilyagr commented Nov 3, 2023

Sorry for the many pushes on this branch, it seems that I couldn't write good commit messages yesterday.

This is every day for me, or at least every day I have a PR :)

I hope it is OK; I'm certainly having trouble avoiding numerous pushes.

@PhilipMetzger PhilipMetzger changed the title commands: move run into run.rs. run: Teach run to resolve revsets and about jobs. Nov 3, 2023
This also adds `jobs`, the argument reading the thread count to use and `shell_command`.
While we're at it, make `execute` a no-op and teach `run` to resolve the passed revsets. 
I also fixed my misunderstanding of `Clap` which makes 
`jj run 'echo hello world' -r 'mine() & ~origin@remote' --jobs 4` parse correctly. 

Also contains a small fix in the `pre-commit` example for it.
@PhilipMetzger PhilipMetzger merged commit 8e4b6df into main Nov 4, 2023
14 checks passed
@PhilipMetzger PhilipMetzger deleted the push-mrzzusvxlqlt branch November 4, 2023 15:29
Copy link
Contributor

@arxanas arxanas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, failed to comment in time.

cli/src/commands/run.rs Show resolved Hide resolved
cli/src/commands/run.rs Show resolved Hide resolved
PhilipMetzger added a commit that referenced this pull request Nov 8, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to two, as most cheap consumer laptops
don't have four cores.

Thanks to @necaqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
PhilipMetzger added a commit that referenced this pull request Nov 8, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to two, as most cheap consumer laptops
don't have four cores.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
@PhilipMetzger PhilipMetzger mentioned this pull request Nov 8, 2023
4 tasks
PhilipMetzger added a commit that referenced this pull request Nov 8, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to two, as most cheap consumer laptops
don't have four cores.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
PhilipMetzger added a commit that referenced this pull request Nov 15, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to one, as it's user-visible configuration
which determines how many processes should run.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
PhilipMetzger added a commit that referenced this pull request Nov 15, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to one, as it's user-visible configuration
which determines how many processes should run.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
PhilipMetzger added a commit that referenced this pull request Nov 23, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to one, as it's user-visible configuration
which determines how many processes should run.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
PhilipMetzger added a commit that referenced this pull request Nov 23, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to one, as it's user-visible configuration
which determines how many processes should run.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
PhilipMetzger added a commit that referenced this pull request Nov 26, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to one, as it's user-visible configuration
which determines how many processes should run.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
PhilipMetzger added a commit that referenced this pull request Nov 26, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to one, as it's user-visible configuration
which determines how many processes should run.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
PhilipMetzger added a commit that referenced this pull request Nov 26, 2023
Adress the post-merge comments from #2486, which found a doc comment
inaccurate and to not blindly ignore `-j 0` which would've worked until now.
I've also reduced the default `jobs` size to one, as it's user-visible configuration
which determines how many processes should run.

Thanks to @necauqua the controversial `unsafe` usage was already removed.

I've omitted to change `revisions` from an Vec to a RevisonArg for the moment, 
as I will keep working on the file anyway.
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.

6 participants