freebsd-git-docs icon indicating copy to clipboard operation
freebsd-git-docs copied to clipboard

vendor.md: suggest doc clarification/caveat around rsync

Open cemeyer opened this issue 4 years ago • 2 comments

Thanks for drafting these documents; in general, the vendoring process has been more straightforward than our previous SVN system.

One caveat I'd call out is the rsync -va --del ~/git/NetBSD/usr.sbin/mtree/ . at Update the Sources in the Vendor Branch.

The rsync --del will nuke the worktree's .git file in the vendor worktree. To work around this, save a copy of the .git file in the parent directory before rsync and restore it afterwards. This is ugly, but if you tell rsync to ignore .git instead, it will delete the file as not-present in the source directory. Maybe someone more familiar with rsync has an incantation to avoid clobbering worktrees.

(As a personal preference: the rsync -v (verbose) flag is just spam for any vendor software with a significant number of files. git status will tell you what changed, and that's more important. My 2¢.)

cemeyer avatar Dec 25 '20 16:12 cemeyer

You can just use rsync -va --del --exclude .git. It will simply ignore .git directories in the source and destination.

DimitryAndric avatar Jan 02 '21 23:01 DimitryAndric

Ok, let's document that (assuming it works).

cemeyer avatar Jan 03 '21 01:01 cemeyer