git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git log -g: Complain, but do not fail, when no reflogs are there
Date: Tue, 24 Jul 2007 10:14:31 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707241011090.14781@racer.site> (raw)
In-Reply-To: <7vbqe2jr9m.fsf@assigned-by-dhcp.cox.net>

Hi,

On Mon, 23 Jul 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > When asking "git log -g --all", clearly you want to see only those refs
> > that do have reflogs, but you do not want it to fail, either.
> >
> > So instead of die()ing, complain about it, but move on to the other refs.
> 
> Hmph, do we even want to error(), I wonder...

Maybe not.  I thought it was some useful information, though.

> Can you tell, at that point, if there were explicit branch names given 
> originally on the command line, or the refs came
> from --all?

No:

                        if (!strcmp(arg, "--all")) {
                                handle_all(revs, flags);
                                continue;
                        }

which calls

static void handle_all(struct rev_info *revs, unsigned flags)
{
        struct all_refs_cb cb;
        cb.all_revs = revs;
        cb.all_flags = flags;
        for_each_ref(handle_one_ref, &cb);
}

which in turn calls

static int handle_one_ref(const char *path, const unsigned char *sha1, int flag,
 void *cb_data)
{
        struct all_refs_cb *cb = cb_data;
        struct object *object = get_reference(cb->all_revs, path, sha1,
                                              cb->all_flags);
        add_pending_object(cb->all_revs, object, path);
        return 0;
}

If you do not say --all, handle_revision_arg() is called, which calls 
add_pending_object thus:

                        add_pending_object(revs, &a->object, this);
                        add_pending_object(revs, &b->object, next);

or thus

        add_pending_object_with_mode(revs, object, arg, mode);

So no, there is not really a chance to see how the refs were specified at 
the time add_pending_object() is called.

Ciao,
Dscho

  reply	other threads:[~2007-07-24  9:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23 23:39 [PATCH] git log -g: Complain, but do not fail, when no reflogs are there Johannes Schindelin
2007-07-24  5:37 ` Junio C Hamano
2007-07-24  9:14   ` Johannes Schindelin [this message]
2007-07-24  7:26 ` Alex Riesen
2007-07-24  9:16   ` Johannes Schindelin
2007-07-24 10:17     ` Alex Riesen
2007-07-24 11:11       ` Johannes Schindelin

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=Pine.LNX.4.64.0707241011090.14781@racer.site \
    --to=johannes.schindelin@gmx.de \
    --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).