Replies: 7 comments 18 replies
-
...actually, it seems even
|
Beta Was this translation helpful? Give feedback.
-
Thanks for taking the time to write feedback!
It's actually mostly because we haven't seen much need for it, so we're keeping the data model simpler until we're convinced it's needed. If there's such a thing as a "current branch" in the model, then you need to figure out when to set and when to clear that. Git sets the current branch when you pass the branch name to
Maybe we should support something like Mercurial's topics extension, which lets you associate a single name with a commit. It lets you have the same topic name for multiple commits. Then you might do There's also issue #2338 for adding a
That
I don't think you should have to use |
Beta Was this translation helpful? Give feedback.
-
Scott Chacon's GitButler is "a Git client for simultaneous branches on top of your existing workflow". He talked about it in So You Think You Know Git - FOSDEM 2024. |
Beta Was this translation helpful? Give feedback.
-
Just tossing this out here: as someone working on a project using
makes all of this a breeze. The branches never move, so I never need to change them, a Depending on upstream policy, you may not be able to do this, but it ends up being very nice. Since I like git's staging area, in practice I work on an empty |
Beta Was this translation helpful? Give feedback.
-
I use the stacked workflow with The only requirement is to add
Most of the work has a linear history and is done without branching. Sometimes, I have a couple of stacks, but usually, one. After customising templates, I also have these topics visible in the logs.
Config[template-aliases]
topic = '''
description.lines().map(|line|
if(
line.lower().starts_with("topic:"),
line.substr(6, line.len()).remove_prefix(" ").remove_suffix(" "),
)
).join("")
'''
relative_topic = '''
description.lines().map(|line|
if(
line.lower().starts_with("relative:"),
concat(
"→ ",
line.substr(9, line.len()).remove_prefix(" ").remove_suffix(" "),
),
)
).join("")
'''
draft = '''
description.lines().map(|line|
if(
line.lower().starts_with("labels:") && line.lower().contains("draft"),
"DRAFT"
)
).join("")
'''
topic_label = 'separate(" ", label("draft", draft), label("topic", topic), label("relative", relative_topic))'
[colors]
draft = { fg = "bright red", bold = false, underline = false }
topic = "bright yellow"
relative = "bright black"
"username" = { fg = "bright black", bold = false }
"timestamp" = { fg = "bright black", bold = false }
|
Beta Was this translation helpful? Give feedback.
-
This thread gave me the most clues about how to just get on and use jj, somehow, anyhow. It has not been easy to find out what is the simplest way I can track my work in a remote git without breaking things. To work on top of a branch, e.g. main, the simplest flow I have found is: # after a jj git clone, or the previous jj git push, do:
# make changes
jj log # snapshots any changes made, causing jj to "stage" the changes - in jj it makes a detached head commit
jj commit -m "description of the changes made" # a conventional commit, but jj adds a fresh empty detached head commit on top
jj bookmark set --revision @- main # since we point to the fresh empty detached head commit on top, point the bookmark (branch name) to the prior not empty commit
jj git push -r @- # push the bookmark (git branch) that points to the prior not empty commit
# make more changes, and repeat
|
Beta Was this translation helpful? Give feedback.
-
@necauqua Perfect, thank you. jj is fabulous and new to me. I hope my beginner feedback helps. From your comment I got 2 things:
Like many, I am grateful for jujutsu appearing. It feels like Déjà vu! I lived through the godsend of git, after years of waiting for something like bzr, GNU Arch, Monotone, DARCS, Hg etc to go mainstream. |
Beta Was this translation helpful? Give feedback.
-
I've read the tutorial, and I understand that
jj
doesn't have a concept of a "working branch," but I'm wondering if I've missed something fundamental, because it seems like the basic git workflow of "make some changes, commit them, push them" is fairly high-friction.Since
jj
doesn't have a concept of a "working branch", it appears that I need to explicitly runjj branch set <name> -r @
every time I want to add commits to a branch. Is that correct? Is there a reason for that, other than encouraging users to rewrite commits rather than add new commits?It may be that I just haven't adapted to the
jj
"way" (I only installed it yesterday), but here are the things I miss about having a working branch:jj
'snew
command does this for individual commits, but that seems too granular for me; I don't always know the nature of a small change I'm about to make before I make it. I do, however, always have a high-level plan, generally captured as a feature name and/or issue-tracker number.jj git push
doesn't work without either manually specifying a commit and a remote destination or first usingbranch set ... -r @
.The second of these points is much more important to me than the first. Should I just get used to setting up
rsync
, Dropbox, or similar for my data-synchronization, and stop using commit & push for this purpose? Isjj git push -c @
something I should be doing more frequently?Beta Was this translation helpful? Give feedback.
All reactions