Replies: 5 comments 10 replies
-
Hello, I have the same issue with integrating Chromatic into the build step of vercel.
Is there a way to change the vercel configration, so that the repo is checked out in an unshallow way? |
Beta Was this translation helpful? Give feedback.
-
@klarkc I also raised the issue with the Vercel support - here the answer: [...] Thank you for reaching out, I looked into your issue and it turns out that there is indeed a limit to the git history that Vercel accesses. We just clone the repo with the parameter depth=2 and it is not possible to change that. Here is a little more info on the matter. [...] |
Beta Was this translation helpful? Give feedback.
-
Is there any way (hacky or not) to manually unshallow a repo? It's just so powerful to get access to the history during build stage, we could for example embed the publishing date of an article by just looking at its first revision. |
Beta Was this translation helpful? Give feedback.
-
Vercel doesn't just make a clone with To unshallow you can do this: git pull --unshallow {YOUR REPO HTTP CLONE URL} "master:${PUBLIC_VERCEL_GIT_COMMIT_REF}" The last step is not changing the head, it starts pointing to the correct commit already, it is just for git to recompute it from a full history instead of a history with a depth of 10. To config that you got your commits you can run I haven't tested this for private repos, so I'm not sure if whatever Vercel uses to authenticate their clone of a private repo will work on normal git, but for public repos it is working fine. Example of how I did this on my blog: https://gitlab.com/Fryuni/blog/-/commit/3719380d11b2b7f752e92ac55f3a6ad4ac3d6ed8 Edit: Found a simpler command |
Beta Was this translation helpful? Give feedback.
-
You can configure Vercel to clone the full repo by setting the |
Beta Was this translation helpful? Give feedback.
-
Hello, I need to define a variable at build time that depends on
git describe
which depends on git history, but it seems the repo in vercel build enviroment is a shallow clone with only few last commits. I tried to run a git fetch before build command with no luck:git fetch --depth=100 --tags; SENTRY_RELEASE=$(git describe) yarn build
fatal: No names found, cannot describe anything.
I've also tried with
git fetch --unshallow
,git fetch --prune --unshallow
andgit fetch --prune --unshallow --tags
.In my local tests, replicating
git clone --depth=2
, the fetch with--depth
option is working (even without--tags
, because tags comes along commits)Beta Was this translation helpful? Give feedback.
All reactions