kubernetes/git-sync

How to disable commit hash in the target folder?

l1x opened this issue · 2 comments

l1x commented

I have to following setup:

git-sync --repo https://dev.azure.com/..../repo \
--root /tmp/git/data --dest data --one-time \
--branch master --max-sync-failures 5 \
--password-file /opt/.git-sync-pass --add-user true --depth 1

For some reason this results in a data/9cb27e1a1eb90c2832c22447c5a88085f132e62d/..... The last commit hash is included in the path.

Is there a way to influence this behaviour so that the commit hash is not showing up in the folder?

The hash is how we do atomic updates, and how we know what we think we have already (in case of a crash or a long-lived volume). When upstream changes, we sync, prepare a new worktree, then flip the link.

Otherwise your client might see a tree that is half updated in the middle of a pull.

Instead of accessing it via the hash directory, you can use the symlink, which should always point to the latest hash).

l1x commented

Thanks Tim!