-
Notifications
You must be signed in to change notification settings - Fork 382
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: Is it possible to make the auto anonymous working copy commit optional and configurable? #2358
Comments
Welp, the skip^n mgr said if you commit credential to the repo, then you are not eligible for promotion in the next fiscal year 😅. As jj and git branchless have already automated many process, the subtractive part is extremely suspicious to me. |
Did you considering trying jj in a throw-away clone of your repo? Besides the risk of persisting credentials, is your main concern that you'll be wasting disk space? To answer your question directly: I don't think it makes much sense to add a config option. That would be equivalent to having a config option to git that prevented committing. I.e., you would have a read-only repo then. |
I mean, I want to jj new ...
# edit <some file>
jj add <some file> # update the current commit manually,
# this effectively disable the anonymous working copy commit completely,
# and leave it to user. Whether updating the current commit or a staging area is an open question.
# no split needed, move on Manually add file to the commit I am working on, instead of automatical updating. jj new
# edit <some file> and the working copy is tracked automatically
jj split ... # and then move on
not main concern, but disk space wasting is definitly a thing. |
You can emulate the git workflow by replacing |
More precisely speaking, it is not about reverting to the git workflow and staging area, it is about additive vs subtractive. How to achieve the additive workflow is another question. And the title is misleading. With additive workflow, I selectively add my change to the repo. The unfinished files and dirty working directory is not managed by jj. With substractive workflow. I selectively pick my change from the managed working copy commit with |
This is morally the equivalent, I guess, of running The additive-vs-subtractive metaphor is helpful, but there are more subtle consequences to the "snapshot" model we use today that go beyond simple workflow changes. There are large design ramifications. For instance, in your example, what if you ran Effectively, this re-introduces the concept of the "working copy" as a distinct object from a "commit" in the data model. But the snapshot model we use today instead makes these equivalent, so that the working copy is just a commit; we consider that a good thing! Overall, many operations that would leave the tree in potentially "unsafe" or indeterminate states with other tools are trivially safe with
FWIW, this is definitely a huge problem. :) The biggest problem with this is that:
I don't know what to think about number 2, but number 1 is definitely something that people are aware of, though a tracked issue to implement oplog gc currently escapes me and might not be filed. But it's been discussed in relatively recent memory... |
As @thoughtpolice said, it'd be a huge change to allow a dirty working copy, and it would add a lot of complications that we have avoided by letting the working copy be represented by a commit. So I'm going to close this issue as infeasible. The GC issue is #12, btw.
I think there may be less difference between the workflows than you think. I actually don't agree with the "additive vs subtractive" distinction. Whether you use |
Is your feature request related to a problem? Please describe.
Currently the working copy will be automatically committed to an anonymous commit, this is drastically different from git workflow. With jj, it becomes a subtractive process on making commit, wheraes the git one is additive.
Describe the solution you'd like
Make it configurable.
Additional context
This create some friction of my adopting jj. Before I fully evaluate it, I don't want to fully commit to it yet. I am currently using git-branchless and it works like a charm, and I heard that jj provides some advance feature, I want to give it a try, but just I don't want to change my workflow.
The text was updated successfully, but these errors were encountered: