Bug 1701337

Summary: issues with 'building' glusterfs packages if we do 'git clone --depth 1'
Product: [Community] GlusterFS Reporter: Amar Tumballi <atumball>
Component: buildAssignee: bugs <bugs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: mainlineCC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-7.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-18 06:35:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Amar Tumballi 2019-04-18 16:56:39 UTC
Description of problem:
Right now, a full clone of glusterfs repo needs 148MB of size, but a clone with '--depth 1' option needs just 4MB. It makes sense to use this option in many of the smoke tests and CI/CD environments, so that we save time, bandwidth, and storage.

But, right now, we can't 'build' any RPMs with this option.

Version-Release number of selected component (if applicable):
mainline (april-18th-2019)

How reproducible:


Steps to Reproduce:
1. git clone --depth 1 https://github.com/gluster/glusterfs.git glusterfs-depth-1
2. cd glusterfs-depth-1; ./autogen.sh && ./configure && make -C extras/LinuxRPM/ glusterrpms
3. You see the error like below
```
rpmbuild --define '_topdir /home/atumball/work/gluster/glusterfs-container-tests/extras/LinuxRPM/rpmbuild' -bs rpmbuild/SPECS/glusterfs.spec
error: line 231: Empty tag: Version:
make: *** [Makefile:573: srcrpm] Error 1

```



Expected results:
build should pass.

Additional info:
The issue is with executing ./build-aux/pkg-version script.

[atumball@localhost glusterfs-depth-1]$ ./build-aux/pkg-version --full
fatal: No names found, cannot describe anything.
v-

[atumball@localhost glusterfs-depth-1]$ ./build-aux/pkg-version --version 2>/dev/null
<No output>

Comment 1 Worker Ant 2019-04-18 17:17:13 UTC
REVIEW: https://review.gluster.org/22583 (build-aux/pkg-version: provide option for depth=1) posted (#2) for review on master by Amar Tumballi

Comment 2 Worker Ant 2019-04-25 04:17:02 UTC
REVIEW: https://review.gluster.org/22583 (build-aux/pkg-version: provide option for depth=1) merged (#4) on master by Amar Tumballi