git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] log: Do not decorate replacements with --no-replace-objects
Date: Thu, 25 Aug 2011 20:55:56 +0700	[thread overview]
Message-ID: <CACsJy8BOhU7-aTN2TPRRoQ=_mSfbOstXFRfpyoPmrr_Gbqg0pg@mail.gmail.com> (raw)
In-Reply-To: <ad41e81daa6f9fc4654ae4c312f293202519a5d0.1314279822.git.git@drmicha.warpmail.net>

2011/8/25 Michael J Gruber <git@drmicha.warpmail.net>:
> Make it so that additionally the use of --no-replace-objects is
> detected: I.e. replaced commits are only decorated as replaced when they
> are actually replaced.

Yeah.. I forgot about this.

> @@ -95,7 +95,7 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
>        struct object *obj;
>        enum decoration_type type = DECORATION_NONE;
>
> -       if (!prefixcmp(refname, "refs/replace/")) {
> +       if (read_replace_refs && !prefixcmp(refname, "refs/replace/")) {
>                unsigned char original_sha1[20];
>                if (get_sha1_hex(refname + 13, original_sha1)) {
>                        warning("invalid replace ref %s", refname);

You should put "if (!read_replace_refs) return 0;" inside "if
(!prefixcmp..", otherwise it'll come to the ref decoration code below
and my second paragraph in 5267d29's commit message will be reverted.

I thought my patch was
 - simple
 - replace is rarely used
therefore neglected the tests. Perhaps you can also add a few tests
here. It's not that simple after all.
-- 
Duy

  reply	other threads:[~2011-08-25 13:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 13:44 [PATCH] log: Do not decorate replacements with --no-replace-objects Michael J Gruber
2011-08-25 13:55 ` Nguyen Thai Ngoc Duy [this message]
2011-08-25 15:08   ` Michael J Gruber
2011-08-25 15:09     ` [PATCHv2] " Michael J Gruber
2011-08-25 21:22       ` 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='CACsJy8BOhU7-aTN2TPRRoQ=_mSfbOstXFRfpyoPmrr_Gbqg0pg@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --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).