git-ftp
git-ftp copied to clipboard
Exclude certain files from upload
Add an option to exclude certain files from the upload, perhaps in the form of a git-ftp specific .gitignore
file.
I suggest naming it .gitftpignore or .ftpignore (any preferences?). It would be nice if it followed the same syntax as .gitignore but reimplementing that parser might be nontrivial.
i like .gitftpignore imho.
or call it from ftpdata: gitftpignore=.gitftpignore
Gives you the power to set different files for different branches or FTP servers.
I agree with Janghou, simple yet powerful solution
And .gitftpignore can be default file if gitftpignore can not be found in ftpdata
Is there any progress on this issue since last year? Due to .gitignore's manpage it uses only few simple rules and fnmatch()
function so it shouldn't be that hard.
Nope, no one has been working on it.
How would we handle submodules? One .gitftpignore in the root repo (my +1 here), or one per module?
Would we upload .gitftpignore files to the server? If no: Because of that special name, or because of the name set in ftpdata? If yes: Ok, users can still add .gitftpignore to .gitftpignore.
I think the question should be one .gitftpignore in the root (+1 here as well) or in any directory – much like .gitignore. Also I don't see any reason to upload .gitftpignore files. Why would anyone need them there? Or you want them there so you can control what is uploaded? Eg. different .ftpignore in staging and production server.
Oh ... I didn't realize you could have multiple .gitignore
s. Not sure then anymore. But we can always start with the easier one, which would also be enough for any use case I have.
And ok, we should not upload the ignore files to the FTP server. We can have the same feature with @Janghou's suggestion.
I think I'll play with this a little.
What about to use .gitftpignore in root, unless other file in ftpdata is specified? I am actually almost done with the implementation but I haven't tested submodules yet.
Oh ... that looks quite good. Made a few comments, also.
Submodules use upload_diff
recursively. If the ignored
parameter was optional, it at least wouldn't break them. But they also wouldn't work as expected, because the pathnames of the diff will be against the root of the current submodule, not the root where .gitfptignore
lies.
We could either allow to have .gitftpignore
in any directory (or just one per (sub)module), but will the submodules inherit rules from parent? If yes, then we don't really need them, we could just join path with parent and match against it. If no, wouldn't it just get too messy because you have to track of several ignore files just so you can upload what you need? But it's more question of use case.
Also if we allow more than one .gitftpignore
then specifying it's name in ftpdata is pretty much pointless.
Mhh ... I'd vote for a single ignore file in the root of the main repository. Only problem: Submodules need to know the path relative to the root. That would we one more parameter to upload_diff
.