Replace the confusing --work-dir option by two options (that actually work)#156
Replace the confusing --work-dir option by two options (that actually work)#156dscho merged 2 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom
--work-dir option by two options (that actually work)#156Conversation
b88c97c to
8d1ea5c
Compare
|
I feel really bad about this. I actually prefer the change you made earlier which did not change the purpose of If you prefer this change, I can approve but I suspect the other change was your original intention. |
From my analysis, it looks as if |
Argh. I managed to forget about #140, where you suggested to make it do something: to set the GitGitGadget working directory. So now I understand why we need this working directory: to be able to find Given that we need to pass two working directories to @webstech what do you think about this idea? |
The code is expecting to run in a GitGitGadget working directory. I think that is okay.
What is being passed as |
The `gggConfig` attribute does not, in fact, point to the config, but to a directory where to look for the Git config containing the GitGitGadget-related settings. Let's reflect that by renaming the attribute so that it says "Dir". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
8d1ea5c to
58de669
Compare
--work-dir _actually_ do something--work-dir option by two options (that actually work)
|
@webstech I rebased this on top of your PR that I just merged, reworked the patch substantially, and updated the PR's description. Could you have another look, please? |
webstech
left a comment
There was a problem hiding this comment.
Thanks. This is much clearer and more usable for testing.
Can you explain the rational for specifying commander.gitgitgadgetWorkDir || "." on line 53 versus defaulting the value in commander? I see similar code in git.ts with workDir?: string that could be workDir = "*". Just trying to understand since I am more inclined to code defaults.
Thanks for clarifying the variable meanings in ci-helper.ts. ;-)
First of all, this fixes the bug where passing `--work-dir` to the script does exactly nothing at all. Further, the option name was outright confusing: GitGitGadget accesses _two_ worktrees, the git.git clone (needed to interact with the commits and the notes stored at https://github.com/gitgitgadget/git) and the GitGitGadget worktree that is expected to contain a Git config with further information (and it also contains the `res/WELCOME.md` message we show new users). The confusion was pointed out by Chris Webster in gitgitgadget#148 (comment) Let's replace the `--work-dir` option by two options: --git-work-dir: This points to the git.git working directory to work with (it can actually be a bare clone, it does not require a worktree at all). --gitgitgadget-work-dri: This option points to the worktree to use for the `CIHelper`: it contains the `res/WELCOME.md` file we show to prospective GitGitGadget users, and it also contains the Git config where we store settings such as the SMTP configuration for sending the patch series to the Git mailing list. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
58de669 to
0142722
Compare
The explanation is simple: I am not really used to concept of default values in Typescript ;-) I just fixed the |
|
@webstech thank you for your patient reviews! |
--work-dirdid not actually do anything.Besides, we need two options, one to override the current working directory as the one to be used as GitGitGadget worktree, and one to override the config setting in that worktree that points to the git.git working directory.
This PR makes it so. It is based on #165.