Moves binaries for use with gnu stow
This commit is contained in:
		
							parent
							
								
									f528ba793c
								
							
						
					
					
						commit
						4fd9f4809b
					
				
					 89 changed files with 0 additions and 0 deletions
				
			
		
							
								
								
									
										26
									
								
								bin/.bin/git/git-branch-summary
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										26
									
								
								bin/.bin/git/git-branch-summary
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,26 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
# Prints the number of commits between branches and a main branch (master by defaunt)
 | 
			
		||||
 | 
			
		||||
mainBranch="${1-master}"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
for branch in $(git branch -a --format "%(refname:short)"); do
 | 
			
		||||
 | 
			
		||||
	if [ "$branch" = "$mainBranch" ]; then
 | 
			
		||||
		continue;
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	masterInFront=$(git log --oneline "$branch".."$mainBranch" | wc -l)
 | 
			
		||||
	branchInFront=$(git log --oneline "$mainBranch".."$branch" | wc -l)
 | 
			
		||||
 | 
			
		||||
	if [ "$masterInFront" = "0" ] && [ "$branchInFront" = "0" ]; then
 | 
			
		||||
		echo "$mainBranch and $branch are in sync"
 | 
			
		||||
	else
 | 
			
		||||
		echo "$mainBranch is $masterInFront commits in front of $branch"
 | 
			
		||||
		echo "$branch is $branchInFront commits in front of $mainBranch"
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	echo ""
 | 
			
		||||
 | 
			
		||||
done
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue