mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			487 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			487 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
set -eu
 | 
						|
 | 
						|
cd "$(dirname "$0")/.."
 | 
						|
remote="$(git config zulip.zulipRemote)" || remote=upstream
 | 
						|
{
 | 
						|
    git describe --always --tags --match='[0-9]*'
 | 
						|
    branches="$(git for-each-ref --format='%(objectname)' "refs/remotes/$remote/main" "refs/remotes/$remote/*.x")"
 | 
						|
    mapfile -t branches <<<"$branches"
 | 
						|
    if merge_base="$(git merge-base -- HEAD "${branches[@]}")"; then
 | 
						|
        git describe --always --tags --match='[0-9]*' -- "$merge_base"
 | 
						|
    fi
 | 
						|
} >zulip-git-version
 |