mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-04 07:49:35 +00:00 
			
		
		
		
	Make the pre-commit check spit out cut-and-paste commands and be more obvious about errors. Tested by making an invalid change and observing the message generated.
		
			
				
	
	
		
			11 lines
		
	
	
		
			205 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
		
			205 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
if [[ "$(grep -c "COMMIT_BLOCKED" $1)" -gt 0 ]]; then
 | 
						|
  echo "FAILED: Unresolved errors - aborting the commit."
 | 
						|
  echo "The message of your attempted commit was:"
 | 
						|
  cat $1
 | 
						|
  exit 1
 | 
						|
fi
 | 
						|
 | 
						|
exit 0
 |