Closed zenshixd closed 1 month ago
On what jj
version are you on? You missed this while filling out the bug template. Thanks.
Sorry, I am using jj@0.20.0.
After some investigation though I found the core of the issue - its the core.ignoreCase=false
on Git.
If I disable this setting (core.ignoreCase=true
) then the same issue happens on Git.
For some reason prefixes BugFix/
and Feature/
are uppercased in our remote repo but Bitbucket reports them as lowercased, for some reason.
The workaround I found in jujutsu is to manually edit refs .jj/repo/store/git/refs/origin/
from BugFix/
to bugfix
(and from Feature/
to feature/
). After this change I was able to push again and all new branches also worked correctly.
I still dont know how to replicate it tho :(
After some investigation though I found the core of the issue - its the
core.ignoreCase=false
on Git. If I disable this setting (core.ignoreCase=true
) then the same issue happens on Git.
Good find! I wonder where the Feature
(with uppercase F
) comes from. Are you sure it's really feature
on the remote? Oh, maybe you have some other branches called Feature/...
, would have caused the directory to be called that. If that's the case, then I would expect pushing your branch to fail with Git too, but maybe Git has some hack to convert it back to the lowercase feature
.
I suspect you can fix the problem by calling git pack-refs
, which should make sure the branches are stored in a proper data format instead of as files in the file system. Once you've done that, you should be able to have a feature/foo
branch and a Feature/bar
branch (and even a Feature/foo
branch). You may need to re-fetch to get the canonical names into your repo.
Are you sure it's really feature on the remote?
I mean ... If I dont lowercase the on my system then push fails so yea :D It is also how Bitbucket reports it on web UI:
If that's the case, then I would expect pushing your branch to fail with Git too
Yea thats also what happens with Git - but with Git its not too bad since I can push to a separate Feature/
on remote - with jj I am completely blocked.
Also, fiddled with it a bit more, since the issue on Git doesnt happen as often as on jj, but most reliable way I find was:
mkdir testrepo
cd testrepo
git init
git remote add origin [...]
git fetch
With this method even with core.ignorecase=true
- I was also getting Feature/
instead of feature/
.
I mean ... If I dont lowercase the on my system then push fails so yea :D It is also how Bitbucket reports it on web UI:
Yes, sorry, I was thinking it through as I typing the message. I could have deleted that sentence after typing the next one since it started to make sense to me then :)
Yea thats also what happens with Git - but with Git its not too bad since I can push to a separate
Feature/
on remote - with jj I am completely blocked.
I don't think we should copy Git's hacks, so I think we can consider the remaining part of this issue to be #3235. Feel free to reopen if you disagree.
Some more thoughts + I managed to reproduce the issue here on Github!!! https://github.com/zenshixd/uppercase-bug
There was still 1 thing that puzzled me so I couldnt stop thinking about it but: the reason web UI reported feature/
but I was downloading Feature/
was because ... Git/JJ are downloading branches in alphabetical order :)
Meaning: on macOS/Windows, if you download Feature/
branch first (which you will, because F
is higher than f
in ASCII!) then every subsequent branch with prefix feature
or feaTure
or any other casing where first letter is f
, will land in the same directory Feature
!!
You can see it well in repo above, if you do
git init
git remote add origin git@github.com:zenshixd/uppercase-bug.git
git fetch
git branch -a
You will see that all branches have prefix AAAA/
even though on remote they are all different!
And if you remove AAAA/
on remote, clone it again, then ...
ownelek@MacBook-Pro testrepo % git branch -a
remotes/origin/AAAa/test2
remotes/origin/AAAa/test3
remotes/origin/AAAa/test4
remotes/origin/AAAa/test5
remotes/origin/main
:)))))))))
This is just some food for thought, I have no idea what correct solution is here. On the other hand, I feel allowing specifying which branch to push to is just workaround, but I guess it would at least unblock people who encounter such issue.
Description
jj git fetch
(orjj git clone
) downloads branch names uppercased, example: I have branch calledfeature/TASKFLOW-24635-optimize-deletemodules-network-call
on remote Bitbucket Server, but when downloaded throughjj git fetch
I am getting:Notice the prefix:
Feature/
instead offeature/
. This is problematic, because trying to push to this branch fails:Following the hint doesnt work, subsequent
jj git fetch
returns "Nothing changed.".Using Git binary doesnt have this issue When using pure Git repo, branch name is correct:
Steps to Reproduce the Problem
Unfortunately the repo is on internal Bitbucket Server, so I cannot share it. I tried reproducing this issue using Bitbucket Cloud but no success so far.
jj git clone
jj branch list -a 'glob:...'
Expected Behavior
Branch name is exactly the same locally as on remote.
Actual Behavior
Branch prefix is uppercased which prevents pushing changes to remote.
Specifications