Instead of printing both the SHA-1 and the name, print only
the name. If given with --tags the usual tag prefix of
"tags/" is also omitted from the name, matching the output
- of linkgit:git-describe[1] more closely. This option
- cannot be combined with --stdin.
+ of linkgit:git-describe[1] more closely.
--no-undefined::
Die with error code != 0 when a reference is undefined,
if (!name)
continue;
- fwrite(p_start, p - p_start + 1, 1, stdout);
- printf(" (%s)", name);
+ if (data->name_only) {
+ fwrite(p_start, p - p_start + 1 - 40, 1, stdout);
+ printf(name);
+ } else {
+ fwrite(p_start, p - p_start + 1, 1, stdout);
+ printf(" (%s)", name);
+ }
p_start = p + 1;
}
}