summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2017-11-16 02:00:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-16 02:12:51 (GMT)
commitcdaed0cf023a47cae327671fae11c10d88100ee7 (patch)
tree0724e7266cb60be846d522461b5c7d64f97d10a3 /builtin
parentc87b653c46c4455561642b14efc8920a0b3e44b9 (diff)
downloadgit-cdaed0cf023a47cae327671fae11c10d88100ee7.zip
git-cdaed0cf023a47cae327671fae11c10d88100ee7.tar.gz
git-cdaed0cf023a47cae327671fae11c10d88100ee7.tar.bz2
builtin/describe.c: print debug statements earlier
When debugging, print the received argument at the start of the function instead of in the middle. This ensures that the received argument is printed in all code paths, and also allows a subsequent refactoring to not need to move the "arg" parameter. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/describe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/describe.c b/builtin/describe.c
index fd61f46..3136efd 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -293,6 +293,9 @@ static void describe(const char *arg, int last_one)
unsigned long seen_commits = 0;
unsigned int unannotated_cnt = 0;
+ if (debug)
+ fprintf(stderr, _("describe %s\n"), arg);
+
if (get_oid(arg, &oid))
die(_("Not a valid object name %s"), arg);
cmit = lookup_commit_reference(&oid);
@@ -316,7 +319,7 @@ static void describe(const char *arg, int last_one)
if (!max_candidates)
die(_("no tag exactly matches '%s'"), oid_to_hex(&cmit->object.oid));
if (debug)
- fprintf(stderr, _("searching to describe %s\n"), arg);
+ fprintf(stderr, _("No exact match on refs or tags, searching to describe\n"));
if (!have_util) {
struct hashmap_iter iter;