git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Joey Hess <joey@kitenet.net>
Subject: Re: [PATCH 0/5] teach replace objects to sha1_object_info_extended()
Date: Mon, 2 Dec 2013 09:52:25 -0500	[thread overview]
Message-ID: <20131202145225.GA12457@sigill.intra.peff.net> (raw)
In-Reply-To: <20131130133934.2697.75781.chriscool@tuxfamily.org>

On Sat, Nov 30, 2013 at 02:51:18PM +0100, Christian Couder wrote:

> Here is a patch series to improve the way sha1_object_info_extended()
> behaves when it is passed a replaced object.
> [...]
> Christian Couder (5):
>   replace_object: don't check read_replace_refs twice
>   introduce lookup_replace_object_extended() to pass flags
>   Add an "unsigned flags" parameter to sha1_object_info_extended()
>   t6050: show that git cat-file --batch fails with replace objects
>   sha1_file: perform object replacement in sha1_object_info_extended()

Overall looks OK to me.

I find it a little funny that we reuse the READ_SHA1_FILE_REPLACE flag
directly in lookup_replace_object. That means that it is now a
meaningful flag for sha1_object_info_extended, even though the name does
not say so. It also means that the two may have to coordinate further
flags (since a portion of their flag namespace is shared by
lookup_replace_object). I don't foresee adding a lot of new flags,
though, so it probably isn't a huge deal.

I also would have expected sha1_object_info_extended to simply receive
the new flag via the struct object_info. Again, probably not a big deal,
because there aren't many callsites that needed updating. But if we were
not sharing flags with read_sha1_file, I think doing it as a flag in the
struct would be nicer.

I checked the resulting behavior against the list I made earlier; looks
like all of the _extended callsites are doing the right thing.

I do think the checks you added in 277336a (replace: forbid replacing an
object with one of a different type, 2013-09-06) need updating. I
started on that, but I wonder if all of cmd_replace should simply turn
off read_replace_refs. I'd think it would always want to be dealing with
the true objects.

-Peff

  parent reply	other threads:[~2013-12-02 14:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-30 13:51 [PATCH 0/5] teach replace objects to sha1_object_info_extended() Christian Couder
2013-11-30 13:51 ` [PATCH 1/5] replace_object: don't check read_replace_refs twice Christian Couder
2013-11-30 13:51 ` [PATCH 2/5] introduce lookup_replace_object_extended() to pass flags Christian Couder
2013-11-30 13:51 ` [PATCH 3/5] Add an "unsigned flags" parameter to sha1_object_info_extended() Christian Couder
2013-11-30 13:51 ` [PATCH 4/5] t6050: show that git cat-file --batch fails with replace objects Christian Couder
2013-11-30 13:51 ` [PATCH 5/5] sha1_file: perform object replacement in sha1_object_info_extended() Christian Couder
2013-12-02 14:52 ` Jeff King [this message]
2013-12-02 15:06   ` [PATCH 0/5] teach replace objects to sha1_object_info_extended() Jeff King
2013-12-02 23:41     ` Junio C Hamano
2013-12-03 20:42       ` Christian Couder
2013-12-03 20:46   ` Christian Couder

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=20131202145225.GA12457@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=joey@kitenet.net \
    /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).