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=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14147 invoked from network); 22 Aug 2021 17:10:25 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 22 Aug 2021 17:10:25 -0000 Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob1.topicbox.com (Postfix) with ESMTP id BD168313AC for ; Sun, 22 Aug 2021 13:10:22 -0400 (EDT) (envelope-from bounce.mMd1cc4902bb399c16511e2f9b.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id B717D33344B3; Sun, 22 Aug 2021 13:10:22 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=eigenstate.org; spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:to:date:from:mime-version :content-type:content-transfer-encoding:list-help:list-id :list-post:list-subscribe:reply-to:subject:list-unsubscribe; s= sysmsg-1; t=1629652222; bh=PQDhLs7VGFLQbfExDD/tAN3zOaWVMnV3IFIuY tS31pM=; b=E0pz5cmOzm2ikbExU6vxjfm/9zb2nflvR9xYurJfsvJkjf2Lt9dSa jGo+4Yo/vlOFLsdlGtssC7reMJzmJfTxCZjY+ZFDdFLNwFaneD0lBruKN08mF9FQ D2N1bWdLmotulyYU3VYTs6lJ6c20/HPFPXLrP3bCEkeC8iZrl9Equc= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1629652222; b=RIDYjhixtHPn/XsaK6CjpE5/z7pYEeoirX5vlnPGCRavQpKPOD AhNmgYBu98NhEQJiuW6WOVQgdLDm3A7IWZyDMAy+7KCnQfKY1HyVS9jK7yXeo0hN eFnTI+HQGKWr2/VtXqymTx7paGZYa89GsDUUubHtph2fYp9w2JUs2qhnc= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=eigenstate.org; spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=eigenstate.org; iprev=pass smtp.remote-ip=206.124.132.107 (mimir.eigenstate.org); spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mimir.eigenstate.org policy.ptr=mimir.eigenstate.org; x-return-mx=pass header.domain=eigenstate.org policy.is_org=yes (MX Records found: eigenstate.org,kusuri.pikopiko.org,nokogiri.pikopiko.org,mail.pikopiko.org); x-return-mx=pass smtp.domain=eigenstate.org policy.is_org=yes (MX Records found: eigenstate.org,kusuri.pikopiko.org,nokogiri.pikopiko.org,mail.pikopiko.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=message-id :to:date:from:mime-version:content-type :content-transfer-encoding:list-help:list-id:list-post :list-subscribe:reply-to:subject:list-unsubscribe; s=dkim-1; bh= IORL5DdfH+jMTONxKE3y6L4x1+016Xi5SJljkdr6i3I=; b=m9hmSI73jDVkl1xW 0Vvo37zMaSSEEnlSymZTyLjsWLv193so9JINcj48RR57QzTFUQ7Ukq76alli5yDj P1gL7H938T8naSdfP/b+0rvsW4oMZu0rXzkfnFciWuQcRzvW3Qr4DBenkxvAbVNi oMJjcq3oODiAtpgZcTlSY9ACXNQ= Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id 65B383334045 for <9fans@9fans.net>; Sun, 22 Aug 2021 13:10:12 -0400 (EDT) (envelope-from ori@eigenstate.org) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 13E11864A01; Sun, 22 Aug 2021 13:10:12 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1629652212; b=dUXZDLzu0EQG1wt99BwUmKQRObWMQYR6asoJsyYDAq4F+n3DOP RyUVnVJ2bb0qJ/Hrq6mgZtqGy4OeoyEkiaZFq+vJwnxeyZ9WY6uTSAJXLlMBOdbR 060gjQRUOpQgXrVg8qXrJ0XDOsoBnhKD/qzaje2pZBltluGYAS56hLwcxdRkz8JY RwVGq8J0Cqpwj/YSLjK6imoD9mmk0Hz3PBGoLLJx2VjUOMug6CemuEy9g58SnSDd C62fwJ9qnTTNsaVeN7x4+dtxPGyNCiK0K/NMw7vICDiPDnqUVdrzDr8QIR2eaYC0 I79MwqtiqXY9dS+ya2TKAVxrhs8S6VvJuQlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:to:subject:date:from:mime-version :content-type:content-transfer-encoding; s=arcseal; t= 1629652212; bh=e5tDOOgIIDpdagiy0vFwbCADInxPbvREMzZS4e0m/tk=; b=B C5Mtq1mGjz7Ye46t+KpIRI00+8p5GuvMTQFf5gJX+HIS4oMJhlWif+y+ECqprM/u SnJ1HeAYbFfQCQ1S8jJ2KR40OxayRVcqsoDULSFZ/Hbid7UwmmuYBouK6JjYoc4u xk0FXVo4GVDNxwIhu8M1fZmfnlSL4Lfpnxkw07eIAD4yiA87dEyVB0v+Q634aSqN Era525d8QW/apRo0RJ885QJ0eiYUQsixDh9GEWL00DX3Vfm9rEbOpxLAbgraSGcn b/LQ42dt4SGpQfw/kJ6Q4YxJG2jKPy8t4yAV8j2hxZxZQrl4gJoaEw24ROkhH+GC v5WUEKOHMPzUCNtWoMoSg== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=eigenstate.org; iprev=pass smtp.remote-ip=206.124.132.107 (mimir.eigenstate.org); spf=pass smtp.mailfrom=ori@eigenstate.org smtp.helo=mimir.eigenstate.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mimir.eigenstate.org policy.ptr=mimir.eigenstate.org; x-return-mx=pass header.domain=eigenstate.org policy.is_org=yes (MX Records found: eigenstate.org,kusuri.pikopiko.org,nokogiri.pikopiko.org,mail.pikopiko.org); x-return-mx=pass smtp.domain=eigenstate.org policy.is_org=yes (MX Records found: eigenstate.org,kusuri.pikopiko.org,nokogiri.pikopiko.org,mail.pikopiko.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtuddgledtucdltddurdegudelrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgf nhhsuhgsshgtrhhisggvpdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttd enucenucfjughrpefkvffufffhgggtgfesthejjedttddtvdenucfhrhhomhepohhrihes vghighgvnhhsthgrthgvrdhorhhgnecuggftrfgrthhtvghrnhepleeiteehieetfeevff duvdelgfffgeffvdevleelgfeliefhhfdvtdfhteeikefhnecukfhppedvtdeirdduvdeg rddufedvrddutdejpdejgedruddtkedrheeirddvvdehnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehinhgvthepvddtiedruddvgedrudefvddruddtjedphhgvlhho pehmihhmihhrrdgvihhgvghnshhtrghtvgdrohhrghdpmhgrihhlfhhrohhmpeeoohhrih esvghighgvnhhsthgrthgvrdhorhhgqe X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (eigenstate.org: 206.124.132.107 is authorized to use 'ori@eigenstate.org' in 'mfrom' identity (mechanism 'mx' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="ori@eigenstate.org"; helo=mimir.eigenstate.org; client-ip=206.124.132.107 Received: from mimir.eigenstate.org (mimir.eigenstate.org [206.124.132.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sun, 22 Aug 2021 13:10:10 -0400 (EDT) (envelope-from ori@eigenstate.org) Received: from abbatoir.myfiosgateway.com (pool-74-108-56-225.nycmny.fios.verizon.net [74.108.56.225]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 481e8266 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9fans@9fans.net>; Sun, 22 Aug 2021 10:10:09 -0700 (PDT) Message-ID: To: 9fans@9fans.net Date: Sun, 22 Aug 2021 13:10:08 -0400 From: ori@eigenstate.org MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: d29097b2-036b-11ec-b7aa-94604ef55c22 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UNDAzZjkwZTNiMDUwOTcwNC1NZDFjYzQ5MDJiYjM5OWMxNjUxMWUy?= =?UTF-8?B?ZjliPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Subject: [9fans] git/{diff,import}: make it easier to handle manually-asembled patch emails List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:Md1cc4902bb399c16511e2f9b:1:TNaaqDy0LKOaCcV-BrPYm78Znw3zNGlKX21FgVVMROM Often, people (including myself) will write emails that can almost be applied with git/import. This changes git/diff and git/import so that things will generally work even when assembling diffs by hand: 1. git/import becomes slightly more lax: ^diff ... ^--- ... will both be detected as the start of a patch. 2. git/diff produces the same format of diff as git/export, starting with paths: --- a/path/to/file +++ b/path/to/file which means that the 'ape/patch -p1' used within git/import will just work. So with this, if you send an email to the mailing list, write up a committable description, and append the output of git/diff to the end of the email, git/import should just work. [this patch was send through the mailing list using the above procedure, and will be committed with git/import to verify that it works as advertised] diff 8c228a123fa0c6062570964011854302bbf57242 uncommitted --- a/sys/src/cmd/git/diff +++ b/sys/src/cmd/git/diff @@ -26,12 +26,16 @@ git/query -c $commit HEAD | subst '^..' } =20 +mntgen /mnt/scratch +bind $branch/tree/ /mnt/scratch/a +bind . /mnt/scratch/b +echo diff `{git/query $commit} uncommitted for(f in `$nl{lsdirty | sort | uniq}){ - orig=3D$branch/tree/$f - if(! test -f $orig) + cd /mnt/scratch + if(! test -f a/$f) orig=3D/dev/null - if(! test -f $f) + if(! test -f b/$f) f=3D/dev/null - diff -u $orig $f + diff -u a/$f b/$f } exit '' --- a/sys/src/cmd/git/import +++ b/sys/src/cmd/git/import @@ -45,7 +45,7 @@ state=3D"body" next } - (state=3D=3D"headers" || state=3D=3D"body") && (/^diff/ || /^---[ = ]*$/){ + (state=3D=3D"headers" || state=3D=3D"body") && (/^diff / || /^--- /= ){ state=3D"diff" } state=3D=3D"body" { ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T403f90e3b0509704-Md1cc4= 902bb399c16511e2f9b Delivery options: https://9fans.topicbox.com/groups/9fans/subscription