From: Stefan Beller <sbeller@google.com>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Stefan Beller <sbeller@google.com>
Subject: [PATCHv4 5/7] builtin/describe.c: print debug statements earlier
Date: Tue, 14 Nov 2017 16:30:41 -0800 [thread overview]
Message-ID: <20171115003043.24080-6-sbeller@google.com> (raw)
In-Reply-To: <20171115003043.24080-1-sbeller@google.com>
For debuggers aid we'd want to print debug statements early, so
introduce a new line in the debug output that describes the whole
function, and then change the next debug output to describe why we
need to search. Conveniently drop the arg from the second line;
which will be useful in a follow up commit, that refactors the
describe function.
This re-arrangement of debug printing is solely done for a better
refactoring in the next commit, not to aid debugging git-describe,
which is expected to have the same information readily available
with the new prints.
Signed-off-by: Stefan Beller <sbeller@google.com>
---
builtin/describe.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/builtin/describe.c b/builtin/describe.c
index fd61f463cf..3136efde31 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;
--
2.15.0.128.gcadd42da22
next prev parent reply other threads:[~2017-11-15 0:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 0:30 [PATCHv4 0/7] describe a blob Stefan Beller
2017-11-15 0:30 ` [PATCHv4 1/7] t6120: fix typo in test name Stefan Beller
2017-11-15 0:30 ` [PATCHv4 2/7] list-objects.c: factor out traverse_trees_and_blobs Stefan Beller
2017-11-15 0:30 ` [PATCHv4 3/7] revision.h: introduce blob/tree walking in order of the commits Stefan Beller
2017-11-15 1:38 ` Jonathan Tan
2017-11-15 0:30 ` [PATCHv4 4/7] builtin/describe.c: rename `oid` to avoid variable shadowing Stefan Beller
2017-11-15 0:30 ` Stefan Beller [this message]
2017-11-15 1:41 ` [PATCHv4 5/7] builtin/describe.c: print debug statements earlier Jonathan Tan
2017-11-15 0:30 ` [PATCHv4 6/7] builtin/describe.c: factor out describe_commit Stefan Beller
2017-11-15 1:44 ` Jonathan Tan
2017-11-15 0:30 ` [PATCHv4 7/7] builtin/describe.c: describe a blob Stefan Beller
2017-11-15 1:52 ` Jonathan Tan
2017-11-16 1:22 ` Stefan Beller
2017-11-16 1:43 ` Junio C Hamano
2017-11-16 1:49 ` Stefan Beller
2017-11-16 2:04 ` Junio C Hamano
2017-11-17 1:06 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171115003043.24080-6-sbeller@google.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).