Re: [PATCH 3/4] for-each-ref --format='%(symref) %(symref:short)'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> It feels ugly that we need to re-resolve the ref when we simply threw
> that information away earlier from when we called resolve_ref in
> get_ref_dir...

It is true and I indeed thought about it while doing the patch, but "how
often would we see symref in the entire refs list, and what percentage of
callers would benefit from seeing this information?" stopped me from going
further in that direction.

> ...
> If we were going to do this for real, I would be tempted to actually
> change the signature of each_ref_fn to take a struct so this doesn't
> come up again.

That would actually be sensible.  Adding symref parameter all over just so
that we do not have to re-resolve symbolic refs in a few codepaths feels
like a "it would have been nicer if things were that way from day one, but
how much does that churn really buys us now" kind of change, but carrying
the full information around in the internal API is a "right thing to do".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]