Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an unreachable commit ID instead of a tag #1549

Closed
wants to merge 1 commit into from

Conversation

pjw91
Copy link
Contributor

@pjw91 pjw91 commented Dec 7, 2017

For git v1.7.1 (eg. on CentOS 6), a shallow clone achieved by git clone --depth 1 clones not only the latest commit on master branch but also all branches and all tags, which makes the tag jq-1.0 available.

As a result, the shallow-clone-detecting command passes and the git describe is incorrectly called.

This patch replaces the tag jq-1.0 with eca89ac, which is the initial commit.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 85.071% when pulling ca21a75 on mail6543210:fix-shallow into 79ece35 on stedolan:master.

@itchyny
Copy link
Contributor

itchyny commented Jun 11, 2023

As of git v1.7.10 (April 2012), using --depth=1 implies --single-branch flag so tags are not fetched (ref: RelNotes/1.7.10.txt#L80-L82, https://lkml.org/lkml/2012/3/28/418). So the version shows master-[commit sha] right after a shallow clone of the repository. But doing git fetch --tags after the shallow clone, autoreconf fails with fatal: No tags can describe error. In this situation, git rev-parse --verify -q eca89ac resolves the full commit sha (not sure why) so the proposed change does not fix the error. We can use git describe --tags --match 'jq-*' (or just git describe --tags for simplicity) for this check IMO. Here are the related commits: f7bf9a8, 6878123.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants