aboutsummaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-18 20:18:41 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-18 20:18:41 -0700
commita1e3c2c1986e688bbef38ad573970dacd4a5899f (patch)
treea1bb062b53c1eaf5a9776e2257389fb866816348 /builtin-log.c
parentb805ef08e691299478b0d0c843eeab3f066c5872 (diff)
parent3b3d443feb1e7464c81e9a29c9b237cd6fa01fe5 (diff)
downloadgit-a1e3c2c1986e688bbef38ad573970dacd4a5899f.tar.gz
git-a1e3c2c1986e688bbef38ad573970dacd4a5899f.tar.xz
Merge branch 'rs/decorate'
* rs/decorate: add '%d' pretty format specifier to show decoration move load_ref_decorations() to log-tree.c and export it log: add load_ref_decorations()
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 1d3c5cbf5..081e660f6 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -14,7 +14,6 @@
#include "tag.h"
#include "reflog-walk.h"
#include "patch-ids.h"
-#include "refs.h"
#include "run-command.h"
#include "shortlog.h"
@@ -25,31 +24,6 @@ static int default_show_root = 1;
static const char *fmt_patch_subject_prefix = "PATCH";
static const char *fmt_pretty;
-static void add_name_decoration(const char *prefix, const char *name, struct object *obj)
-{
- int plen = strlen(prefix);
- int nlen = strlen(name);
- struct name_decoration *res = xmalloc(sizeof(struct name_decoration) + plen + nlen);
- memcpy(res->name, prefix, plen);
- memcpy(res->name + plen, name, nlen + 1);
- res->next = add_decoration(&name_decoration, obj, res);
-}
-
-static int add_ref_decoration(const char *refname, const unsigned char *sha1, int flags, void *cb_data)
-{
- struct object *obj = parse_object(sha1);
- if (!obj)
- return 0;
- add_name_decoration("", refname, obj);
- while (obj->type == OBJ_TAG) {
- obj = ((struct tag *)obj)->tagged;
- if (!obj)
- break;
- add_name_decoration("tag: ", refname, obj);
- }
- return 0;
-}
-
static void cmd_log_init(int argc, const char **argv, const char *prefix,
struct rev_info *rev)
{
@@ -80,8 +54,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if (!strcmp(arg, "--decorate")) {
- if (!decorate)
- for_each_ref(add_ref_decoration, NULL);
+ load_ref_decorations();
decorate = 1;
} else
die("unrecognized argument: %s", arg);