[Bug 12940] New: rsync: -C/--cvs-exclude does not ignore SCM ignore files (patch)
samba-bugs at samba.org
samba-bugs at samba.org
Fri Jul 28 16:55:56 UTC 2017
https://bugzilla.samba.org/show_bug.cgi?id=12940
Bug ID: 12940
Summary: rsync: -C/--cvs-exclude does not ignore SCM ignore
files (patch)
Product: rsync
Version: 3.1.3
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P5
Component: core
Assignee: wayned at samba.org
Reporter: austinenglish at gmail.com
QA Contact: rsync-qa at samba.org
Created attachment 13436
--> https://bugzilla.samba.org/attachment.cgi?id=13436&action=edit
add gitignore to cvs_excludes
Howdy,
First, thanks for the excellent rsync tool. It's been invaluable over the
years!
I was recently working on a project where I wanted to rsync a copy of a git
repo, and exclude SCM files. I used rsync -C, but noticed that while .git was
removed, .gitignore remained.
I've written a small patch to also exclude .bzrignore, .hgignore, and
.gitignore, so that bazaar, git and mercurial SCMs also have their ignore
files, ignored (as they are practically useless without the other SCM files,
e.g., for a tarball release).
Before:
austin at austin2:~/src/rsync$ rsync -CavPz /home/austin/src/foobar $(mktemp -d)
sending incremental file list
foobar/
foobar/.gitignore
6 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=3/5)
foobar/README.md
63 100% 61.52kB/s 0:00:00 (xfr#2, to-chk=2/5)
foobar/setup-flash-drive.sh
8,119 100% 7.74MB/s 0:00:00 (xfr#3, to-chk=1/5)
foobar/setup-kit.sh
613 100% 598.63kB/s 0:00:00 (xfr#4, to-chk=0/5)
sent 3,849 bytes received 96 bytes 7,890.00 bytes/sec
total size is 8,801 speedup is 2.23
After:
austin at austin2:~/src/rsync$ ./rsync -CavPz /home/austin/src/foobar $(mktemp -d)
sending incremental file list
foobar/
foobar/README.md
63 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=2/4)
foobar/setup-flash-drive.sh
8,119 100% 7.74MB/s 0:00:00 (xfr#2, to-chk=1/4)
foobar/setup-kit.sh
613 100% 598.63kB/s 0:00:00 (xfr#3, to-chk=0/4)
sent 3,778 bytes received 77 bytes 7,710.00 bytes/sec
total size is 8,795 speedup is 2.28
Note: I searched bugzilla and found a few other bugs that reference .gitignore,
but I believe none are the same:
bug 5418/bug 10995: .gitignore is casually mentioned in a list of files in the
rsync command, unrelated
bug 6120: is about a .rsyncignore file (default --exclude-from location),
roughly equivalent to .gitignore
bug 9744: is about parsing git/svn/hg/bzr ignore lists and having rsync ignore
THOSE files
--
You are receiving this mail because:
You are the QA Contact for the bug.
More information about the rsync
mailing list