mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	/bin/sh and /usr/bin/env are the only two binaries that NixOS provides at a fixed path (outside a buildFHSUserEnv sandbox). This discussion was split from #11004. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
		
			
				
	
	
		
			21 lines
		
	
	
		
			558 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			558 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
 | 
						|
# Lint all commit messages that are newer than upstream/master if running
 | 
						|
# locally or the commits in the push or PR if in Travis CI.
 | 
						|
 | 
						|
# The rules can be found in /.gitlint
 | 
						|
 | 
						|
if [ "$TRAVIS" ]; then
 | 
						|
    # Work around https://github.com/travis-ci/travis-ci/issues/4596
 | 
						|
    range="${TRAVIS_COMMIT_RANGE/.../..}"
 | 
						|
else
 | 
						|
    range="upstream/master..HEAD"
 | 
						|
fi
 | 
						|
 | 
						|
commits=$(git log "$range" | wc -l)
 | 
						|
if [ "$commits" -gt 0 ]; then
 | 
						|
    # Only run gitlint with non-empty commit lists, to avoid a printed
 | 
						|
    # warning.
 | 
						|
    gitlint --commits "$range"
 | 
						|
fi
 |