From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C489C1F46C for ; Tue, 21 Jan 2020 18:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729138AbgAUSWn (ORCPT ); Tue, 21 Jan 2020 13:22:43 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:59346 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728186AbgAUSWn (ORCPT ); Tue, 21 Jan 2020 13:22:43 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 6B48035C24; Tue, 21 Jan 2020 13:22:41 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=mGxvJ5icGNmjBzYM56AIWsRYPoM=; b=rAGYmJ 0DVa53MKwwO7TIw4HWHI1QWfk08XyWOV7t7/rsiZTzRFgFHvlE0X6EFnwgLLUZsr mpaQO4wMacxLh4StuPc3SjjmnPXd9DlvqINulwqDIevw9/4YeJL1FSFsz+0i5BcW SiU8vbCFznXlCG0rWsn1gIfvOtu0kRKqaYcNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ItpQLXVNnZbew3mj2RaeGn0PE4/I0Nss fEbIbKKnHLEc/BsntSgFs4DhzFa4GrmDSvHMi0L4c7F36Jy2fxkr6QinytrTwT+w 7DrqtLsfYxm4uX3Lz6K8b0KZkjnJgg8W+r7hh31tnGOMrgXebIW/93ajwxeWQyd6 Z9zE9mXAwDk= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 636A935C23; Tue, 21 Jan 2020 13:22:41 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.76.80.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id C8AE935C22; Tue, 21 Jan 2020 13:22:40 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: Derrick Stolee via GitGitGadget , git@vger.kernel.org, jrnieder@gmail.com, Derrick Stolee Subject: Re: [PATCH v2] fetch: document and test --refmap="" References: <20200121162433.GA6215@coredump.intra.peff.net> Date: Tue, 21 Jan 2020 10:22:39 -0800 In-Reply-To: <20200121162433.GA6215@coredump.intra.peff.net> (Jeff King's message of "Tue, 21 Jan 2020 11:24:33 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 027A3244-3C7B-11EA-BAEC-D1361DBA3BAF-77302942!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > On Tue, Jan 21, 2020 at 01:38:12AM +0000, Derrick Stolee via GitGitGadget wrote: > >> Update the documentation to clarify how '--refmap=""' works and >> create tests to guarantee this behavior remains in the future. > > Yeah, this looks like a good solution to me. > >> This can be accomplished by overriding the configured refspec using >> '--refmap=' along with a custom refspec: >> >> git fetch --refmap= +refs/heads/*:refs/hidden//* > > This isn't strictly related to your patch, but since the rationale here > describes the concept of a background job and people might end up using > it as a reference, do you want to add in --no-tags to help them out? Also, is the order of the arguments correct? I would have expected to see after all dashed options and before refspecs. > If it makes you feel better, I only found --refmap because I was the one > who implemented the original "update based on refspecs" logic, and while > looking for that commit with "git log --grep=opportunistic" I stumbled > onto Junio's commit adding --refmap, which referenced mine. Maybe this > also works as a good case study in why we should write good commit > messages and refer to related work. :) ;-) > Anyway, I wasn't at all sure that a blank --refmap= would do what you > want until I tried it. But it was always intended to work that way. From > c5558f80c3 (fetch: allow explicit --refmap to override configuration, > 2014-05-29): > > +static int parse_refmap_arg(const struct option *opt, const char *arg, int unset) > +{ > + ALLOC_GROW(refmap_array, refmap_nr + 1, refmap_alloc); > + > + /* > + * "git fetch --refmap='' origin foo" > + * can be used to tell the command not to store anywhere > + */ > + if (*arg) > + refmap_array[refmap_nr++] = arg; > + return 0; > +} Good analysis, and also the answer to my previous question is also there ;-)