Last active
August 26, 2021 09:30
-
-
Save vitkin/5565443 to your computer and use it in GitHub Desktop.
"git-p4" - Exclude files for extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
770a771,782 | |
> def p4PathEndsWith(path, suffix): | |
> # This method tries to remedy a potential mixed-case issue: | |
> # | |
> # If UserA adds //depot/DirA/file1 | |
> # and UserB adds //depot/dira/file2 | |
> # | |
> # we may or may not have a problem. If you have core.ignorecase=true, | |
> # we treat DirA and dira as the same directory | |
> if gitConfigBool("core.ignorecase"): | |
> return path.lower().endswith(suffix.lower()) | |
> return path.endswith(suffix) | |
> | |
2061a2074,2075 | |
> self.ignorePaths = gitConfig("git-p4.ignorePaths").split("|") | |
> | |
2080a2095,2097 | |
> elif [s for s in self.ignorePaths | |
> if p4PathEndsWith(path, s)]: | |
> found = False | |
2137,2138c2154,2159 | |
< found = [p for p in self.depotPaths | |
< if p4PathStartsWith(path, p)] | |
--- | |
> if [s for s in self.ignorePaths | |
> if p4PathEndsWith(path, s)]: | |
> found = False | |
> else: | |
> found = [p for p in self.depotPaths | |
> if p4PathStartsWith(path, p)] | |
3388a3410,3411 | |
> | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This patch is intended for http://github.com/git/git/blob/bbd848633eb0a26ccd7306cb76964ab41cff6b83/git-p4.py
Example of usage in ".git/config":
[git-p4]
ignorePaths = .exe|.bin|.com|.so|.dll|.jar|.class|.zip|.apk|.war|.ear|.iso|.tar.gz|.tgz