-
Notifications
You must be signed in to change notification settings - Fork 319
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
Docs: minor things in github.md #1989
Comments
Sorry for the late response.
The guide is written in an Git oriented way and as of Git 2.28
The command puts only a single commit on the mentioned branch.
The user is supposed to fill out the commit id, e.g the two highlighted characters in the commit id.
Yes, some rephrasing probably dropped the comment that followed.
Thats correct, it is an equivalent workflow, if you do |
So the comment could say:
OK, then the text talking about a stack of commits shouldn't be plural, or the command should push the whole stack?
Please make that clear in the text since it looks like a variable that will get filled in somehow.
So, the dot should be removed.
OK, it seems odd to me to force a net commit and then reference back one to push. I'm still not sure I understand jj. |
Correct.
The text talking about a stack is still correct, as you can push dependant commits while repeatedly creating branches. For example: $ # Hack on stuff
$ jj commit -m "Add foo"
$ jj branch create feature-foo -r @- # create branch feature-foo for "Add foo"
$ # Hack on stuff
$ jj commit -m "Add bar"
$ jj branch create foo-continued -r @- # create branch foo-continued for "Add bar"
$ jj git push # pushes both feature-foo and foo-continued, which depend on each other, a so called stack To simplify the above workflow
Is this clearer? $ jj git push --change $revision # Here $revision refers to the full commit id or the first two highlighted characters in the commit id
I'll try to explain it, with conventional VCS you either have commited work (something in a commit) and uncommited work (the working copy, which holds all uncommited work). Jujutsu turns this relationship around, as the working-copy itself is also a commit, which means that you can apply every operation which works on a commit on the working-copy. The working-copy commit is always attached to it's parent which can be any commit. So these graphs are equivalent:
If you haven't tried |
To correct myself, it puts both commits on the branch. As the difference from |
Are you going to add your new example with the two branches?
So instead of explaining it, you reinforced my view that it is odd to make a new empty commit and refer backwards to the previous one with |
No, you still are correct, jj reduces the mental load.
I probably missunderstood your question, could you rephrase it for my benefit? JJ does not force you to create a new commit, but people have it ingrained in them that they start new work with
I don't think so, it will be rather appropriate for #1960. |
This is just git brain not letting you go :) While @ is techincally indeed a "new commit", it's the new commit you're editing, it's not final and it's basically what replaces the staging area - and the parent commit is more or less "finalized" and ready to be pushed unless you edit it You can try Ok that last sentence probably really didn't help but it all will click, git model is so engrained in the brain it is indeed a bit hard for people to grasp the beauty of jjs model sadly 🤷 Also indeed Saying that, I remembered the words someone said somewhere: in git you |
THIS is the more I have to keep track of, so it is adding mental load. I have to know which commands make a new commit and which don't, as well as where my
Not. I don't have much experience with Git.
I gave an alternate example to see if it was the same thing. Other parts of the documentation stress that |
Ok, this is something actionable which I can do in the pr. The workflows are the same. To re-iterate my point, It does not matter, if a commit is created or not, it's just convenience.
Do you mean branch creation locally with |
I don't know enough to answer this, but expect the doc to lay it all out for me. Isn't there a |
I mean to do the same in git you need to checkout a new temp branch at parent commit, amend things to that commit and manually rebase the child onto it (which for some people is hard as they don't know to use very not confusingly named
Well, the main command that creates new commits is For the @ parenting - again, ..yes? Hearing that you don't have much experience with git you may have not met that much of git complications that jj solves/adjusts really well, especially those related to staging area or rebases. At least the oplog/undo is a killer feature that's kind of not really in git (reflog being the closest thing) :) Anyway my responses have been off the topic - yeah, the docs are kind of oriented more at people familiar with git and might miss some things that to us seem obvious, thanks for laying out some of them |
This is the git brain talking. Please Apply your explanation to the other part of the docs. |
I consider that out of scope for this doc, there's even a disclaimer in the document.
Yes, there's clone but it's only used for the initial fetch of the repository.
By default
The
As previously explained, by default your coworkers branch is directly available locally. This means you're able to To return to an empty commit of the default branch, use |
This was in reference to your comment of "At the moment, there only two commands which interact with remotes", so if
It won't be there if it is created after my
Are you saying I have to clone the whole repo every time a coworker adds a branch? And I don't want to add onto it; I want to test it without messing up what I'm working on. |
To be even more precise,
It will be here after every
No, as long as your coworkers branch is available on the remote,
Then you should use
Another (mis)-feature of the default behavior is, that the local branch is persisted until it's deleted on the remote. |
I think you can improve this doc by explaining the branches, or linking to a doc that does. It's a pretty common thing for a GitHub user to want to test a PR for review. |
Which parts do you mean? Most of the things mentioned here, belong into a fully fleshed out tutorial. I consider |
Well, my opinion is that people don't read all the docs there are. They jump to the part they need. So I suggest that this particular doc answers the questions they have for GitHub, concerning branches being deleted (or not) and how to get the branch they need to test a PR. If these things apply to more than GitHub, a link to the appropriate section is fine. |
Okay, jj does not replace git completely with new concepts, one of the selling points is git backend and colocated repos; it only improves upon git in some areas which are common pain points for git users and has generally a nicer ux 🤷 So git brain is good in understanding how it works, because ultimately jj is a really nice git frontend at the moment, but it's bad in grasping the new model where instead of finishing commits you start new ones etc.
I assume you are talking more about rewrites. Most of the things related to rewrites/rebases and so on usually happen in the local clone, you can edit and tidy up the history however you want before pushing - and what I'm trying to sell you is that in jj it's significantly easier to do than in vanilla git. The workflow where instead of pushing new commits on the feature branch you amend/edit them and force-push the rewritten branch is common in many projects, in this one too, this is not jj-specific although jj does lean into that direction, yes. The issue with bad links is GitHub - I assume it immediately deletes the rewritten commit for some reason (super-aggressive gc?), for example in a GitLab merge request all versions including rewrites are kept intact and you can see the diffs between them etc, it's pretty nice.
Does this not answer your own question about why The working copy commit ( This is at the very least not more complicated that what's done in git and many-many longtime git users myself included find pleasure in how easy and convenient this approach of jj makes things |
This is a bit confusing, since isn't
main
a branch?Can you add a comment to indicate if this puts multiple commits or just the previous commit on the new branch (since the original sentence says "creating a stack of commits") ?
Is this the literal command, with
$revision
, or is the user supposed to fill in the number?First, that push command probably should not have a dot?
Would it be the same thing to do the following commands?
$ jj describe 'address pr comments'
$ jj branch set your-feature #not sure of flags here
$ jj git push
The text was updated successfully, but these errors were encountered: