nextcloud-docker-dev icon indicating copy to clipboard operation
nextcloud-docker-dev copied to clipboard

Problem with the recent depth=1 cloning

Open Apfelwurm opened this issue 3 years ago • 4 comments

since you updated the repository cloning to depth=1 i have the problem that i can not add the stable worktrees anymore on a fresh installation, even when executing a fetch --unshallow before.

I am running the following commands:

mkdir -p $HOME/temp_nextcloud
git clone https://github.com/juliushaertl/nextcloud-docker-dev $HOME/temp_nextcloud/nextcloud-docker-dev
cd $HOME/temp_nextcloud/nextcloud-docker-dev
./bootstrap.sh
cd $HOME/temp_nextcloud/nextcloud-docker-dev/workspace/server/
git fetch --unshallow
git worktree add ../stable24 stable24

and the output i get:

Cloning into '/home/user/temp_nextcloud/nextcloud-docker-dev'...
remote: Enumerating objects: 1133, done.
remote: Counting objects: 100% (301/301), done.
remote: Compressing objects: 100% (102/102), done.
remote: Total 1133 (delta 207), reused 278 (delta 197), pack-reused 832
Receiving objects: 100% (1133/1133), 29.75 MiB | 18.69 MiB/s, done.
Resolving deltas: 100% (612/612), done.

⏩ Performing system checks
    ✅ docker is properly installed
    ✅ docker-compose is properly installed
    ✅ git is properly installed
    ✅ Docker is properly executable

⏩ Setting up folder structure and fetching repositories
    🌏 Fetching server (this might take a while to finish)
       > Cloning into 'workspace/server'...
       > Submodule '3rdparty' (https://github.com/nextcloud/3rdparty.git) registered for path '3rdparty'
       > Cloning into '/home/user/temp_nextcloud/nextcloud-docker-dev/workspace/server/3rdparty'...
       > Submodule path '3rdparty': checked out '3095d4062823f3f913d594f9ff313010ed55cd74'
    🌏 Fetching viewer
       > Cloning into 'workspace/server/apps-extra/viewer'...
    ✅ viewer installed
    🌏 Fetching recommendations
       > Cloning into 'workspace/server/apps-extra/recommendations'...
    ✅ recommendations installed
    🌏 Fetching files_pdfviewer
       > Cloning into 'workspace/server/apps-extra/files_pdfviewer'...
    ✅ files_pdfviewer installed
    🌏 Fetching profiler
       > Cloning into 'workspace/server/apps-extra/profiler'...
    ✅ profiler installed


⏩ Setup your environment in an .env file


 ╔═════════════════════════════════════════╗
 ║ oOo Ready to start developing 🎉        ║
 ╚═════════════════════════════════════════╝

 🚀  Start the Nextcloud server by running

	$ docker-compose up -d nextcloud


 💤  Stop it with

	$ docker-compose stop nextcloud


 🗑  Fresh install and wipe all data

	$ docker-compose down -v


	Note that for performance reasons the server repository has been cloned with
	--depth=1. To get the full history it is highly recommended to run:

	$ cd workspace/server
	$ git fetch --unshallow

	This may take some time depending on your internet connection speed.


For more details about the individual setup options see
the README.md file or checkout the repo at
https://github.com/juliushaertl/nextcloud-docker-dev
remote: Enumerating objects: 847748, done.
remote: Counting objects: 100% (847736/847736), done.
remote: Compressing objects: 100% (153980/153980), done.
remote: Total 842315 (delta 686914), reused 834685 (delta 679389), pack-reused 0
Receiving objects: 100% (842315/842315), 2.00 GiB | 20.99 MiB/s, done.
Resolving deltas: 100% (686914/686914), completed with 3582 local objects.
fatal: invalid reference: stable24

do you know whats going on here? i tried to checkout the branch on the server directory, but that also does not work. git branch -r does also only show the following branches:

  origin/HEAD -> origin/master
  origin/master

ofc, i can clone the repo again into the stable24 folder and checkout the stable24 branch there, but since you documented the recommended process with worktree, i thought i report the behaviour.

Apfelwurm avatar Oct 12 '22 15:10 Apfelwurm

Thanks for reporting. Could you try running the following commands I your server checkout:

git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin

References: https://stackoverflow.com/a/17937889 https://www.delenamalan.co.za/2019/fetch-all-branches.html

juliusknorr avatar Oct 12 '22 16:10 juliusknorr

After executing those commands, everything seems to work like it was before. Maybe then the documentation or the bootstrap.sh should be adjusted :) Thank you!

Apfelwurm avatar Oct 12 '22 17:10 Apfelwurm

Hi @Apfelwurm :)

If your problem is resolved. Could I close this issue ? :)

zak39 avatar Oct 13 '22 09:10 zak39

Let's keep it open to update the documentation and bootstrap script message accordingly :)

juliusknorr avatar Oct 13 '22 09:10 juliusknorr

Added to the README with 8a7ad87 eb15df4

juliusknorr avatar Nov 28 '22 07:11 juliusknorr