Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: support .tarignore #35

Closed
stefanprodan opened this issue Apr 23, 2020 · 5 comments · Fixed by #55
Closed

git: support .tarignore #35

stefanprodan opened this issue Apr 23, 2020 · 5 comments · Fixed by #55
Labels
area/git Git related issues and pull requests enhancement New feature or request

Comments

@stefanprodan
Copy link
Member

When creating artifacts from Git repositories, we could detect if the .tarignore file is present in the root dir and pass to the tar command.

Ref: --exclude-ignore=.tarignore

@stefanprodan stefanprodan added enhancement New feature or request area/git Git related issues and pull requests labels Apr 23, 2020
@hiddeco
Copy link
Member

hiddeco commented May 13, 2020

I do not think detection of the file is a requirement as tar itself already checks if the file is present.

--exclude-ignore=file
Before dumping a directory, tar checks if it contains file. If so, exclusion patterns are read from this file. The patterns affect only the directory itself.

I am also wondering if we should not be using --exclude-ignore-recursive as

Same as --exclude-ignore, except that the patterns read affect both the directory where file resides and all its subdirectories.

@hiddeco
Copy link
Member

hiddeco commented May 13, 2020

Another interesting flag is --exclude-vcs which automatically detects and excludes the files from the most common VCS.

@stefanprodan
Copy link
Member Author

Maybe we should have our own .sourceignore and use that for tar, to make it explicit.

@hiddeco
Copy link
Member

hiddeco commented May 13, 2020

What do we gain by introducing a new standard instead of implementing the default ways of working with the solution used and/or declaring the (opt-in?) rule of excluding the VCS related files (.git, .gitignore, .gitattributes, etc)?

@stefanprodan
Copy link
Member Author

. sourceignore is not a new standard, when present it is used in tar --exclude-ignore=.sourceignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/git Git related issues and pull requests enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants