RFR: 1690: Make jcheck cli able to use conf from workspace or other commit
Zhao Song
zsong at openjdk.org
Tue Nov 29 22:08:41 UTC 2022
On Tue, 29 Nov 2022 21:56:29 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
> We need to work on the parameter names.
>
> > 2. Run jcheck on a commit or a series of commits using the .jcheck/conf in a different specified commit.
> > `git skara jcheck --specified-conf-commit <COMMIT HASH>`
>
> I would suggest `--conf-rev REV`. In Git we want to operate on revisions rather than just hashes. A REV can be at least either a hash, branch or tag.
>
> > 3. Run jcheck on a commit or a series of commits using the .jcheck/conf in my workspace.
> > `git skara jcheck --workspace-conf`
>
> Thinking on this more, we have two different possibilities, the staged file or the one in the working tree. I would suggest: `--conf-staged` and `--conf-working-tree` for those two cases.
>
> > 4. Run jcheck on a commit or a series of commits using a config file that I point to directly, that may have any name.
> > `git skara jcheck --workspace-conf --conf-file <FILENAME>`
>
> I think `--conf-file` is good, but I hope you aren't requiring `--workspace-conf` to go along with it?
>
> > 5. Run jcheck on the diff in my current workspace, either --staged or not using the .jcheck/conf in my workspace.
> > `git skara jcheck --workspace-diff`
>
> I should have been clearer in that I wanted to cover two different cases here, either working tree, or staged. I would suggest the following to match with the conf arguments: `--staged` and `--working-tree`.
>
> > 1. For point 4, "Run jcheck on a commit or a series of commits using a config file that I point to directly, that may have any name.", currently, I think in most cases it will be used with point 3. So in my implementation, user could only point a config file with any name in workspace.
>
> My intention here was that the file would be anywhere on the local filesystem. That could be in a different repository or a directory outside of the repository.
>
> > If needed, I can make user be able to point any file in any commit as the configuration file.
>
> No, I don't think we need to be able to treat any historic file as the `.jcheck/conf` file. I don't see a usecase for that.
>
> > 2. For point 5, to run jcheck on the diff in workspace, I don't have some good ideas. So I just commit the changes temporarily and then reset the head after running jcheck. But it will make user's staged changes to be unstaged.
>
> That's not an acceptable solution. I realize that this will likely require some more involved changes to Jcheck itself. If you can't figure it out, better leave this feature out. I will go take a look and see if I can figure something out.
Thanks for making it clear! I will try my best to fix the problems.
-------------
PR: https://git.openjdk.org/skara/pull/1428
More information about the skara-dev
mailing list