You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to do what sounded to me like a simple thing, and ran into several roadblocks.
I have a Breezy repo with 38 commits. I found an editor backup file which was from a month prior to my first commit, so I wanted to try to use jj to make it the first commit. (Breezy has a rebase plugin, but I get confused every time I read the help.) I've got JJ 0.35.0
Not wanting to harm my repo, I tried a fast-export and import to Git, but it didn't seem to work, so I brz pushed to a new folder that had an empty Git repo. That worked fine. After jj git init, I made an empty commit on top and overwrote the file with the old version. The diff looked all backwards (since it's an older version), so I tried jj rebase -A zzzz and it says skipped all commits, already in place, Nothing changed. Same thing using -B the first commit. I messed around with undo and put my new commit on zzzz, but it didn't help.
Here's where I did undo some more and somehow got to a point where a jj log gave the 38 commits, but a git log said fatal: your current branch 'refs/jj/root' does not have any commits yet
I decided to start over, deleting the whole thing. This time I started with jj git init, put the oldest file in there, and used git commit to set the date correctly. I found out that the Breezy push obliterates that commit. But since I found the hash in the .git/logs/refs folder, I thought jj should still be able to see it. I did a bookmark command and it said Done importing from underlying Git repo, Revision does not exist
So I started again, doing a jj log on the empty repo, git commit, and then jj bookmark, and finally the brz push. This time all 39 showed in the log, but two branches (so, like my second attempt?). This time I tried jj rebase -s 2nd -d 1st and it worked but saying there were conflicts in 38 commits and listed the most recent 10. But from that list I couldn't tell those were most recent. The hint given is for the first conflicted commit.
Since jj suggested jj resolve, I read the help on it and that didn't help me at all. I followed the hint, and couldn't figure out what to do in the builtin tool. Since there is no highlighting in that tool, it is very difficult to find the changes. I don't understand why there was a conflict there anyway. I exported the first version from Breezy, overwrote the conflicted file, and squashed it. jj said it rebased 38, and now no conflicts.
I wouldn't want to have done that with a big repo. Is there a better way?
Apparently, I had several wrong assumptions that indicate documentation deficits.
how a rebase should work (I thought I had the simplest case)
how to access a commit Git doesn't show
how to read the op log after undo (only know about op log because I read GitHub)
thought the logs should always match
what causes a conflict, what to do with the mess in the file
everything about resolve, including the builtin tool
Of course, I'm assuming the author dates are still in there, but the log shows the committer dates (but only because I've heard people ask about it).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to do what sounded to me like a simple thing, and ran into several roadblocks.
I have a Breezy repo with 38 commits. I found an editor backup file which was from a month prior to my first commit, so I wanted to try to use
jjto make it the first commit. (Breezy has a rebase plugin, but I get confused every time I read the help.) I've got JJ 0.35.0Not wanting to harm my repo, I tried a
fast-exportand import to Git, but it didn't seem to work, so Ibrz pushed to a new folder that had an empty Git repo. That worked fine. Afterjj git init, I made an empty commit on top and overwrote the file with the old version. The diff looked all backwards (since it's an older version), so I triedjj rebase -A zzzzand it says skipped all commits, already in place, Nothing changed. Same thing using-Bthe first commit. I messed around withundoand put my new commit on zzzz, but it didn't help.Here's where I did
undosome more and somehow got to a point where ajj loggave the 38 commits, but agit logsaidfatal: your current branch 'refs/jj/root' does not have any commits yetI decided to start over, deleting the whole thing. This time I started with
jj git init, put the oldest file in there, and usedgit committo set the date correctly. I found out that the Breezy push obliterates that commit. But since I found the hash in the .git/logs/refs folder, I thoughtjjshould still be able to see it. I did a bookmark command and it saidDone importing from underlying Git repo, Revision does not existSo I started again, doing a
jj logon the empty repo,git commit, and thenjj bookmark, and finally thebrz push. This time all 39 showed in the log, but two branches (so, like my second attempt?). This time I triedjj rebase -s 2nd -d 1stand it worked but saying there were conflicts in 38 commits and listed the most recent 10. But from that list I couldn't tell those were most recent. The hint given is for the first conflicted commit.Since
jjsuggestedjj resolve, I read the help on it and that didn't help me at all. I followed the hint, and couldn't figure out what to do in the builtin tool. Since there is no highlighting in that tool, it is very difficult to find the changes. I don't understand why there was a conflict there anyway. I exported the first version from Breezy, overwrote the conflicted file, and squashed it.jjsaid it rebased 38, and now no conflicts.I wouldn't want to have done that with a big repo.
Is there a better way?
Apparently, I had several wrong assumptions that indicate documentation deficits.
resolve, including the builtin toolOf course, I'm assuming the author dates are still in there, but the log shows the committer dates (but only because I've heard people ask about it).
Beta Was this translation helpful? Give feedback.
All reactions