From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 23427 invoked from network); 19 Apr 2022 14:02:55 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 19 Apr 2022 14:02:55 -0000 Received: from mail.9lab.org ([168.119.8.41]) by 9front; Tue Apr 19 09:58:40 -0400 2022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9lab.org; s=20210803; t=1650376705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to; bh=Tyw6u1Qd96p6wak6IbmvoKgcTbXVpPS+cM7DOZOH2Og=; b=N5dqID7p/5IiCHKrjhpE18AWKga7UVtH8Nu16sTEClmnUB4nDhsmKfQN+iM+oPhtMWSlty cXBrHYvgphBvP41Psat73z3V1L5BZ+GMJcTi1i1mGNTbwxB01mgrH4T5wycEM7F8cnsVg7 rXOYd1OqAXH4029iJdh9lbgAsiWIZkA= Received: from rob.9lab.home (host-185-64-155-70.ecsnet.at [185.64.155.70]) by mail.9lab.org (OpenSMTPD) with ESMTPSA id 00e2a5e5 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Tue, 19 Apr 2022 15:58:25 +0200 (CEST) Message-ID: <22A0BF0B084D30FF74396E5F3D0D07FD@9lab.org> To: 9front@9front.org CC: igor@9lab.org, ori@eigenstate.org Date: Tue, 19 Apr 2022 15:58:23 +0200 From: igor@9lab.org In-Reply-To: <395F6014FC64E259F1D1574BDA898664@eigenstate.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: content-addressed open XML over SVG plugin scripting-scale locator Subject: Re: [9front] [PATCH] git/merge: fix merge if directory of merged file does not exist Reply-To: 9front@9front.org Precedence: bulk Quoth ori@eigenstate.org: > Quoth igor@9lab.org: > > When merging from branch `front` to `test` the following test case > > fails: > > > > > > > > A solution is to check if the folder exists and create it via `mkdir -p` > > in case it doesn't. > > > > Can someone have a look and confirm this is the right solution and not > > a hack. If this is Ok plz let me know and I can push the fix. > > > > I've got that added in my patch queue, slightly differently; > because mkdir -p always succeeds, there's no need for the if. Excellent, then I will wait for you to push that one ☺ There is one more instance of mkdir -p in gitup, you probably have that one converted as well to remove the test (see highlighted part): fn gitup{ gitroot=`{git/conf -r >[2]/dev/null} if(~ $#gitroot 0) die 'not a git repository' gitfs=$gitroot/.git/fs gitrel=`{pwd | drop $gitroot | sed 's@^/@@'} if(~ $#gitrel 0) gitrel='.' cd $gitroot startfs=() if(! test -d $gitfs) mkdir -p $gitfs ^^^^^^^^^^^^^^^^^^^^^^^^^^ if(! test -e $gitfs/ctl) startfs=true if(! grep -s '^repo '$gitroot'$' $gitfs/ctl >[2]/dev/null) startfs=true if(~ $#startfs 1) git/fs if not status='' }