From: Jonathan Nieder <jrnieder@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
Junio C Hamano <gitster@pobox.com>,
Sverre Rabbelier <srabbelier@gmail.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH v2 3/4] fast-export: don't handle uninteresting refs
Date: Tue, 30 Oct 2012 11:59:14 -0700 [thread overview]
Message-ID: <20121030185914.GI15167@elie.Belkin> (raw)
In-Reply-To: <1351617089-13036-4-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras wrote:
> They have been marked as UNINTERESTING for a reason, lets respect that.
This patch looks unsafe, and in the examples listed in the patch
description the changed behavior does not look like an improvement.
Worse, the description lists a few examples but gives no convincing
explanation to reassure about the lack of bad behavior for examples
not listed.
Perhaps this patch has a prerequisite and has come out of order.
Hope that helps,
Jonathan
Patch left unsnipped so we can get a copy in the list archive.
> Currently the first ref is handled properly, but not the rest, so:
>
> % git fast-export master ^master
>
> Would currently throw a reset for master (2nd ref), which is not what we
> want.
>
> % git fast-export master ^foo ^bar ^roo
> % git fast-export master salsa..tacos
>
> Even if all these refs point to the same object; foo, bar, roo, salsa,
> and tacos would all get a reset.
>
> This is most certainly not what we want. After this patch, nothing gets
> exported, because nothing was selected (everything is UNINTERESTING).
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> builtin/fast-export.c | 7 ++++---
> t/t9350-fast-export.sh | 6 ++++++
> 2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/builtin/fast-export.c b/builtin/fast-export.c
> index 065f324..7fb6fe1 100644
> --- a/builtin/fast-export.c
> +++ b/builtin/fast-export.c
> @@ -523,10 +523,11 @@ static void get_tags_and_duplicates(struct object_array *pending,
> typename(e->item->type));
> continue;
> }
> - if (commit->util)
> + if (commit->util) {
> /* more than one name for the same object */
> - string_list_append(extra_refs, full_name)->util = commit;
> - else
> + if (!(commit->object.flags & UNINTERESTING))
> + string_list_append(extra_refs, full_name)->util = commit;
> + } else
> commit->util = full_name;
> }
> }
> diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
> index 49bdb44..6ea8f6f 100755
> --- a/t/t9350-fast-export.sh
> +++ b/t/t9350-fast-export.sh
> @@ -440,4 +440,10 @@ test_expect_success 'fast-export quotes pathnames' '
> )
> '
>
> +test_expect_success 'proper extra refs handling' '
> + git fast-export master ^master master..master > actual &&
> + echo -n > expected &&
> + test_cmp expected actual
> +'
> +
> test_done
> --
> 1.8.0
next prev parent reply other threads:[~2012-10-30 19:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1351617089-13036-1-git-send-email-felipe.contreras@gmail.com>
[not found] ` <1351617089-13036-5-git-send-email-felipe.contreras@gmail.com>
2012-10-30 18:12 ` [PATCH v2 4/4] fast-export: make sure refs are updated properly Sverre Rabbelier
2012-10-30 18:47 ` Felipe Contreras
2012-10-30 21:17 ` Sverre Rabbelier
2012-10-30 21:35 ` Felipe Contreras
2012-10-30 21:38 ` Jonathan Nieder
2012-10-30 21:41 ` Felipe Contreras
2012-10-30 21:59 ` Sverre Rabbelier
2012-10-30 22:18 ` Felipe Contreras
2012-10-30 22:35 ` Sverre Rabbelier
2012-10-30 22:56 ` Felipe Contreras
[not found] ` <1351617089-13036-2-git-send-email-felipe.contreras@gmail.com>
2012-10-30 18:55 ` [PATCH v2 1/4] fast-export: trivial cleanup Jonathan Nieder
[not found] ` <1351617089-13036-3-git-send-email-felipe.contreras@gmail.com>
2012-10-30 18:57 ` [PATCH v2 2/4] fast-export: fix comparisson in tests Jonathan Nieder
[not found] ` <1351617089-13036-4-git-send-email-felipe.contreras@gmail.com>
2012-10-30 18:59 ` Jonathan Nieder [this message]
2012-10-30 19:17 ` [PATCH v2 3/4] fast-export: don't handle uninteresting refs Felipe Contreras
2012-10-30 21:40 ` Felipe Contreras
2012-10-30 21:45 ` Jonathan Nieder
2012-10-30 22:01 ` Felipe Contreras
2012-10-30 22:07 ` Jonathan Nieder
2012-10-30 22:22 ` Felipe Contreras
2012-10-30 23:55 ` Jonathan Nieder
2012-10-31 1:03 ` Felipe Contreras
2012-10-31 1:08 ` Jonathan Nieder
2012-10-31 1:39 ` Felipe Contreras
2012-10-31 1:51 ` Jonathan Nieder
2012-10-31 2:22 ` Felipe Contreras
2012-10-31 0:57 ` Jonathan Nieder
2012-10-31 1:23 ` Felipe Contreras
2012-10-31 1:35 ` Jonathan Nieder
[not found] ` <20121030184755.GC15167@elie.Belkin>
[not found] ` <CAMP44s2F3qJeGL4V5KZjFNqKA5hrFQKRxXMrakFA6pTNi1DZ3w@mail.gmail.com>
[not found] ` <20121030190126.GJ15167@elie.Belkin>
[not found] ` <CAMP44s1W4mwK+cNwBqu2S0=Aw04XX9KBan8w4ghyzqbODdmiLQ@mail.gmail.com>
2012-10-30 19:41 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121030185914.GI15167@elie.Belkin \
--to=jrnieder@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=srabbelier@gmail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).