summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e8b55fa)
raw | patch | inline | side by side (parent: e8b55fa)
author | Pieter de Bie <pdebie@ai.rug.nl> | |
Thu, 31 Jul 2008 13:20:34 +0000 (15:20 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 2 Aug 2008 18:07:50 +0000 (11:07 -0700) |
Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-name-rev.txt | patch | blob | history | |
builtin-name-rev.c | patch | blob | history |
index ffac3f8f564bf5f5e2ca317b986db9b01f5dc026..83d8e4a9fc9757d9c666c3c122978747506b7d6e 100644 (file)
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,
diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index b75c73b2248dea52e70b438d882435ac92c333eb..ff7d638dc2b71c9c29441b842b49ccf03a9b4618 100644 (file)
--- a/builtin-name-rev.c
+++ b/builtin-name-rev.c
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;
}
}