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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id DC8D51F5AE for ; Fri, 23 Apr 2021 23:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232438AbhDWX7B (ORCPT ); Fri, 23 Apr 2021 19:59:01 -0400 Received: from mav.lukeshu.com ([104.207.138.63]:36022 "EHLO mav.lukeshu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232101AbhDWX7A (ORCPT ); Fri, 23 Apr 2021 19:59:00 -0400 Received: from lukeshu-dw-thinkpad (unknown [IPv6:2601:281:8200:26:4e34:88ff:fe48:5521]) by mav.lukeshu.com (Postfix) with ESMTPSA id 353FB80590; Fri, 23 Apr 2021 19:58:21 -0400 (EDT) Date: Fri, 23 Apr 2021 17:58:20 -0600 Message-ID: <87y2d8a6zn.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: Eric Sunshine Cc: Luke Shumaker , Git List , Avery Pennarun , Charles Bailey , Danny Lin , "David A . Greene" , David Aguilar , Jakub Suder , James Denholm , Jeff King , Jonathan Nieder , Junio C Hamano , =?UTF-8?B?Tmd1?= =?UTF-8?B?eeG7hW4g?= =?ISO-8859-1?Q?Th=E1i_?= =?UTF-8?B?Tmfhu41j?= Duy , Roger L Strain , Techlive Zheng , Luke Shumaker Subject: Re: [PATCH 23/30] subtree: add comments and sanity checks In-Reply-To: References: <20210423194230.1388945-1-lukeshu@lukeshu.com> <20210423194230.1388945-24-lukeshu@lukeshu.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, 23 Apr 2021 14:58:34 -0600, Eric Sunshine wrote: > > On Fri, Apr 23, 2021 at 3:43 PM Luke Shumaker wrote: > > Signed-off-by: Luke Shumaker > > --- > > diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh > > @@ -248,17 +263,22 @@ rev_exists () { > > +# Usage: try_remove_previous REV > > +# > > # if a commit doesn't have a parent, this might not work. But we only want > > s/if/If/ perhaps Ack. > > # to remove the parent from the rev-list, and since it doesn't exist, it won't > > # be there anyway, so do nothing in that case. > > @@ -302,10 +322,12 @@ find_latest_squash () { > > +# Usage: find_existing_splits DIR REV > > find_existing_splits () { > > + assert test $# = 2 > > debug "Looking for prior splits..." > > dir="$1" > > - revs="$2" > > + rev="$2" > > @@ -314,7 +336,7 @@ find_existing_splits () { > > git log --grep="$grep_format" \ > > - --no-show-signature --pretty=format:'START %H%n%s%n%n%b%nEND%n' $revs | > > + --no-show-signature --pretty=format:'START %H%n%s%n%n%b%nEND%n' "$rev" | > > The caller of this function is passing in "$revs". Did you make this > semantic change because the caller's `revs` is guaranteed to be a > single rev? In any case, this change may deserve mention in the commit > message so readers don't have to wonder about it. No it's not? The only caller is unrevs="$(find_existing_splits "$dir" "$rev")" || exit $? But yeah, this would be a good thing for me to call out in the commit message. -- Happy hacking, ~ Luke Shumaker