From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 4C54020193 for ; Thu, 1 Sep 2016 21:12:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753393AbcIAVMp (ORCPT ); Thu, 1 Sep 2016 17:12:45 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:55351 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757176AbcIAVKR (ORCPT ); Thu, 1 Sep 2016 17:10:17 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 2233A3797B; Thu, 1 Sep 2016 14:32:28 -0400 (EDT) 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=Kqbwaymas/sGQzc0M1vSH5tDudE=; b=q8MlvF FnDNWhy9zl/oDJ28qYQmv0i+qfBLwYXTud+0mVlG/xowzQYlHRunzdrX2Cb6Kdy5 i9gCBz8pHNeBzNXkayMXFmBW4/zL8UXJNZFHngbb6wYKKrZHt2mPvGJFOCL+PmyY 46i1SiNc5m2IP7G+aaTvUzJ5JDtD0+qa8FbYk= 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=pnDEQVqEacRl7R+gRbR1pS3giE2cF/3Q ZG14zGmXyn4c67WJyCt6ut/0v0VSMqIQDT4cS44yfNrcDQ+3sJhH3LHpFVx8Dz58 xgt+9ECyNybG+xFmdno6Ks2v6ogNPUppYMrjVLazcLUSOmbbdrHBRLbDP02cgKg3 OqHvYE75MZ4= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 1ACF13797A; Thu, 1 Sep 2016 14:32:28 -0400 (EDT) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 7F70F37979; Thu, 1 Sep 2016 14:32:27 -0400 (EDT) From: Junio C Hamano To: Uma Srinivasan Cc: Jacob Keller , Git Mailing List , Jens Lehmann , Heiko Voigt , Stefan Beller Subject: Re: git submodules implementation question References: Date: Thu, 01 Sep 2016 11:32:25 -0700 In-Reply-To: (Uma Srinivasan's message of "Thu, 1 Sep 2016 09:05:28 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 6F3987F0-7072-11E6-ACD0-51057B1B28F4-77302942!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Uma Srinivasan writes: > Yes, this one line fix addresses my problem. > > So, what is the next step? Will someone submit a patch or should I? > Please note that I've never submitted a patch before, but I don't mind > learning how to. The final version needs to be accompanied with tests to show the effect of this change for callers. A test would set up a top-level and submodule, deliberately break submodule/.git/ repository and show what breaks and how without this change. For example, there is a call in ok_to_remove_submodule() to run "git status" in the submodule directory. A test writer needs to find who calls ok_to_remove_submodule() in what codepath (e.g. builtin/rm.c). Then after figuring out under what condition the check is triggered, write a test that runs "git rm" in a way that this change makes a difference. Hopefully, the test will fail without this change, and will pass with this change. So it is a bit more involved than just a single liner patch with one paragraph log message. I may be able to find or make some time after I tag the 2.10 final this weekend to do so myself. >> --- a/submodule.c >> +++ b/submodule.c >> @@ -1160,4 +1160,5 @@ void prepare_submodule_repo_env(struct argv_array *out) >> if (strcmp(*var, CONFIG_DATA_ENVIRONMENT)) >> argv_array_push(out, *var); >> } >> + argv_array_push(out, "GIT_DIR=.git"); >> } >>