All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>, Michael Haggerty <mhagger@alum.mit.edu>
Subject: Re: [PATCH 1/3] refs: make sha1 output parameter of refs_resolve_ref_unsafe() optional
Date: Sun, 24 Sep 2017 10:26:42 +0900	[thread overview]
Message-ID: <xmqq60c8j38t.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <b89d36b5-0996-829b-a267-7ee4da9673dc@web.de> (=?utf-8?Q?=22R?= =?utf-8?Q?en=C3=A9?= Scharfe"'s message of "Sat, 23 Sep 2017 11:41:45 +0200")

René Scharfe <l.s.r@web.de> writes:

> Allow callers of refs_resolve_ref_unsafe() to pass NULL if they don't
> need the resolved hash value.  We already allow the same for the flags
> parameter.  This new leniency is inherited by the various wrappers like
> resolve_ref_unsafe().
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---

The patches all make sense, and I'd expect them to be something a
competent contributor would write after coming to this realization:
it seems that many many callers, when they have a ref that could be
a symbolic ref, want to learn (1) if it is a symref and (2) where it
points at, and nothing else, most notably they do not care what the
object pointed by the (symbolic) ref is.

I wonder if we want a dedicated helper for them (perhaps about a
dozen callers we have that fall into this pattern?) to call for the
exact purpose, implemented as a thin-wrapper around the
resolve_ref_unsafe() function, though.

Thanks.

  parent reply	other threads:[~2017-09-24  1:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-23  9:41 [PATCH 1/3] refs: make sha1 output parameter of refs_resolve_ref_unsafe() optional René Scharfe
2017-09-23  9:44 ` [PATCH 2/3] refs: pass NULL to refs_resolve_ref_unsafe() if hash is not needed René Scharfe
2017-09-23  9:45 ` [PATCH 3/3] refs: pass NULL to resolve_ref_unsafe() " René Scharfe
2017-09-24  1:26 ` Junio C Hamano [this message]
2017-09-24 12:39   ` [PATCH 1/3] refs: make sha1 output parameter of refs_resolve_ref_unsafe() optional René Scharfe
2017-10-01  7:28 ` [PATCH 4/3] refs: pass NULL to refs_resolve_refdup() if hash is not needed René Scharfe
2017-10-01  7:29 ` [PATCH 5/3] refs: pass NULL to resolve_refdup() " René Scharfe
2017-10-01  8:29   ` 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=xmqq60c8j38t.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    --cc=mhagger@alum.mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.